3 (define-vop (debug-cur-sp)
4 (:translate sb!di::current-sp)
6 (:results (res :scs (sap-reg)))
7 (:result-types system-area-pointer)
11 (define-vop (debug-cur-fp)
12 (:translate sb!di::current-fp)
14 (:results (res :scs (sap-reg)))
15 (:result-types system-area-pointer)
19 (define-vop (read-control-stack)
20 (:translate sb!kernel:stack-ref)
22 (:args (object :scs (sap-reg))
23 (offset :scs (any-reg)))
24 (:arg-types system-area-pointer positive-fixnum)
25 (:results (result :scs (descriptor-reg)))
28 (inst ldwx offset object result)))
29 (define-vop (read-control-stack-c)
30 (:translate sb!kernel:stack-ref)
32 (:args (object :scs (sap-reg)))
34 ;; make room for multiply by limiting to 12 bits
35 (:arg-types system-area-pointer (:constant (signed-byte 12)))
36 (:results (result :scs (descriptor-reg)))
39 (inst ldw (* offset n-word-bytes) object result)))
41 (define-vop (write-control-stack)
42 (:translate sb!kernel:%set-stack-ref)
44 (:args (object :scs (sap-reg) :target sap)
45 (offset :scs (any-reg))
46 (value :scs (descriptor-reg) :target result))
47 (:arg-types system-area-pointer positive-fixnum *)
48 (:results (result :scs (descriptor-reg)))
50 (:temporary (:scs (sap-reg) :from (:argument 1)) sap)
52 (inst add object offset sap)
53 (inst stw value 0 sap)
55 (define-vop (write-control-stack-c)
56 (:translate %set-stack-ref)
58 (:args (sap :scs (sap-reg))
59 (value :scs (descriptor-reg) :target result))
61 (:arg-types system-area-pointer (:constant (signed-byte 12)) *)
62 (:results (result :scs (descriptor-reg)))
65 (inst stw value (* offset n-word-bytes) sap)
68 (define-vop (code-from-mumble)
70 (:args (thing :scs (descriptor-reg)))
71 (:results (code :scs (descriptor-reg)))
72 (:temporary (:scs (non-descriptor-reg)) temp)
73 (:variant-vars lowtag)
75 (let ((bogus (gen-label))
77 (loadw temp thing 0 lowtag)
78 (inst srl temp n-widetag-bits temp)
79 (inst comb := zero-tn temp bogus)
80 (inst sll temp (1- (integer-length n-word-bytes)) temp)
81 (unless (= lowtag other-pointer-lowtag)
82 (inst addi (- lowtag other-pointer-lowtag) temp temp))
83 (inst sub thing temp code)
85 (assemble (*elsewhere*)
88 (move null-tn code t)))))
90 (define-vop (code-from-lra code-from-mumble)
91 (:translate sb!di::lra-code-header)
92 (:variant other-pointer-lowtag))
94 (define-vop (code-from-fun code-from-mumble)
95 (:translate sb!di::fun-code-header)
96 (:variant fun-pointer-lowtag))
98 (define-vop (%make-lisp-obj)
100 (:translate %make-lisp-obj)
101 (:args (value :scs (unsigned-reg) :target result))
102 (:arg-types unsigned-num)
103 (:results (result :scs (descriptor-reg)))
105 (move value result)))
107 (define-vop (get-lisp-obj-address)
109 (:translate sb!di::get-lisp-obj-address)
110 (:args (thing :scs (descriptor-reg) :target result))
111 (:results (result :scs (unsigned-reg)))
112 (:result-types unsigned-num)
114 (move thing result)))
116 (define-vop (fun-word-offset)
118 (:translate sb!di::fun-word-offset)
119 (:args (fun :scs (descriptor-reg)))
120 (:results (res :scs (unsigned-reg)))
121 (:result-types positive-fixnum)
123 (loadw res fun 0 fun-pointer-lowtag)
124 (inst srl res n-widetag-bits res)))