projects
/
sbcl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
0.7.13.32
[sbcl.git]
/
src
/
compiler
/
x86
/
system.lisp
diff --git
a/src/compiler/x86/system.lisp
b/src/compiler/x86/system.lisp
index
95de87f
..
2bbfa62
100644
(file)
--- a/
src/compiler/x86/system.lisp
+++ b/
src/compiler/x86/system.lisp
@@
-13,8
+13,8
@@
\f
;;;; type frobbing VOPs
\f
;;;; type frobbing VOPs
-(define-vop (get-lowtag)
- (:translate get-lowtag)
+(define-vop (lowtag-of)
+ (:translate lowtag-of)
(:policy :fast-safe)
(:args (object :scs (any-reg descriptor-reg control-stack)
:target result))
(:policy :fast-safe)
(:args (object :scs (any-reg descriptor-reg control-stack)
:target result))
@@
-24,8
+24,8
@@
(move result object)
(inst and result lowtag-mask)))
(move result object)
(inst and result lowtag-mask)))
-(define-vop (get-type)
- (:translate get-type)
+(define-vop (widetag-of)
+ (:translate widetag-of)
(:policy :fast-safe)
(:args (object :scs (descriptor-reg)))
(:temporary (:sc unsigned-reg :offset eax-offset :to (:result 0)) eax)
(:policy :fast-safe)
(:args (object :scs (descriptor-reg)))
(:temporary (:sc unsigned-reg :offset eax-offset :to (:result 0)) eax)
@@
-34,16
+34,16
@@
(:generator 6
(inst mov eax object)
(inst and al-tn lowtag-mask)
(:generator 6
(inst mov eax object)
(inst and al-tn lowtag-mask)
- (inst cmp al-tn other-pointer-type)
+ (inst cmp al-tn other-pointer-lowtag)
(inst jmp :e other-ptr)
(inst jmp :e other-ptr)
- (inst cmp al-tn function-pointer-type)
+ (inst cmp al-tn fun-pointer-lowtag)
(inst jmp :e function-ptr)
(inst jmp :e function-ptr)
- ;; pick off structures and list pointers
+ ;; Pick off structures and list pointers.
(inst test al-tn 1)
(inst jmp :ne done)
(inst test al-tn 1)
(inst jmp :ne done)
- ;; pick off fixnums
+ ;; Pick off fixnums.
(inst and al-tn 3)
(inst jmp :e done)
(inst and al-tn 3)
(inst jmp :e done)
@@
-52,28
+52,28
@@
(inst jmp done)
FUNCTION-PTR
(inst jmp done)
FUNCTION-PTR
- (load-type al-tn object (- sb!vm:function-pointer-type))
+ (load-type al-tn object (- fun-pointer-lowtag))
(inst jmp done)
OTHER-PTR
(inst jmp done)
OTHER-PTR
- (load-type al-tn object (- sb!vm:other-pointer-type))
+ (load-type al-tn object (- other-pointer-lowtag))
DONE
(inst movzx result al-tn)))
\f
DONE
(inst movzx result al-tn)))
\f
-(define-vop (function-subtype)
- (:translate function-subtype)
+(define-vop (fun-subtype)
+ (:translate fun-subtype)
(:policy :fast-safe)
(:args (function :scs (descriptor-reg)))
(:temporary (:sc byte-reg :from (:eval 0) :to (:eval 1)) temp)
(:results (result :scs (unsigned-reg)))
(:result-types positive-fixnum)
(:generator 6
(:policy :fast-safe)
(:args (function :scs (descriptor-reg)))
(:temporary (:sc byte-reg :from (:eval 0) :to (:eval 1)) temp)
(:results (result :scs (unsigned-reg)))
(:result-types positive-fixnum)
(:generator 6
- (load-type temp function (- sb!vm:function-pointer-type))
+ (load-type temp function (- fun-pointer-lowtag))
(inst movzx result temp)))
(inst movzx result temp)))
-(define-vop (set-function-subtype)
- (:translate (setf function-subtype))
+(define-vop (set-fun-subtype)
+ (:translate (setf fun-subtype))
(:policy :fast-safe)
(:args (type :scs (unsigned-reg) :target eax)
(function :scs (descriptor-reg)))
(:policy :fast-safe)
(:args (type :scs (unsigned-reg) :target eax)
(function :scs (descriptor-reg)))
@@
-86,7
+86,7
@@
(:generator 6
(move eax type)
(inst mov
(:generator 6
(move eax type)
(inst mov
- (make-ea :byte :base function :disp (- function-pointer-type))
+ (make-ea :byte :base function :disp (- fun-pointer-lowtag))
al-tn)
(move result eax)))
al-tn)
(move result eax)))
@@
-97,8
+97,8
@@
(:results (res :scs (unsigned-reg)))
(:result-types positive-fixnum)
(:generator 6
(:results (res :scs (unsigned-reg)))
(:result-types positive-fixnum)
(:generator 6
- (loadw res x 0 other-pointer-type)
- (inst shr res type-bits)))
+ (loadw res x 0 other-pointer-lowtag)
+ (inst shr res n-widetag-bits)))
(define-vop (get-closure-length)
(:translate get-closure-length)
(define-vop (get-closure-length)
(:translate get-closure-length)
@@
-107,8
+107,8
@@
(:results (res :scs (unsigned-reg)))
(:result-types positive-fixnum)
(:generator 6
(:results (res :scs (unsigned-reg)))
(:result-types positive-fixnum)
(:generator 6
- (loadw res x 0 function-pointer-type)
- (inst shr res type-bits)))
+ (loadw res x 0 fun-pointer-lowtag)
+ (inst shr res n-widetag-bits)))
(define-vop (set-header-data)
(:translate set-header-data)
(define-vop (set-header-data)
(:translate set-header-data)
@@
-121,9
+121,9
@@
:from (:argument 1) :to (:result 0)) eax)
(:generator 6
(move eax data)
:from (:argument 1) :to (:result 0)) eax)
(:generator 6
(move eax data)
- (inst shl eax (- type-bits 2))
- (inst mov al-tn (make-ea :byte :base x :disp (- other-pointer-type)))
- (storew eax x 0 other-pointer-type)
+ (inst shl eax (- n-widetag-bits 2))
+ (inst mov al-tn (make-ea :byte :base x :disp (- other-pointer-lowtag)))
+ (storew eax x 0 other-pointer-lowtag)
(move res x)))
\f
(define-vop (make-fixnum)
(move res x)))
\f
(define-vop (make-fixnum)
@@
-142,7
+142,7
@@
(:results (res :scs (any-reg descriptor-reg) :from (:argument 0)))
(:generator 2
(move res val)
(:results (res :scs (any-reg descriptor-reg) :from (:argument 0)))
(:generator 2
(move res val)
- (inst shl res (- type-bits 2))
+ (inst shl res (- n-widetag-bits 2))
(inst or res (sc-case type
(unsigned-reg type)
(immediate (tn-value type))))))
(inst or res (sc-case type
(unsigned-reg type)
(immediate (tn-value type))))))
@@
-196,54
+196,48
@@
(:results (sap :scs (sap-reg) :from (:argument 0)))
(:result-types system-area-pointer)
(:generator 10
(:results (sap :scs (sap-reg) :from (:argument 0)))
(:result-types system-area-pointer)
(:generator 10
- (loadw sap code 0 other-pointer-type)
- (inst shr sap type-bits)
+ (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
(inst lea sap (make-ea :byte :base code :index sap :scale 4
- :disp (- other-pointer-type)))))
+ :disp (- other-pointer-lowtag)))))
-(define-vop (compute-function)
+(define-vop (compute-fun)
(:args (code :scs (descriptor-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
(:args (code :scs (descriptor-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-type)
- (inst shr func type-bits)
+ (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
(inst lea func
(make-ea :byte :base offset :index func :scale 4
- :disp (- function-pointer-type other-pointer-type)))
+ :disp (- fun-pointer-lowtag other-pointer-lowtag)))
(inst add func code)))
(inst add func code)))
-;;; REMOVEME
-(defknown %function-self (function) function (flushable))
-
-(define-vop (%function-self)
+(define-vop (%simple-fun-self)
(:policy :fast-safe)
(:policy :fast-safe)
- (:translate %function-self)
+ (:translate %simple-fun-self)
(:args (function :scs (descriptor-reg)))
(:results (result :scs (descriptor-reg)))
(:generator 3
(:args (function :scs (descriptor-reg)))
(:results (result :scs (descriptor-reg)))
(:generator 3
- (loadw result function function-self-slot function-pointer-type)
+ (loadw result function simple-fun-self-slot fun-pointer-lowtag)
(inst lea result
(make-ea :byte :base result
(inst lea result
(make-ea :byte :base result
- :disp (- function-pointer-type
- (* function-code-offset word-bytes))))))
+ :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
;;; to reference the function object given the closure object.
;;; 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
;;; to reference the function object given the closure object.
-(def-source-transform %closure-function (closure)
- `(%function-self ,closure))
-
-(def-source-transform %funcallable-instance-function (fin)
- `(%function-self ,fin))
+(define-source-transform %closure-fun (closure)
+ `(%simple-fun-self ,closure))
-;;; REMOVEME
-(defknown (setf %function-self) (function function) function (unsafe))
+(define-source-transform %funcallable-instance-fun (fin)
+ `(%simple-fun-self ,fin))
-(define-vop (%set-function-self)
+(define-vop (%set-fun-self)
(:policy :fast-safe)
(:policy :fast-safe)
- (:translate (setf %function-self))
+ (:translate (setf %simple-fun-self))
(:args (new-self :scs (descriptor-reg) :target result :to :result)
(function :scs (descriptor-reg) :to :result))
(:temporary (:sc any-reg :from (:argument 0) :to :result) temp)
(:args (new-self :scs (descriptor-reg) :target result :to :result)
(function :scs (descriptor-reg) :to :result))
(:temporary (:sc any-reg :from (:argument 0) :to :result) temp)
@@
-251,9
+245,9
@@
(:generator 3
(inst lea temp
(make-ea :byte :base new-self
(:generator 3
(inst lea temp
(make-ea :byte :base new-self
- :disp (- (ash function-code-offset word-shift)
- function-pointer-type)))
- (storew temp function function-self-slot function-pointer-type)
+ :disp (- (ash simple-fun-code-offset word-shift)
+ 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
(move result new-self)))
;;; KLUDGE: This seems to be some kind of weird override of the way
@@
-261,21
+255,21
@@
;;; 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
;;; 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-function)) (function function) function
+(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?
(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-function) ((value fin))
- '(setf (%function-self fin) value))
+(deftransform (setf %funcallable-instance-fun) ((value fin))
+ '(setf (%simple-fun-self fin) value))
\f
;;;; other miscellaneous VOPs
\f
;;;; other miscellaneous VOPs
-(defknown sb!unix::do-pending-interrupt () (values))
-(define-vop (sb!unix::do-pending-interrupt)
+(defknown sb!unix::receive-pending-interrupt () (values))
+(define-vop (sb!unix::receive-pending-interrupt)
(:policy :fast-safe)
(:policy :fast-safe)
- (:translate sb!unix::do-pending-interrupt)
+ (:translate sb!unix::receive-pending-interrupt)
(:generator 1
(inst break pending-interrupt-trap)))
(:generator 1
(inst break pending-interrupt-trap)))
@@
-301,5
+295,5
@@
(:info index)
(:generator 0
(inst inc (make-ea :dword :base count-vector
(:info index)
(:generator 0
(inst inc (make-ea :dword :base count-vector
- :disp (- (* (+ vector-data-offset index) word-bytes)
- other-pointer-type)))))
+ :disp (- (* (+ vector-data-offset index) n-word-bytes)
+ other-pointer-lowtag)))))