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)))
22 `((:temporary (:scs (any-reg) :from (:eval 0) :to (:eval 1))
25 (let ((temp (make-symbol "TEMP"))
26 (nfp-save (make-symbol "NFP-SAVE"))
27 (lra (make-symbol "LRA")))
29 `((let ((lra-label (gen-label))
30 (cur-nfp (current-nfp-tn ,vop)))
32 (store-stack-tn ,nfp-save cur-nfp))
33 (inst compute-lra-from-code code-tn lra-label ,temp ,lra)
34 (note-next-instruction ,vop :call-site)
35 (let ((fixup (make-fixup ',name :assembly-routine)))
36 (inst ldil fixup ,temp)
37 (inst be fixup lisp-heap-space ,temp :nullify t))
38 (without-scheduling ()
39 (emit-return-pc lra-label)
40 (note-this-location ,vop :single-value-return)
41 (inst move ocfp-tn csp-tn)
42 (inst nop)) ; this nop is here because of emit-return-pc align
43 (inst compute-code-from-lra code-tn lra-label ,temp code-tn)
45 (load-stack-tn cur-nfp ,nfp-save))))
46 `((:temporary (:scs (non-descriptor-reg) :from (:eval 0) :to (:eval 1))
48 (:temporary (:sc descriptor-reg :offset lra-offset
49 :from (:eval 0) :to (:eval 1))
51 (:temporary (:scs (control-stack) :offset nfp-save-offset)
55 (!def-vm-support-routine generate-return-sequence (style)
58 `((inst bv lip-tn :nullify t)))
60 `((lisp-return (make-random-tn :kind :normal
61 :sc (sc-or-lose 'descriptor-reg)
66 (defun return-machine-address (scp)
67 (context-register scp lip-offset))