X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fgeneric%2Fcore.lisp;h=f5b58efd8bcc7eeff5ca24208c360a5b8b28543f;hb=dc33d6a6b84f8338e603759cec8e25da29055d50;hp=8ea0cbd0ed14503ac621243160cc6480be0f031f;hpb=d40a76606c86722b0aef8179155f9f2840739b72;p=sbcl.git diff --git a/src/compiler/generic/core.lisp b/src/compiler/generic/core.lisp index 8ea0cbd..f5b58ef 100644 --- a/src/compiler/generic/core.lisp +++ b/src/compiler/generic/core.lisp @@ -42,14 +42,14 @@ (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 (aver (symbolp name)) @@ -57,17 +57,22 @@ (error "undefined assembler routine: ~S" name))) (:foreign (aver (stringp name)) - (or (foreign-symbol-address-as-integer name) - (error "unknown foreign symbol: ~S"))) - #!+x86 + ;; FOREIGN-SYMBOL-ADDRESS signals an error + ;; if the symbol isn't found. + (foreign-symbol-address name)) + #!+linkage-table + (:foreign-dataref + (aver (stringp name)) + (foreign-symbol-address name t)) + #!+(or x86 x86-64) (:code-object (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)) @@ -87,15 +92,15 @@ (error "Unresolved forward reference.")))) ;;; 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 &optional source-info) - (declare (type source-info info) (type core-object object)) +;;; SOURCE-INFO list. We also check that there are no outstanding +;;; forward references to functions. +(defun fix-core-source-info (info object &optional function) + (declare (type core-object object) + (type (or null function) function)) (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)) + (let ((source (debug-source-for-info info))) + (setf (debug-source-function source) function) (dolist (info (core-object-debug-info object)) - (setf (compiled-debug-info-source info) res)) - (setf (core-object-debug-info object) ())) + (setf (debug-info-source info) source))) + (setf (core-object-debug-info object) nil) (values))