1 ;;;; the machine-specific support routines needed by the file assembler
3 ;;;; This software is part of the SBCL system. See the README file for
6 ;;;; This software is derived from the CMU CL system, which was
7 ;;;; written at Carnegie Mellon University and released into the
8 ;;;; public domain. The software is in the public domain and is
9 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
10 ;;;; files for more information.
14 (!def-vm-support-routine generate-call-sequence
(name style vop
)
18 `((inst bla
(make-fixup ',name
:assembly-routine
)))
21 (let ((temp (make-symbol "TEMP"))
22 (nfp-save (make-symbol "NFP-SAVE"))
23 (lra (make-symbol "LRA")))
25 `((let ((lra-label (gen-label))
26 (cur-nfp (current-nfp-tn ,vop
)))
28 (store-stack-tn ,nfp-save cur-nfp
))
29 (inst compute-lra-from-code
,lra code-tn lra-label
,temp
)
30 (note-next-instruction ,vop
:call-site
)
31 (inst ba
(make-fixup ',name
:assembly-routine
))
32 (emit-return-pc lra-label
)
33 (note-this-location ,vop
:single-value-return
)
34 (without-scheduling ()
37 (inst compute-code-from-lra code-tn code-tn
40 (load-stack-tn cur-nfp
,nfp-save
))))
41 `((:temporary
(:scs
(non-descriptor-reg) :from
(:eval
0) :to
(:eval
1))
43 (:temporary
(:sc descriptor-reg
:offset lra-offset
44 :from
(:eval
0) :to
(:eval
1))
46 (:temporary
(:scs
(control-stack) :offset nfp-save-offset
)
48 (:save-p
:compute-only
)))))))
50 (!def-vm-support-routine generate-return-sequence
(style)
55 `((lisp-return (make-random-tn :kind
:normal
56 :sc
(sc-or-lose 'descriptor-reg
)
58 (make-random-tn :kind
:normal
59 :sc
(sc-or-lose 'interior-reg
)
64 (defun return-machine-address (scp)
65 (sap-int (context-lr scp
)))