X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fcodegen.lisp;h=7a176808c428f5ee6901911528c7b17a61a20b12;hb=6a9bbe6f36179cee92001a1f9ed5ff38be512644;hp=12c3ab4d131ad56baca006551e9fcba154e1f28b;hpb=cea4896b2482b7b2b429c1631d774b4cfbc0efba;p=sbcl.git diff --git a/src/compiler/codegen.lisp b/src/compiler/codegen.lisp index 12c3ab4..7a17680 100644 --- a/src/compiler/codegen.lisp +++ b/src/compiler/codegen.lisp @@ -16,46 +16,42 @@ ;;;; utilities used during code generation +;;; the number of bytes used by the code object header (defun component-header-length (&optional (component *component-being-compiled*)) - #!+sb-doc - "Returns the number of bytes used by the code object header." (let* ((2comp (component-info component)) (constants (ir2-component-constants 2comp)) (num-consts (length constants))) (ash (logandc2 (1+ num-consts) 1) sb!vm:word-shift))) +;;; the size of the NAME'd SB in the currently compiled component. +;;; This is useful mainly for finding the size for allocating stack +;;; frames. (defun sb-allocated-size (name) - #!+sb-doc - "The size of the Name'd SB in the currently compiled component. Useful - mainly for finding the size for allocating stack frames." (finite-sb-current-size (sb-or-lose name))) +;;; the TN that is used to hold the number stack frame-pointer in +;;; VOP's function, or NIL if no number stack frame was allocated (defun current-nfp-tn (vop) - #!+sb-doc - "Return the TN that is used to hold the number stack frame-pointer in VOP's - function. Returns NIL if no number stack frame was allocated." (unless (zerop (sb-allocated-size 'non-descriptor-stack)) (let ((block (ir2-block-block (vop-block vop)))) - (when (ir2-environment-number-stack-p - (environment-info - (block-environment block))) + (when (ir2-physenv-number-stack-p + (physenv-info + (block-physenv block))) (ir2-component-nfp (component-info (block-component block))))))) +;;; the TN that is used to hold the number stack frame-pointer in the +;;; function designated by 2ENV, or NIL if no number stack frame was +;;; allocated (defun callee-nfp-tn (2env) - #!+sb-doc - "Return the TN that is used to hold the number stack frame-pointer in the - function designated by 2env. Returns NIL if no number stack frame was - allocated." (unless (zerop (sb-allocated-size 'non-descriptor-stack)) - (when (ir2-environment-number-stack-p 2env) + (when (ir2-physenv-number-stack-p 2env) (ir2-component-nfp (component-info *component-being-compiled*))))) +;;; the TN used for passing the return PC in a local call to the function +;;; designated by 2ENV (defun callee-return-pc-tn (2env) - #!+sb-doc - "Return the TN used for passing the return PC in a local call to the function - designated by 2env." - (ir2-environment-return-pc-pass 2env)) + (ir2-physenv-return-pc-pass 2env)) ;;;; specials used during code generation @@ -69,7 +65,6 @@ (defvar *prev-segment*) (defvar *prev-vop*) -#!+sb-show (defun trace-instruction (segment vop inst args) (let ((*standard-output* *compiler-trace-output*)) (unless (eq *prev-segment* segment) @@ -100,10 +95,10 @@ (policy (lambda-bind (block-home-lambda (block-next (component-head *component-being-compiled*)))) - (or (> speed cspeed) (> space cspeed))))) + (or (> speed compilation-speed) (> space compilation-speed))))) (defun default-segment-inst-hook () - #!+sb-show - (and *compiler-trace-output* #'trace-instruction)) + (and *compiler-trace-output* + #'trace-instruction)) (defun init-assembler () (setf *code-segment* @@ -120,7 +115,6 @@ (values)) (defun generate-code (component) - #!+sb-show (when *compiler-trace-output* (format *compiler-trace-output* "~|~%assembly code for ~S~2%" @@ -129,7 +123,7 @@ (*trace-table-info* nil) (*prev-segment* nil) (*prev-vop* nil) - (*fixups* nil)) + (*fixup-notes* nil)) (let ((label (sb!assem:gen-label))) (setf *elsewhere-label* label) (sb!assem:assemble (*elsewhere*) @@ -140,10 +134,10 @@ (block-start 1block)) (sb!assem:assemble (*code-segment*) (sb!assem:emit-label (block-label 1block))) - (let ((env (block-environment 1block))) + (let ((env (block-physenv 1block))) (unless (eq env prev-env) (let ((lab (gen-label))) - (setf (ir2-environment-elsewhere-start (environment-info env)) + (setf (ir2-physenv-elsewhere-start (physenv-info env)) lab) (emit-label-elsewhere lab)) (setq prev-env env))))) @@ -159,7 +153,7 @@ (setf *elsewhere* nil) (values (sb!assem:finalize-segment *code-segment*) (nreverse *trace-table-info*) - *fixups*))) + *fixup-notes*))) (defun emit-label-elsewhere (label) (sb!assem:assemble (*elsewhere*)