X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fx86%2Fsystem.lisp;h=96ca14dcf2b0277d658c75a04774693585527662;hb=804bd4d97228b8ddde6e5d9b4f0c75c889efd819;hp=429116490b52d7334e54c5428fba21360605f7bb;hpb=c10e4afc31e25003cc2500803ceb7589232e7f6b;p=sbcl.git diff --git a/src/compiler/x86/system.lisp b/src/compiler/x86/system.lisp index 4291164..96ca14d 100644 --- a/src/compiler/x86/system.lisp +++ b/src/compiler/x86/system.lisp @@ -17,7 +17,7 @@ (:translate lowtag-of) (:policy :fast-safe) (:args (object :scs (any-reg descriptor-reg control-stack) - :target result)) + :target result)) (:results (result :scs (unsigned-reg))) (:result-types positive-fixnum) (:generator 1 @@ -76,18 +76,16 @@ (:translate (setf fun-subtype)) (:policy :fast-safe) (:args (type :scs (unsigned-reg) :target eax) - (function :scs (descriptor-reg))) + (function :scs (descriptor-reg))) (:arg-types positive-fixnum *) (:temporary (:sc unsigned-reg :offset eax-offset :from (:argument 0) - :to (:result 0) :target result) - eax) + :to (:result 0) :target result) + eax) (:results (result :scs (unsigned-reg))) (:result-types positive-fixnum) (:generator 6 (move eax type) - (inst mov - (make-ea :byte :base function :disp (- fun-pointer-lowtag)) - al-tn) + (storeb al-tn function 0 fun-pointer-lowtag) (move result eax))) (define-vop (get-header-data) @@ -114,11 +112,11 @@ (:translate set-header-data) (:policy :fast-safe) (:args (x :scs (descriptor-reg) :target res :to (:result 0)) - (data :scs (any-reg) :target eax)) + (data :scs (any-reg) :target eax)) (:arg-types * positive-fixnum) (:results (res :scs (descriptor-reg))) (:temporary (:sc unsigned-reg :offset eax-offset - :from (:argument 1) :to (:result 0)) eax) + :from (:argument 1) :to (:result 0)) eax) (:generator 6 (move eax data) (inst shl eax (- n-widetag-bits 2)) @@ -138,14 +136,14 @@ (define-vop (make-other-immediate-type) (:args (val :scs (any-reg descriptor-reg) :target res) - (type :scs (unsigned-reg immediate))) + (type :scs (unsigned-reg immediate))) (:results (res :scs (any-reg descriptor-reg) :from (:argument 0))) (:generator 2 (move res val) (inst shl res (- n-widetag-bits 2)) (inst or res (sc-case type - (unsigned-reg type) - (immediate (tn-value type)))))) + (unsigned-reg type) + (immediate (tn-value type)))))) ;;;; allocation @@ -163,7 +161,7 @@ (:translate binding-stack-pointer-sap) (:policy :fast-safe) (:generator 1 - (load-tl-symbol-value int *binding-stack-pointer*))) + (load-binding-stack-pointer int))) (defknown (setf binding-stack-pointer-sap) (system-area-pointer) system-area-pointer ()) @@ -173,11 +171,10 @@ (:arg-types system-area-pointer) (:results (int :scs (sap-reg))) (:result-types system-area-pointer) - #!+sb-thread (:temporary (:sc any-reg) temp) (:translate (setf binding-stack-pointer-sap)) (:policy :fast-safe) (:generator 1 - (store-tl-symbol-value new-value *binding-stack-pointer* temp) + (store-binding-stack-pointer new-value) (move int new-value))) (define-vop (control-stack-pointer-sap) @@ -200,19 +197,19 @@ (loadw sap code 0 other-pointer-lowtag) (inst shr sap n-widetag-bits) (inst lea sap (make-ea :byte :base code :index sap :scale 4 - :disp (- other-pointer-lowtag))))) + :disp (- other-pointer-lowtag))))) (define-vop (compute-fun) (:args (code :scs (descriptor-reg) :to (:result 0)) - (offset :scs (signed-reg unsigned-reg) :to (:result 0))) + (offset :scs (signed-reg unsigned-reg) :to (:result 0))) (:arg-types * positive-fixnum) (:results (func :scs (descriptor-reg) :from (:argument 0))) (:generator 10 (loadw func code 0 other-pointer-lowtag) (inst shr func n-widetag-bits) (inst lea func - (make-ea :byte :base offset :index func :scale 4 - :disp (- fun-pointer-lowtag other-pointer-lowtag))) + (make-ea :byte :base offset :index func :scale 4 + :disp (- fun-pointer-lowtag other-pointer-lowtag))) (inst add func code))) (define-vop (%simple-fun-self) @@ -223,9 +220,9 @@ (:generator 3 (loadw result function simple-fun-self-slot fun-pointer-lowtag) (inst lea result - (make-ea :byte :base result - :disp (- fun-pointer-lowtag - (* simple-fun-code-offset n-word-bytes)))))) + (make-ea :byte :base result + :disp (- fun-pointer-lowtag + (* simple-fun-code-offset n-word-bytes)))))) ;;; The closure function slot is a pointer to raw code on X86 instead ;;; of a pointer to the code function object itself. This VOP is used @@ -233,37 +230,18 @@ (define-source-transform %closure-fun (closure) `(%simple-fun-self ,closure)) -(define-source-transform %funcallable-instance-fun (fin) - `(%simple-fun-self ,fin)) - (define-vop (%set-fun-self) (:policy :fast-safe) (:translate (setf %simple-fun-self)) (:args (new-self :scs (descriptor-reg) :target result :to :result) - (function :scs (descriptor-reg) :to :result)) + (function :scs (descriptor-reg) :to :result)) (:temporary (:sc any-reg :from (:argument 0) :to :result) temp) (:results (result :scs (descriptor-reg))) (:generator 3 - (inst lea temp - (make-ea :byte :base new-self - :disp (- (ash simple-fun-code-offset word-shift) - fun-pointer-lowtag))) + (inst lea temp (make-ea-for-object-slot new-self simple-fun-code-offset + fun-pointer-lowtag)) (storew temp function simple-fun-self-slot fun-pointer-lowtag) (move result new-self))) - -;;; KLUDGE: This seems to be some kind of weird override of the way -;;; that the objdef.lisp code would ordinarily set up the slot -;;; accessor. It's inherited from CMU CL, and it works, and naively -;;; deleting it seemed to cause problems, but it's not obvious why -;;; it's done this way. Any ideas? -- WHN 2001-08-02 -(defknown ((setf %funcallable-instance-fun)) (function function) function - (unsafe)) -;;; CMU CL comment: -;;; We would have really liked to use a source-transform for this, but -;;; they don't work with SETF functions. -;;; FIXME: Can't we just use DEFSETF or something? -(deftransform (setf %funcallable-instance-fun) ((value fin)) - '(setf (%simple-fun-self fin) value)) ;;;; other miscellaneous VOPs @@ -275,7 +253,7 @@ (inst break pending-interrupt-trap))) #!+sb-thread -(defknown current-thread-offset-sap ((unsigned-byte 32)) +(defknown current-thread-offset-sap ((unsigned-byte 32)) system-area-pointer (flushable)) #!+sb-thread @@ -311,6 +289,4 @@ (:args (count-vector :scs (descriptor-reg))) (:info index) (:generator 0 - (inst inc (make-ea :dword :base count-vector - :disp (- (* (+ vector-data-offset index) n-word-bytes) - other-pointer-lowtag))))) + (inst inc (make-ea-for-vector-data count-vector :offset index))))