4 (define-vop (debug-cur-sp)
5 (:translate current-sp)
7 (:results (res :scs (sap-reg)))
8 (:result-types system-area-pointer)
12 (define-vop (debug-cur-fp)
13 (:translate current-fp)
15 (:results (res :scs (sap-reg)))
16 (:result-types system-area-pointer)
20 (define-vop (read-control-stack)
21 (:translate stack-ref)
23 (:args (object :scs (sap-reg))
24 (offset :scs (any-reg)))
25 (:arg-types system-area-pointer positive-fixnum)
26 (:results (result :scs (descriptor-reg)))
29 (inst ldwx offset object result)))
31 (define-vop (read-control-stack-c)
32 (:translate stack-ref)
34 (:args (object :scs (sap-reg)))
36 (:arg-types system-area-pointer (:constant (signed-byte 12)))
37 (:results (result :scs (descriptor-reg)))
40 (inst ldw (* offset n-word-bytes) object result)))
42 (define-vop (write-control-stack)
43 (:translate %set-stack-ref)
45 (:args (object :scs (sap-reg) :target sap)
46 (offset :scs (any-reg))
47 (value :scs (descriptor-reg) :target result))
48 (:arg-types system-area-pointer positive-fixnum *)
49 (:results (result :scs (descriptor-reg)))
51 (:temporary (:scs (sap-reg) :from (:argument 1)) sap)
53 (inst add object offset sap)
54 (inst stw value 0 sap)
57 (define-vop (write-control-stack-c)
58 (:translate %set-stack-ref)
60 (:args (sap :scs (sap-reg))
61 (value :scs (descriptor-reg) :target result))
63 (:arg-types system-area-pointer (:constant (signed-byte 12)) *)
64 (:results (result :scs (descriptor-reg)))
67 (inst stw value (* offset n-word-bytes) sap)
70 (define-vop (code-from-mumble)
72 (:args (thing :scs (descriptor-reg) :to :save))
73 (:results (code :scs (descriptor-reg)))
74 (:temporary (:scs (non-descriptor-reg)) temp)
75 (:variant-vars lowtag)
77 (loadw temp thing 0 lowtag)
78 (inst srl temp n-widetag-bits temp)
79 (inst comb := zero-tn temp done)
81 (inst sll temp (1- (integer-length n-word-bytes)) temp)
82 (unless (= lowtag other-pointer-lowtag)
83 (inst addi (- lowtag other-pointer-lowtag) temp temp))
84 (inst sub thing temp code)
87 (define-vop (code-from-lra code-from-mumble)
88 (:translate lra-code-header)
89 (:variant other-pointer-lowtag))
91 (define-vop (code-from-fun code-from-mumble)
92 (:translate fun-code-header)
93 (:variant fun-pointer-lowtag))
95 (define-vop (%make-lisp-obj)
97 (:translate %make-lisp-obj)
98 (:args (value :scs (unsigned-reg) :target result))
99 (:arg-types unsigned-num)
100 (:results (result :scs (descriptor-reg)))
102 (move value result)))
104 (define-vop (get-lisp-obj-address)
106 (:translate get-lisp-obj-address)
107 (:args (thing :scs (descriptor-reg) :target result))
108 (:results (result :scs (unsigned-reg)))
109 (:result-types unsigned-num)
111 (move thing result)))
113 (define-vop (fun-word-offset)
115 (:translate fun-word-offset)
116 (:args (fun :scs (descriptor-reg)))
117 (:results (res :scs (unsigned-reg)))
118 (:result-types positive-fixnum)
120 (loadw res fun 0 fun-pointer-lowtag)
121 (inst srl res n-widetag-bits res)))