X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fload.lisp;h=c4f11311eb390cb912c3c5b6aa8093447462210e;hb=dae76a317682df7472ee85d1a0f6a0248801a6ae;hp=02a029393eb9b285ba883aa499047a350680146e;hpb=1b778d435773891979dab6d442c19f2b7b62b869;p=sbcl.git diff --git a/src/code/load.lisp b/src/code/load.lisp index 02a0293..c4f1131 100644 --- a/src/code/load.lisp +++ b/src/code/load.lisp @@ -336,6 +336,11 @@ #!+sb-show (defvar *show-fops-p* nil) +;; buffer for loading symbols +(defvar *fasl-symbol-buffer*) +(declaim (simple-string *fasl-symbol-buffer*)) + +;;; ;;; a helper function for LOAD-AS-FASL ;;; ;;; Return true if we successfully load a group from the stream, or @@ -348,31 +353,26 @@ (loop (let ((byte (read-byte stream))) - ;; stale code from before rewrite of *FOP-STACK* as - ;; adjustable vector (probably worth rewriting when next - ;; anyone needs to debug FASL stuff) - #| ;; Do some debugging output. #!+sb-show (when *show-fops-p* - (let ((ptr *fop-stack-pointer*) - (stack *fop-stack*)) - (fresh-line *trace-output*) - ;; The FOP operations are stack based, so it's sorta - ;; logical to display the operand before the operator. - ;; ("reverse Polish notation") - (unless (= ptr (length stack)) - (write-char #\space *trace-output*) - (prin1 (svref stack ptr) *trace-output*) - (terpri *trace-output*)) - ;; Display the operator. - (format *trace-output* - "~&~S (#X~X at ~D) (~S)~%" - (svref *fop-names* byte) - byte - (1- (file-position stream)) - (svref *fop-funs* byte)))) - |# + (let* ((stack *fop-stack*) + (ptr (1- (fill-pointer *fop-stack*)))) + (fresh-line *trace-output*) + ;; The FOP operations are stack based, so it's sorta + ;; logical to display the operand before the operator. + ;; ("reverse Polish notation") + (unless (= ptr -1) + (write-char #\space *trace-output*) + (prin1 (aref stack ptr) *trace-output*) + (terpri *trace-output*)) + ;; Display the operator. + (format *trace-output* + "~&~S (#X~X at ~D) (~S)~%" + (aref *fop-names* byte) + byte + (1- (file-position stream)) + (svref *fop-funs* byte)))) ;; Actually execute the fop. (funcall (the function (svref *fop-funs* byte))))))))) @@ -388,6 +388,7 @@ (maybe-announce-load stream verbose) (sb!thread:with-recursive-lock (sb!c::*big-compiler-lock*) (let* ((*fasl-input-stream* stream) + (*fasl-symbol-buffer* (make-string 100)) (*current-fop-table* (or (pop *free-fop-tables*) (make-array 1000))) (*current-fop-table-size* (length *current-fop-table*)) (*fop-stack* (make-array 100 :fill-pointer 0 :adjustable t))) @@ -406,7 +407,7 @@ ;;; code for foreign symbol lookup should be here. (defun find-foreign-symbol-in-table (name table) (let ((prefixes - #!+(or osf1 sunos linux freebsd darwin) #("" "ldso_stub__") + #!+(or osf1 sunos linux freebsd netbsd darwin) #("" "ldso_stub__") #!+openbsd #(""))) (declare (notinline some)) ; to suppress bug 117 bogowarning (some (lambda (prefix)