X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fbyte-interp.lisp;h=738f9013fd582e15cc99c9f7e69183d62f970fab;hb=7dd568fb64927be78556ac27f1f0dc60e79cf942;hp=cda60065bdd1c3afe5755280c492cf6ad9e78b8e;hpb=6879a37a9e6cceeab810636c5ef4a4da1444e275;p=sbcl.git diff --git a/src/code/byte-interp.lisp b/src/code/byte-interp.lisp index cda6006..738f901 100644 --- a/src/code/byte-interp.lisp +++ b/src/code/byte-interp.lisp @@ -50,16 +50,13 @@ ((nil))) `(function ,(res) *)))))) -;;;; the evaluation stack +;;;; the 'evaluation stack' +;;;; +;;;; (The name dates back to CMU CL, when it was used for the IR1 +;;;; interpreted implementation of EVAL. In SBCL >=0.7.0, it's just +;;;; the byte interpreter stack.) -;;; the interpreter's evaluation stack (defvar *eval-stack* (make-array 100)) ; will grow as needed -;;; FIXME: This seems to be used by the ordinary (non-byte) interpreter -;;; too, judging from a crash I had when I removed byte-interp.lisp from -;;; the cold build sequence. It would probably be clearer to pull the -;;; shared interpreter machinery out of the byte interpreter and ordinary -;;; interpreter files and put them into their own file shared-interp.lisp -;;; or something. ;;; the index of the next free element of the interpreter's evaluation stack (defvar *eval-stack-top* 0) @@ -113,7 +110,9 @@ (new-sp-var (gensym "NEW-SP-")) (decls nil)) (loop - (unless (and (consp body) (consp (car body)) (eq (caar body) 'declare)) + (unless (and (consp body) + (consp (car body)) + (eq (caar body) 'declare)) (return)) (push (pop body) decls)) `(let ((,new-sp-var (- *eval-stack-top* ,num-vars))) @@ -398,17 +397,17 @@ ;;;; miscellaneous primitive stubs -(macrolet ((frob (name &optional (args '(x))) +(macrolet ((def-frob (name &optional (args '(x))) `(defun ,name ,args (,name ,@args)))) - (frob %CODE-CODE-SIZE) - (frob %CODE-DEBUG-INFO) - (frob %CODE-ENTRY-POINTS) - (frob %FUNCALLABLE-INSTANCE-FUNCTION) - (frob %FUNCALLABLE-INSTANCE-LAYOUT) - (frob %FUNCALLABLE-INSTANCE-LEXENV) - (frob %FUNCTION-NEXT) - (frob %FUNCTION-SELF) - (frob %SET-FUNCALLABLE-INSTANCE-FUNCTION (fin new-val))) + (def-frob %code-code-size) + (def-frob %code-debug-info) + (def-frob %code-entry-points) + (def-frob %funcallable-instance-function) + (def-frob %funcallable-instance-layout) + (def-frob %funcallable-instance-lexenv) + (def-frob %function-next) + (def-frob %function-self) + (def-frob %set-funcallable-instance-function (fin new-val))) ;;;; funny functions @@ -1033,6 +1032,8 @@ (funcall function ,@(args)))))) (frob)))) +;;; Note: negative RET-PC is a convention for "we need multiple return +;;; values". (defun do-call (old-component call-pc ret-pc old-fp num-args named) (declare (type code-component old-component) (type pc call-pc)