X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fx86-64%2Fstatic-fn.lisp;h=ec4809a1e46b2e58a8febbba8ed57e936552accd;hb=02f7f85a6554b1ec233e9a515c4c511fe092565e;hp=8760e33d31baf96508781ecc726eddbb0f9b9740;hpb=3b5fb548ed34612fb853b11b2bcdd29440834eaa;p=sbcl.git diff --git a/src/compiler/x86-64/static-fn.lisp b/src/compiler/x86-64/static-fn.lisp index 8760e33..ec4809a 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) @@ -80,17 +83,8 @@ ;; 3+4+4=11 bytes as opposed to 1+4=5 bytes. (cond ((policy ,node (>= speed space)) (inst sub rsp-tn (* 3 n-word-bytes)) - (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 mov ,new-rbp-ea rbp-tn) + (inst lea rbp-tn ,new-rbp-ea)) (t ;; Dummy for return address. (inst push rbp-tn) @@ -98,7 +92,7 @@ ,(if (zerop num-args) '(inst xor ecx ecx) - `(inst mov ecx (fixnumize ,num-args))) + `(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))