X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fx86-64%2Fstatic-fn.lisp;h=1f0c370a384be2597326d24cb77d693cae3f78bc;hb=b2ed34b667665e52609cf431c00179b136be450d;hp=e0b76ca1330b703fcf9649a82aa6165eca2f2ebc;hpb=952d16ab5880823c1864eb9105bb269e2e00760d;p=sbcl.git diff --git a/src/compiler/x86-64/static-fn.lisp b/src/compiler/x86-64/static-fn.lisp index e0b76ca..1f0c370 100644 --- a/src/compiler/x86-64/static-fn.lisp +++ b/src/compiler/x86-64/static-fn.lisp @@ -39,7 +39,11 @@ (error "either too many args (~W) or too many results (~W); max = ~W" num-args num-results register-arg-count)) (let ((num-temps (max num-args num-results)) - (node (gensym "NODE-"))) + (node (sb!xc:gensym "NODE-")) + (new-rbp-ea + '(make-ea :qword + :disp (frame-byte-offset (+ sp->fp-offset -3 ocfp-save-offset)) + :base rsp-tn))) (collect ((temp-names) (temps) (arg-names) (args) (result-names) (results)) (dotimes (i num-results) (let ((result-name (intern (format nil "RESULT-~D" i)))) @@ -69,7 +73,6 @@ static-fun-template) (:args ,@(args)) ,@(temps) - (:temporary (:sc unsigned-reg) call-target) (:results ,@(results)) (:node-var ,node) (:generator ,(+ 50 num-args num-results) @@ -79,26 +82,17 @@ ;; effect of the ENTER with discrete instructions. Takes ;; 3+4+4=11 bytes as opposed to 1+4=5 bytes. (cond ((policy ,node (>= speed space)) - (inst sub rsp-tn (fixnumize 3)) - (inst mov (make-ea :qword :base rsp-tn - :disp (frame-byte-offset - (+ sp->fp-offset - -3 - ocfp-save-offset))) - rbp-tn) - (inst lea rbp-tn (make-ea :qword :base rsp-tn - :disp (frame-byte-offset - (+ sp->fp-offset - -3 - ocfp-save-offset))))) + (inst sub rsp-tn (* 3 n-word-bytes)) + (inst mov ,new-rbp-ea rbp-tn) + (inst lea rbp-tn ,new-rbp-ea)) (t ;; Dummy for return address. (inst push rbp-tn) - (inst enter (fixnumize 1)))) + (inst enter n-word-bytes))) ,(if (zerop num-args) - '(inst xor ecx ecx) - `(inst mov ecx (fixnumize ,num-args))) + '(zeroize ecx) + `(inst mov ecx ,(fixnumize num-args))) (note-this-location vop :call-site) ;; Old CMU CL comment: @@ -114,14 +108,7 @@ ;; longer executed? Does it not depend on the ;; 1+3=4=fdefn_raw_address_offset relationship above? ;; Is something else going on?) - - ;; Need to load the target address into a register, since - ;; immediate call arguments are just a 32-bit displacement, - ;; which obviously can't work with >4G spaces. - (inst mov call-target - (make-ea :qword - :disp (+ nil-value (static-fun-offset function)))) - (inst call call-target) + (call-indirect (+ nil-value (static-fun-offset function))) ,(collect ((bindings) (links)) (do ((temp (temp-names) (cdr temp)) (name 'values (gensym)) @@ -137,7 +124,8 @@ (default-unknown-values vop ,(if (zerop num-results) nil 'values) - ,num-results))) + ,num-results + ,node))) ,@(moves (result-names) (temp-names))))))) ) ; EVAL-WHEN