X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fgeneric%2Fcore.lisp;h=c4b2f7f5cf93c88c40b413e6bbc71ffe7a91945a;hb=75b52379bdc2269961af6a1308eca63610f38ac3;hp=db0196bf6d2fd8877229e49384492276dcaaf6bc;hpb=cea4896b2482b7b2b429c1631d774b4cfbc0efba;p=sbcl.git diff --git a/src/compiler/generic/core.lisp b/src/compiler/generic/core.lisp index db0196b..c4b2f7f 100644 --- a/src/compiler/generic/core.lisp +++ b/src/compiler/generic/core.lisp @@ -17,7 +17,8 @@ (:constructor make-core-object ()) #-no-ansi-print-object (:print-object (lambda (x s) - (print-unreadable-object (x s :type t))))) + (print-unreadable-object (x s :type t)))) + (:copier nil)) ;; A hashtable translating ENTRY-INFO structures to the corresponding actual ;; FUNCTIONs for functions in this compilation. (entry-table (make-hash-table :test 'eq) :type hash-table) @@ -30,7 +31,7 @@ (debug-info () :type list)) ;;; Note the existence of FUNCTION. -(defun note-function (info function object) +(defun note-fun (info function object) (declare (type function function) (type core-object object)) (let ((patch-table (core-object-patch-table object))) @@ -41,32 +42,37 @@ (values)) ;;; Do "load-time" fixups on the code vector. -(defun do-core-fixups (code fixups) - (declare (list fixups)) - (dolist (info fixups) - (let* ((kind (first info)) - (fixup (second info)) +(defun do-core-fixups (code fixup-notes) + (declare (list fixup-notes)) + (dolist (note fixup-notes) + (let* ((kind (fixup-note-kind note)) + (fixup (fixup-note-fixup note)) + (position (fixup-note-position note)) (name (fixup-name fixup)) (flavor (fixup-flavor fixup)) - (offset (third info)) (value (ecase flavor (:assembly-routine - (assert (symbolp name)) + (aver (symbolp name)) (or (gethash name *assembler-routines*) (error "undefined assembler routine: ~S" name))) (:foreign - (assert (stringp name)) - (or (sb!impl::foreign-symbol-address-as-integer name) - (error "unknown foreign symbol: ~S"))) + (aver (stringp name)) + ;; FOREIGN-SYMBOL-ADDRESS-AS-INTEGER signals an error + ;; if the symbol isn't found. + (foreign-symbol-address-as-integer name)) + #!+linkage-table + (:foreign-dataref + (aver (stringp name)) + (foreign-symbol-address-as-integer name t)) #!+x86 (:code-object - (assert (null name)) + (aver (null name)) (values (get-lisp-obj-address code) t))))) - (sb!vm:fixup-code-object code offset value kind)))) + (sb!vm:fixup-code-object code position value kind)))) -;;; Stick a reference to the function Fun in Code-Object at index I. If the -;;; function hasn't been compiled yet, make a note in the Patch-Table. -(defun reference-core-function (code-obj i fun object) +;;; Stick a reference to the function FUN in CODE-OBJECT at index I. If the +;;; function hasn't been compiled yet, make a note in the patch table. +(defun reference-core-fun (code-obj i fun object) (declare (type core-object object) (type functional fun) (type index i)) (let* ((info (leaf-info fun)) @@ -77,9 +83,9 @@ (gethash info (core-object-patch-table object))))) (values)) -;;; Call the top-level lambda function dumped for Entry, returning the -;;; values. Entry may be a :TOP-LEVEL-XEP functional. -(defun core-call-top-level-lambda (entry object) +;;; Call the top level lambda function dumped for ENTRY, returning the +;;; values. ENTRY may be a :TOPLEVEL-XEP functional. +(defun core-call-toplevel-lambda (entry object) (declare (type functional entry) (type core-object object)) (funcall (or (gethash (leaf-info entry) (core-object-entry-table object)) @@ -88,9 +94,9 @@ ;;; Backpatch all the DEBUG-INFOs dumped so far with the specified ;;; SOURCE-INFO list. We also check that there are no outstanding forward ;;; references to functions. -(defun fix-core-source-info (info object source-info) +(defun fix-core-source-info (info object &optional source-info) (declare (type source-info info) (type core-object object)) - (assert (zerop (hash-table-count (core-object-patch-table object)))) + (aver (zerop (hash-table-count (core-object-patch-table object)))) (let ((res (debug-source-for-info info))) (dolist (sinfo res) (setf (debug-source-info sinfo) source-info))