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)
17 (with-unique-names (fixup)
19 `((let ((fixup (make-fixup ',name :assembly-routine)))
20 (inst ldil fixup ,fixup)
21 (inst ble fixup lisp-heap-space ,fixup :nullify t))
23 `((:temporary (:scs (any-reg) :from (:eval 0) :to (:eval 1))
26 (let ((temp (make-symbol "TEMP"))
27 (nfp-save (make-symbol "NFP-SAVE"))
28 (lra (make-symbol "LRA")))
30 `((let ((lra-label (gen-label))
31 (cur-nfp (current-nfp-tn ,vop)))
33 (store-stack-tn ,nfp-save cur-nfp))
34 (inst compute-lra-from-code code-tn lra-label ,temp ,lra)
35 (note-this-location ,vop :call-site)
36 (let ((fixup (make-fixup ',name :assembly-routine)))
37 (inst ldil fixup ,temp)
38 (inst be fixup lisp-heap-space ,temp :nullify t))
39 (emit-return-pc lra-label)
40 (note-this-location ,vop :single-value-return)
42 (inst compute-code-from-lra code-tn lra-label ,temp code-tn)
44 (load-stack-tn cur-nfp ,nfp-save))))
45 `((:temporary (:scs (non-descriptor-reg) :from (:eval 0) :to (:eval 1))
47 (:temporary (:sc descriptor-reg :offset lra-offset
48 :from (:eval 0) :to (:eval 1))
50 (:temporary (:scs (control-stack) :offset nfp-save-offset)
52 (:save-p :compute-only)))))
54 (with-unique-names (fixup)
56 `((let ((fixup (make-fixup ',name :assembly-routine)))
57 (inst ldil fixup ,fixup)
58 (inst be fixup lisp-heap-space ,fixup :nullify t)))
59 `((:temporary (:scs (any-reg) :from (:eval 0) :to (:eval 1))
62 (!def-vm-support-routine generate-return-sequence (style)
65 `((inst bv lip-tn :nullify t)))
67 `((lisp-return (make-random-tn :kind :normal
68 :sc (sc-or-lose 'descriptor-reg)
73 (defun return-machine-address (scp)
74 (context-register scp lip-offset))