From d8a686890cafeecea50dfd342bd991596b075bdc Mon Sep 17 00:00:00 2001 From: Douglas Katzman Date: Wed, 18 Oct 2017 07:57:43 -0400 Subject: [PATCH] Shorten set-fdefn-fun --- src/compiler/x86-64/cell.lisp | 14 +++++--------- src/compiler/x86/cell.lisp | 13 +++++-------- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/src/compiler/x86-64/cell.lisp b/src/compiler/x86-64/cell.lisp index cab1ad9e4..5f9bee56b 100644 --- a/src/compiler/x86-64/cell.lisp +++ b/src/compiler/x86-64/cell.lisp @@ -384,18 +384,14 @@ (:args (function :scs (descriptor-reg) :target result) (fdefn :scs (descriptor-reg))) (:temporary (:sc unsigned-reg) raw) - (:temporary (:sc unsigned-reg) type) (:results (result :scs (descriptor-reg))) (:generator 38 - (load-type type function (- fun-pointer-lowtag)) - (inst lea raw - (make-ea :byte :base function - :disp (- (* simple-fun-code-offset n-word-bytes) - fun-pointer-lowtag))) - (inst cmp (reg-in-size type :byte) simple-fun-widetag) - (inst jmp :e NORMAL-FUN) (inst mov raw (make-fixup 'closure-tramp :assembly-routine)) - NORMAL-FUN + (inst cmp (make-ea :byte :base function :disp (- fun-pointer-lowtag)) + simple-fun-widetag) + (inst cmov :e raw + (make-ea :qword :base function + :disp (- (* simple-fun-self-slot n-word-bytes) fun-pointer-lowtag))) (storew function fdefn fdefn-fun-slot other-pointer-lowtag) (storew raw fdefn fdefn-raw-addr-slot other-pointer-lowtag) (move result function))) diff --git a/src/compiler/x86/cell.lisp b/src/compiler/x86/cell.lisp index 66b2be70a..dee642329 100644 --- a/src/compiler/x86/cell.lisp +++ b/src/compiler/x86/cell.lisp @@ -247,17 +247,14 @@ (:args (function :scs (descriptor-reg) :target result) (fdefn :scs (descriptor-reg))) (:temporary (:sc unsigned-reg) raw) - (:temporary (:sc byte-reg) type) (:results (result :scs (descriptor-reg))) (:generator 38 - (load-type type function (- fun-pointer-lowtag)) - (inst lea raw - (make-ea-for-object-slot function simple-fun-code-offset - fun-pointer-lowtag)) - (inst cmp type simple-fun-widetag) - (inst jmp :e normal-fn) (inst lea raw (make-fixup 'closure-tramp :assembly-routine)) - NORMAL-FN + (inst cmp (make-ea :byte :base function :disp (- fun-pointer-lowtag)) + simple-fun-widetag) + (inst cmov :e raw + (make-ea :dword :base function + :disp (- (* simple-fun-self-slot n-word-bytes) fun-pointer-lowtag))) (storew function fdefn fdefn-fun-slot other-pointer-lowtag) (storew raw fdefn fdefn-raw-addr-slot other-pointer-lowtag) (move result function))) -- 2.11.4.GIT