1 ;;;; the VM definition of function call for the ARM
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 (defconstant arg-count-sc
(make-sc+offset immediate-arg-scn nargs-offset
))
15 (defconstant closure-sc
(make-sc+offset descriptor-reg-sc-number lexenv-offset
))
17 (defconstant return-pc-passing-offset
18 (make-sc+offset control-stack-sc-number lra-save-offset
))
20 (defconstant old-fp-passing-offset
21 (make-sc+offset control-stack-sc-number ocfp-save-offset
))
23 ;;; Make the TNs used to hold OLD-FP and RETURN-PC within the current
24 ;;; function. We treat these specially so that the debugger can find
25 ;;; them at a known location.
26 (defun make-old-fp-save-location ()
27 ;; Unlike the other backends, ARM function calling is designed to
28 ;; pass OLD-FP within the stack frame rather than in a register. As
29 ;; such, in order for lifetime analysis not to screw up, we need it
30 ;; to be a stack TN wired to the save offset, not a normal TN with a
32 (let ((tn (make-wired-tn *fixnum-primitive-type
*
35 (setf (tn-kind tn
) :environment
)
37 (defun make-return-pc-save-location ()
38 (let ((tn (make-wired-tn *backend-t-primitive-type
* control-stack-sc-number
40 (setf (tn-kind tn
) :environment
)
43 ;;; Make a TN for the standard argument count passing location. We
44 ;;; only need to make the standard location, since a count is never
45 ;;; passed when we are using non-standard conventions.
46 (defun make-arg-count-location ()
47 (make-wired-tn *fixnum-primitive-type
* immediate-arg-scn nargs-offset
))
51 ;;; Return the number of bytes needed for the current non-descriptor
53 (defun bytes-needed-for-non-descriptor-stack-frame ()
54 (logandc2 (+ (* (sb-allocated-size 'non-descriptor-stack
) n-word-bytes
)
55 +number-stack-alignment-mask
+)
56 +number-stack-alignment-mask
+))
58 ;;; Used for setting up the Old-FP in local call.
59 (define-vop (current-fp)
60 (:results
(val :scs
(any-reg)))
64 ;;; Used for computing the caller's NFP for use in known-values return. Only
65 ;;; works assuming there is no variable size stuff on the nstack.
66 (define-vop (compute-old-nfp)
67 (:results
(val :scs
(any-reg)))
70 (let ((nfp (current-nfp-tn vop
)))
72 ;; FIXME-ARM: taken form MIPS is this correct? (phs)
73 (inst add val nfp
(bytes-needed-for-non-descriptor-stack-frame))))))
75 ;;; Accessing a slot from an earlier stack frame is definite hackery.
76 (define-vop (ancestor-frame-ref)
77 (:args
(frame-pointer :scs
(descriptor-reg))
78 (variable-home-tn :load-if nil
))
79 (:results
(value :scs
(descriptor-reg any-reg
)))
82 (aver (sc-is variable-home-tn control-stack
))
83 (load-stack-offset value frame-pointer variable-home-tn
)))
85 (define-vop (ancestor-frame-set)
86 (:args
(frame-pointer :scs
(descriptor-reg))
87 (value :scs
(descriptor-reg any-reg
)))
88 (:results
(variable-home-tn :load-if nil
))
91 (aver (sc-is variable-home-tn control-stack
))
92 (store-stack-offset value frame-pointer variable-home-tn
)))
94 (define-vop (xep-allocate-frame)
95 (:temporary
(:sc non-descriptor-reg
:offset lr-offset
) lr
)
98 ;; Make sure the function is aligned, and drop a label pointing to this
100 (emit-alignment n-lowtag-bits
)
101 (emit-label start-lab
)
102 ;; Allocate function header.
103 (inst simple-fun-header-word
)
104 (inst .skip
(* (1- simple-fun-insts-offset
) n-word-bytes
))
105 (inst str lr
(@ cfp-tn
(* lra-save-offset n-word-bytes
)))))
107 (define-vop (xep-setup-sp)
110 (inst add csp-tn cfp-tn
111 (add-sub-immediate (* n-word-bytes
(sb-allocated-size 'control-stack
))))
112 (let ((nfp-tn (current-nfp-tn vop
)))
114 (let ((nbytes (bytes-needed-for-non-descriptor-stack-frame)))
115 (inst sub nfp-tn nsp-tn nbytes
)
116 (inst mov-sp nsp-tn nfp-tn
))))))
118 (define-vop (allocate-frame)
119 (:results
(res :scs
(any-reg))
120 (nfp :scs
(any-reg)))
124 (let ((size (add-sub-immediate (* (max 1 (sb-allocated-size 'control-stack
)) n-word-bytes
))))
125 (cond ((typep size
'(signed-byte 9))
126 (inst str cfp-tn
(@ csp-tn size
:post-index
)))
128 (inst add csp-tn csp-tn size
)
129 (storew cfp-tn res ocfp-save-offset
))))
130 (when (ir2-environment-number-stack-p callee
)
131 (inst sub nfp nsp-tn
(add-sub-immediate
132 (bytes-needed-for-non-descriptor-stack-frame)))
133 (inst mov-sp nsp-tn nfp
))))
135 ;;; Allocate a partial frame for passing stack arguments in a full call. Nargs
136 ;;; is the number of arguments passed. If no stack arguments are passed, then
137 ;;; we don't have to do anything.
138 ;;; LR and CFP are always saved on the stack, but it's safe to have two words above CSP.
139 (define-vop (allocate-full-call-frame)
141 (:results
(res :scs
(any-reg)))
143 (if (<= nargs register-arg-count
)
144 ;; Don't touch RES, the call vops would use CSP-TN in this case.
145 (storew cfp-tn csp-tn ocfp-save-offset
)
146 (let ((size (add-sub-immediate (* nargs n-word-bytes
))))
148 (cond ((typep size
'(signed-byte 9))
149 (inst str cfp-tn
(@ csp-tn size
:post-index
)))
151 (inst add csp-tn csp-tn size
)
152 (storew cfp-tn res ocfp-save-offset
)))))))
154 ;;; Emit code needed at the return-point from an unknown-values call
155 ;;; for a fixed number of values. VALUES is the head of the TN-REF
156 ;;; list for the locations that the values are to be received into.
157 ;;; NVALS is the number of values that are to be received (should
158 ;;; equal the length of Values).
160 ;;; MOVE-TEMP is a DESCRIPTOR-REG TN used as a temporary.
162 ;;; This code exploits the fact that in the unknown-values convention,
163 ;;; a single value return returns with all of the condition flags
164 ;;; clear, whereas a return of other than one value returns with the
165 ;;; condition flags set.
167 ;;; If 0 or 1 values are expected, then we just emit an instruction to
168 ;;; reset the SP (which will only be executed when other than 1 value
171 ;;; In the general case, we have to do three things:
172 ;;; -- Default unsupplied register values. This need only be done when a
173 ;;; single value is returned, since register values are defaulted by the
174 ;;; callee in the non-single case.
175 ;;; -- Default unsupplied stack values. This needs to be done whenever there
176 ;;; are stack values.
177 ;;; -- Reset SP. This must be done whenever other than 1 value is returned,
178 ;;; regardless of the number of values desired.
180 (defun default-unknown-values (vop values nvals move-temp node
)
181 (declare (type (or tn-ref null
) values
)
182 (type unsigned-byte nvals
) (type tn move-temp
))
183 (multiple-value-bind (type name leaf
) (sb-c::lvar-fun-type
(sb-c::basic-combination-fun node
))
184 (let* ((verify (and leaf
185 (policy node
(and (>= safety
1)
187 (memq (sb-c::leaf-where-from leaf
) '(:declared-verify
:defined-here
))))
189 (if (fun-type-p type
)
190 (fun-type-returns type
)
192 (sb-c::node-derived-type node
)))
193 (min-values (values-type-min-value-count type
))
194 (max-values (values-type-max-value-count type
))
195 (trust (or (and (= min-values
0)
196 (= max-values call-arguments-limit
))
198 (expecting-values-on-stack (> nvals register-arg-count
)))
200 (note-this-location vop
(if (<= nvals
1)
203 (flet ((check-nargs ()
205 (let* ((*location-context
* (list* name
206 (type-specifier type
)
207 (make-restart-location SKIP
)))
208 (err-lab (generate-error-code vop
'invalid-arg-count-error
))
210 (max (and (< max-values call-arguments-limit
)
212 (labels ((load-immediate (x)
213 (add-sub-immediate (fixnumize x
))))
215 (inst cbnz nargs-tn err-lab
))
217 (inst cmp nargs-tn
(load-immediate max
))
218 (inst b
:ne err-lab
))
220 (let ((nargs tmp-tn
))
222 (setf nargs nargs-tn
)
223 (inst sub tmp-tn nargs-tn
(load-immediate min
)))
224 (inst cmp nargs
(load-immediate (- max min
))))
225 (inst b
:hi err-lab
))
228 (inst cbz nargs-tn err-lab
))
230 (inst cmp nargs-tn
(load-immediate min
))
231 (inst b
:lo err-lab
)))))))
233 ;; Pick off the single-value case first.
235 (sb-assem:without-scheduling
()
237 ;; Default register values for single-value return case.
238 ;; The callee returns with condition bits CLEAR in the
239 ;; single-value case.
242 (val (tn-ref-across values
) (tn-ref-across val
)))
243 ((= i
(min nvals register-arg-count
)))
244 (unless (eq (tn-kind (tn-ref-tn val
)) :unused
)
249 (inst csel
(tn-ref-tn val
) null-tn
(tn-ref-tn val
) :ne
))))))
251 ;; If we're not expecting values on the stack, all that
252 ;; remains is to clear the stack frame (for the multiple-
253 ;; value return case).
254 (unless (or expecting-values-on-stack
256 (type-single-value-p type
)))
257 (cond ((or (not trust
)
258 (values-type-may-be-single-value-p type
))
259 (inst csel csp-tn ocfp-tn csp-tn
:eq
)
261 (inst mov tmp-tn
(fixnumize 1))
262 (inst csel nargs-tn tmp-tn nargs-tn
:ne
)
264 ((eq type
*empty-type
*))
266 (inst mov csp-tn ocfp-tn
))))
267 (macrolet ((map-stack-values (&body body
)
268 `(do ((i register-arg-count
(1+ i
))
269 (val (do ((i 0 (1+ i
))
270 (val values
(tn-ref-across val
)))
271 ((= i register-arg-count
) val
))
272 (tn-ref-across val
)))
274 (let ((tn (tn-ref-tn val
)))
276 ;; If we ARE expecting values on the stack, we need to
277 ;; either move them to their result location or to set their
278 ;; result location to the default.
279 (when expecting-values-on-stack
280 (let ((decrement (fixnumize (1+ register-arg-count
)))
281 (stack-targets-p (map-stack-values
282 (when (and (>= i min-values
)
283 (neq (tn-kind tn
) :unused
)
284 (sc-is tn control-stack
))
286 ;; If all destinations are registers move NIL into all
287 ;; of them before checking for single value return, that
288 ;; way it doesn't need to set up NARGS and OCFP.
289 (unless stack-targets-p
291 (when (and (>= i min-values
)
292 (neq (tn-kind tn
) :unused
))
293 (inst mov tn null-tn
))))
298 (inst csel ocfp-tn csp-tn ocfp-tn
:ne
)
299 (inst mov tmp-tn
(fixnumize 1))
300 (inst csel nargs-tn tmp-tn nargs-tn
:ne
)
306 (cond ((eq (tn-kind tn
) :unused
)
307 (incf decrement
(fixnumize 1)))
309 (incf decrement
(fixnumize 1))
312 (let* ((next (and (< (1+ i
) min-values
)
313 (tn-ref-across val
)))
317 (not (sc-is next-tn control-stack
))
318 (neq (tn-kind next-tn
) :unused
)
319 (ldp-stp-offset-p (* i n-word-bytes
) n-word-bits
))
320 (inst ldp move-temp next-tn
321 (@ ocfp-tn
(* i n-word-bytes
)))
322 (store-stack-tn tn move-temp
)
325 (incf decrement
(fixnumize 1)))
327 (loadw move-temp ocfp-tn i
)
328 (store-stack-tn tn move-temp
)))))
330 (let* ((next (and (< (1+ i
) min-values
)
331 (tn-ref-across val
)))
335 (neq (tn-kind next-tn
) :unused
)
336 (ldp-stp-offset-p (* i n-word-bytes
) n-word-bits
))
337 (let ((stack (sc-is next-tn control-stack
)))
338 (inst ldp tn
(if stack
341 (@ ocfp-tn
(* i n-word-bytes
)))
343 (store-stack-tn next-tn move-temp
)))
346 (incf decrement
(fixnumize 1)))
348 (loadw tn ocfp-tn i
)))))))
350 (let ((dst move-temp
))
352 ;; ... Load it if there is a stack value available, or
353 ;; default it if there isn't.
354 (inst subs nargs-tn nargs-tn decrement
)
355 (setf decrement
(fixnumize 1))
356 (unless (sc-is tn control-stack
)
358 (when stack-targets-p
361 (loadw dst ocfp-tn i
)
363 (when (sc-is tn control-stack
)
364 (store-stack-tn tn dst
))))))))
365 ;; Deallocate the callee stack frame.
366 (move csp-tn ocfp-tn
))))
370 ;;;; Unknown values receiving:
372 ;;; Emit code needed at the return point for an unknown-values call for an
373 ;;; arbitrary number of values.
375 ;;; We do the single and non-single cases with no shared code: there doesn't
376 ;;; seem to be any potential overlap, and receiving a single value is more
377 ;;; important efficiency-wise.
379 ;;; When there is a single value, we just push it on the stack, returning
380 ;;; the old SP and 1.
382 ;;; When there is a variable number of values, we move all of the argument
383 ;;; registers onto the stack, and return Args and Nargs.
385 ;;; Args and Nargs are TNs wired to the named locations. We must
386 ;;; explicitly allocate these TNs, since their lifetimes overlap with the
387 ;;; results Start and Count (also, it's nice to be able to target them).
388 (defun receive-unknown-values (node args nargs start count
)
389 (declare (type tn args nargs start count
))
390 (let ((unused-count-p (eq (tn-kind count
) :unused
))
391 (unused-start-p (eq (tn-kind start
) :unused
))
392 (type (sb-c::node-derived-type node
)))
393 (if (type-single-value-p type
)
395 (unless unused-start-p
397 (unless unused-count-p
398 (inst mov count
(fixnumize 1)))
399 (inst str
(first *register-arg-tns
*) (@ csp-tn n-word-bytes
:post-index
)))
401 (inst b
:eq MULTIPLE
)
402 (unless unused-start-p
404 (inst str
(first *register-arg-tns
*) (@ csp-tn n-word-bytes
:post-index
))
405 (unless unused-count-p
406 (inst mov count
(fixnumize 1)))
409 #.
(assert (evenp register-arg-count
))
410 (do ((arg *register-arg-tns
* (cddr arg
))
413 (inst stp
(first arg
) (second arg
)
414 (@ args
(* i n-word-bytes
))))
415 (unless unused-start-p
417 (unless unused-count-p
421 ;;; VOP that can be inherited by unknown values receivers. The main
422 ;;; thing this handles is allocation of the result temporaries.
423 (define-vop (unknown-values-receiver)
425 (start :scs
(any-reg))
426 (count :scs
(any-reg)))
427 (:temporary
(:sc any-reg
:offset ocfp-offset
:from
:result
) values-start
)
428 (:temporary
(:sc any-reg
:offset nargs-offset
:from
:result
) nvals
)
429 ;; Avoid being clobbered by RECEIVE-UNKNOWN-VALUES
430 (:temporary
(:sc descriptor-reg
:offset r0-offset
:from
:result
) r0-temp
))
432 ;;; This hook in the codegen pass lets us insert code before fall-thru entry
433 ;;; points, local-call entry points, and tail-call entry points. The default
435 (defun emit-block-header (start-label trampoline-label fall-thru-p alignp
)
436 (declare (ignore alignp
))
437 (when (and fall-thru-p trampoline-label
)
438 (inst b start-label
))
439 (when trampoline-label
440 (emit-label trampoline-label
)
441 (inst str lr-tn
(@ cfp-tn
(* lra-save-offset n-word-bytes
))))
442 (emit-label start-label
))
447 ;;; Get the lexical environment from its passing location.
448 (define-vop (setup-closure-environment)
449 (:temporary
(:sc descriptor-reg
:offset lexenv-offset
:target closure
452 (:results
(closure :scs
(descriptor-reg)))
457 (move closure lexenv
)))
459 ;;; Copy a more arg from the argument area to the end of the current frame.
460 ;;; Fixed is the number of non-more arguments.
461 (define-vop (copy-more-arg)
462 ;; The environment here-and-now is not properly initialized. The
463 ;; stack frame is not yet fully allocated, and even if it were most
464 ;; of the slots have live data in them that PACK does not know
465 ;; about, so we cannot afford a register spill. As far as the boxed
466 ;; registers go, the arg-passing registers (R0, R1, and R2) are
467 ;; live, LEXENV is live, and LRA is live. On the unboxed front,
468 ;; NARGS is live. FP has been set up by the caller, SP is
469 ;; protecting our stack arguments, but is otherwise not set up. NFP
470 ;; is not yet set up. CODE and NULL are set up. SP and NFP must be
471 ;; correctly set up by the time we're done, and OCFP and R9 are
472 ;; available for use as temporaries. If we were any more register
473 ;; constrained, we'd be spilling registers manually (rather than
474 ;; allowing PACK to do it for us). -- AJB, 2012-Oct-30
476 ;; Pack COUNT and DEST into the same register, being careful to tell
477 ;; PACK that their lifetimes do not overlap (we're lying to PACK, as
478 ;; COUNT is live both before and after DEST, but not while DEST is
480 (:temporary
(:sc any-reg
:offset ocfp-offset
:to
:eval
) count
)
481 (:temporary
(:sc any-reg
:offset ocfp-offset
:from
:eval
) dest
)
482 (:temporary
(:sc descriptor-reg
:offset r9-offset
) temp
)
485 ;; We open up with a LET to obtain a TN for NFP. We'll call it
486 ;; RESULT, to distinguish it from NFP-as-NFP and to roughly
487 ;; parallel the PPC implementation. We can't use a :TEMPORARY
488 ;; here because it would conflict with the existing NFP if there
489 ;; is a number-stack frame in play, but we only use it prior to
490 ;; actually setting up the "real" NFP.
491 (let ((result (make-random-tn :kind
:normal
492 :sc
(sc-or-lose 'any-reg
)
494 (delta (- (sb-allocated-size 'control-stack
) fixed
)))
496 ;; Compute the end of the fixed stack frame (start of the MORE
497 ;; arg area) into RESULT.
498 (inst add result cfp-tn
(add-sub-immediate
499 (* n-word-bytes
(sb-allocated-size 'control-stack
))))
500 ;; Compute the end of the MORE arg area (and our overall frame
501 ;; allocation) into the stack pointer.
503 (inst add dest result
(lsl nargs-tn
(- word-shift n-fixnum-tag-bits
)))
505 (inst cbz nargs-tn done
))
507 (inst subs count nargs-tn
(fixnumize fixed
))
508 (inst csel csp-tn result csp-tn
:le
)
510 (inst add dest result
(lsl count
(- word-shift n-fixnum-tag-bits
)))
511 ;; Don't leave the arguments unprotected when moving below the stack pointer
513 (move csp-tn dest
))))
515 (when (< fixed register-arg-count
)
516 ;; We must stop when we run out of stack args, not when we
517 ;; run out of more args.
518 (inst add result result
(* (- register-arg-count fixed
) n-word-bytes
)))
520 ;; We are copying at most (- NARGS FIXED) values, from last to
521 ;; first, in order to shift them out of the allocated part of
522 ;; the stack frame. The FIXED values remain where they are,
523 ;; as they are part of the allocated stack frame. Any
524 ;; remaining values are being moved to just beyond the end of
525 ;; the allocated stack frame, for a distance of (-
526 ;; (sb-allocated-size 'control-stack) fixed) words. There is
527 ;; a constant displacement of a single word in the loop below,
528 ;; because DEST points to the space AFTER the value being
532 (cond ((zerop delta
)) ;; nothing to move
533 ((plusp delta
) ;; copy backward
534 (inst cmp dest result
)
536 (inst ldr temp
(@ dest
(load-store-offset
537 (- (* (1+ delta
) n-word-bytes
)))))
538 (inst str temp
(@ dest
(- n-word-bytes
) :pre-index
))
542 (inst cmp dest result
)
543 (inst b
:le INNER-LOOP-DONE
)
544 (inst ldr temp
(@ result
(load-store-offset
545 (- (* delta n-word-bytes
)))))
546 (inst str temp
(@ result n-word-bytes
:post-index
))
549 (inst mov csp-tn dest
))))
552 (when (< fixed register-arg-count
)
553 ;; Now we have to deposit any more args that showed up in registers.
555 for offset
= (+ delta i
)
557 (cond ((and (< (1+ i
) register-arg-count
)
558 (ldp-stp-offset-p (* offset n-word-bytes
) n-word-bits
))
560 (nth i
*register-arg-tns
*)
561 (nth (1+ i
) *register-arg-tns
*)
562 (@ cfp-tn
(* offset n-word-bytes
)))
565 (storew (nth i
*register-arg-tns
*) cfp-tn offset
)
567 while
(< i register-arg-count
)))
570 ;; Now that we're done with the &MORE args, we can set up the
571 ;; number stack frame.
572 (let ((nfp-tn (current-nfp-tn vop
)))
574 (inst sub nfp-tn nsp-tn
(add-sub-immediate (bytes-needed-for-non-descriptor-stack-frame)))
575 (inst mov-sp nsp-tn nfp-tn
)))))))
577 ;;; More args are stored consecutively on the stack, starting
578 ;;; immediately at the context pointer. The context pointer is not
579 ;;; typed, so the lowtag is 0.
580 (define-vop (more-arg)
581 (:translate %more-arg
)
583 (:args
(context :scs
(descriptor-reg))
584 (index :scs
(any-reg immediate
)))
585 (:arg-types
* tagged-num
)
586 (:temporary
(:scs
(any-reg)) temp
)
587 (:results
(value :scs
(descriptor-reg any-reg
)))
595 (ash (tn-value index
) word-shift
)))))
597 (inst add temp context
(lsl index
(- word-shift n-fixnum-tag-bits
)))
598 (loadw value temp
)))))
601 (:translate sb-c
::%more-kw-arg
)
603 (:args
(context :scs
(descriptor-reg))
604 (index :scs
(any-reg)))
605 (:arg-types
* tagged-num
)
606 (:temporary
(:scs
(any-reg)) temp
)
607 (:results
(value :scs
(descriptor-reg any-reg
))
608 (keyword :scs
(descriptor-reg any-reg
)))
611 (inst add temp context
(lsl index
(- word-shift n-fixnum-tag-bits
)))
612 (inst ldp keyword value
(@ temp
))))
614 (define-vop (more-arg-or-nil)
616 (:args
(object :scs
(descriptor-reg) :to
(:result
1))
617 (count :scs
(any-reg) :to
(:result
1)))
618 (:arg-types
* tagged-num
)
620 (:results
(value :scs
(descriptor-reg any-reg
)))
623 (inst mov value null-tn
)
625 (inst cbz count done
))
627 (inst cmp count
(fixnumize index
))
632 (ash index word-shift
))))
635 ;;; Turn more arg (context, count) into a list.
637 (:translate %listify-rest-args
)
638 (:args
(context-arg :target context
:scs
(descriptor-reg))
639 (count-arg :target count
:scs
(any-reg)))
640 (:arg-types
* tagged-num
)
641 (:temporary
(:scs
(descriptor-reg) :from
(:argument
0)) context
)
642 (:temporary
(:scs
(any-reg) :from
(:argument
1)) count
)
643 (:temporary
(:scs
(descriptor-reg) :from
:eval
) temp
)
644 (:temporary
(:scs
(any-reg) :from
:eval
) dst
)
645 (:temporary
(:sc non-descriptor-reg
:offset lr-offset
) lr
)
646 (:results
(result :scs
(descriptor-reg)))
650 (move context context-arg
)
651 (move count count-arg
)
652 ;; Check to see if there are any arguments.
653 (move result null-tn
)
654 (inst cbz count DONE
)
656 (pseudo-atomic (lr :sync nil
:elide-if
(node-stack-allocate-p node
))
658 ;; Allocate a cons (2 words) for each item.
659 (let* ((dx-p (node-stack-allocate-p node
))
661 (lsl count
(1+ (- word-shift n-fixnum-tag-bits
))))
663 (inst lsl temp count
(1+ (- word-shift n-fixnum-tag-bits
)))
665 (allocation 'list size list-pointer-lowtag dst
667 :stack-allocate-p dx-p
670 ;; The size will be computed by subtracting from CSP
671 (inst mov tmp-tn context
)
672 (invoke-asm-routine (if (system-tlab-p 0 node
) 'sys-listify-
&rest
'listify-
&rest
) lr
)
673 (inst mov result tmp-tn
)
674 (inst b ALLOC-DONE
))))
679 ;; Compute the next cons and store it in the current one.
681 (inst add dst dst
(* 2 n-word-bytes
))
682 (storew dst dst -
1 list-pointer-lowtag
)
686 (inst ldr temp
(@ context n-word-bytes
:post-index
))
688 ;; Dec count, and if != zero, go back for more.
689 (inst subs count count
(fixnumize 1))
690 ;; Store the value into the car of the current cons.
691 (storew temp dst
0 list-pointer-lowtag
)
694 ;; NIL out the last cons.
695 (storew null-tn dst
1 list-pointer-lowtag
)
699 ;;; Return the location and size of the more arg glob created by
700 ;;; Copy-More-Arg. Supplied is the total number of arguments supplied
701 ;;; (originally passed in NARGS.) Fixed is the number of non-rest
704 ;;; We must duplicate some of the work done by Copy-More-Arg, since at
705 ;;; that time the environment is in a pretty brain-damaged state,
706 ;;; preventing this info from being returned as values. What we do is
707 ;;; compute supplied - fixed, and return a pointer that many words
708 ;;; below the current stack top.
711 (:translate sb-c
::%more-arg-context
)
712 (:args
(supplied :scs
(any-reg)))
713 (:arg-types tagged-num
(:constant fixnum
))
715 (:results
(context :scs
(descriptor-reg))
716 (count :scs
(any-reg)))
717 (:result-types t tagged-num
)
718 (:note
"more-arg-context")
720 (inst sub count supplied
(fixnumize fixed
))
721 (inst sub context csp-tn
(lsl count
(- word-shift n-fixnum-tag-bits
)))))
723 (define-vop (verify-arg-count)
725 (:args
(nargs :scs
(any-reg)))
726 (:arg-types positive-fixnum
(:constant t
) (:constant t
))
729 (:temporary
(:sc unsigned-reg
:offset nl0-offset
) temp
)
730 (:save-p
:compute-only
)
733 (generate-error-code vop
'invalid-arg-count-error
)))
734 (labels ((load-immediate (x)
735 (add-sub-immediate (fixnumize x
))))
737 (inst cbnz nargs err-lab
))
739 (inst cmp nargs
(load-immediate max
))
740 (inst b
:ne err-lab
))
744 (inst sub temp nargs
(load-immediate min
)))
745 (inst cmp temp
(load-immediate (- max min
)))
746 (inst b
:hi err-lab
))
749 (inst cbz nargs err-lab
))
751 (inst cmp nargs
(load-immediate min
))
752 (inst b
:lo err-lab
)))))))))
754 ;;;; Local call with unknown values convention return:
756 ;;; Non-TR local call for a fixed number of values passed according to the
757 ;;; unknown values convention.
759 ;;; Args are the argument passing locations, which are specified only to
760 ;;; terminate their lifetimes in the caller.
762 ;;; Values are the return value locations (wired to the standard passing
765 ;;; Save is the save info, which we can ignore since saving has been done.
766 ;;; Return-PC is the TN that the return PC should be passed in.
767 ;;; Target is a continuation pointing to the start of the called function.
768 ;;; Nvals is the number of values received.
770 ;;; Note: we can't use normal load-tn allocation for the fixed args, since all
771 ;;; registers may be tied up by the more operand. Instead, we use
772 ;;; MAYBE-LOAD-STACK-TN.
773 (define-vop (call-local)
777 (:results
(values :more t
))
779 (:move-args
:local-call
)
780 (:info arg-locs callee target nvals
)
783 (:temporary
(:scs
(descriptor-reg) :from
(:eval
0)) move-temp
)
784 (:temporary
(:sc control-stack
:offset nfp-save-offset
) nfp-save
)
785 (:temporary
(:sc any-reg
:offset ocfp-offset
:from
(:eval
0)) ocfp
)
786 (:ignore arg-locs args ocfp
)
788 (let ((cur-nfp (current-nfp-tn vop
)))
790 (store-stack-tn nfp-save cur-nfp
))
791 (let ((callee-nfp (callee-nfp-tn callee
)))
793 (maybe-load-stack-tn callee-nfp nfp
)))
794 (maybe-load-stack-tn cfp-tn fp
)
795 (note-this-location vop
:call-site
)
797 (default-unknown-values vop values nvals move-temp node
)
799 (load-stack-tn cur-nfp nfp-save
)))))
802 ;;; Non-TR local call for a variable number of return values passed according
803 ;;; to the unknown values convention. The results are the start of the values
804 ;;; glob and the number of values received.
806 ;;; Note: we can't use normal load-tn allocation for the fixed args, since all
807 ;;; registers may be tied up by the more operand. Instead, we use
808 ;;; MAYBE-LOAD-STACK-TN.
809 (define-vop (multiple-call-local unknown-values-receiver
)
814 (:move-args
:local-call
)
815 (:info save callee target
)
816 (:ignore args save r0-temp
)
819 (:temporary
(:sc control-stack
:offset nfp-save-offset
) nfp-save
)
821 (let ((cur-nfp (current-nfp-tn vop
)))
823 (store-stack-tn nfp-save cur-nfp
))
824 (let ((callee-nfp (callee-nfp-tn callee
)))
825 ;; alpha doesn't test this before the maybe-load
827 (maybe-load-stack-tn callee-nfp nfp
)))
828 (maybe-load-stack-tn cfp-tn fp
)
829 (note-this-location vop
:call-site
)
831 (note-this-location vop
:unknown-return
)
832 (receive-unknown-values node values-start nvals start count
)
834 (load-stack-tn cur-nfp nfp-save
)))))
836 ;;;; Local call with known values return:
838 ;;; Non-TR local call with known return locations. Known-value return works
839 ;;; just like argument passing in local call.
841 ;;; Note: we can't use normal load-tn allocation for the fixed args, since all
842 ;;; registers may be tied up by the more operand. Instead, we use
843 ;;; MAYBE-LOAD-STACK-TN.
844 (define-vop (known-call-local)
848 (:results
(res :more t
))
849 (:move-args
:local-call
)
851 (:info save callee target
)
852 (:ignore args res save
)
854 (:temporary
(:sc control-stack
:offset nfp-save-offset
) nfp-save
)
856 (let ((cur-nfp (current-nfp-tn vop
)))
858 (store-stack-tn nfp-save cur-nfp
))
859 (let ((callee-nfp (callee-nfp-tn callee
)))
861 (maybe-load-stack-tn callee-nfp nfp
)))
862 (maybe-load-stack-tn cfp-tn fp
)
863 (note-this-location vop
:call-site
)
865 (note-this-location vop
:known-return
)
867 (load-stack-tn cur-nfp nfp-save
)))))
869 ;;; Return from known values call. We receive the return locations as
870 ;;; arguments to terminate their lifetimes in the returning function. We
871 ;;; restore FP and CSP and jump to the Return-PC.
873 ;;; Note: we can't use normal load-tn allocation for the fixed args, since all
874 ;;; registers may be tied up by the more operand. Instead, we use
875 ;;; MAYBE-LOAD-STACK-TN.
876 (define-vop (known-return)
880 (:temporary
(:sc non-descriptor-reg
:offset lr-offset
) lr
)
881 (:move-args
:known-return
)
883 (:ignore old-fp return-pc val-locs vals
)
887 (loadw-pair cfp-tn ocfp-save-offset lr lra-save-offset cfp-tn
)
888 (let ((cur-nfp (current-nfp-tn vop
)))
890 (inst add nsp-tn cur-nfp
(add-sub-immediate
891 (bytes-needed-for-non-descriptor-stack-frame)))))
892 (lisp-return lr
:known
)))
896 ;;; There is something of a cross-product effect with full calls.
897 ;;; Different versions are used depending on whether we know the
898 ;;; number of arguments or the name of the called function, and
899 ;;; whether we want fixed values, unknown values, or a tail call.
901 ;;; In full call, the arguments are passed creating a partial frame on
902 ;;; the stack top and storing stack arguments into that frame. On
903 ;;; entry to the callee, this partial frame is pointed to by FP. If
904 ;;; there are no stack arguments, we don't bother allocating a partial
905 ;;; frame, and instead set FP to SP just before the call.
907 ;;; This macro helps in the definition of full call VOPs by avoiding code
908 ;;; replication in defining the cross-product VOPs.
910 ;;; Name is the name of the VOP to define.
912 ;;; Named is true if the first argument is a symbol whose global function
913 ;;; definition is to be called.
915 ;;; Return is either :Fixed, :Unknown or :Tail:
916 ;;; -- If :Fixed, then the call is for a fixed number of values, returned in
917 ;;; the standard passing locations (passed as result operands).
918 ;;; -- If :Unknown, then the result values are pushed on the stack, and the
919 ;;; result values are specified by the Start and Count as in the
920 ;;; unknown-values continuation representation.
921 ;;; -- If :Tail, then do a tail-recursive call. No values are returned.
922 ;;; The Old-Fp and Return-PC are passed as the second and third arguments.
924 ;;; In non-tail calls, the pointer to the stack arguments is passed as the last
925 ;;; fixed argument. If Variable is false, then the passing locations are
926 ;;; passed as a more arg. Variable is true if there are a variable number of
927 ;;; arguments passed on the stack. Variable cannot be specified with :Tail
928 ;;; return. TR variable argument call is implemented separately.
930 ;;; In tail call with fixed arguments, the passing locations are passed as a
931 ;;; more arg, but there is no new-FP, since the arguments have been set up in
932 ;;; the current frame.
933 (defmacro define-full-call
(name named return variable
&optional args
)
934 (aver (not (and variable
(eq return
:tail
))))
936 ,@(when (eq return
:unknown
)
937 '(unknown-values-receiver)))
939 ,@(unless (eq return
:tail
)
940 '((new-fp :scs
(any-reg) :to
:eval
)))
944 '((arg-fun :target lexenv
)))
947 '((name :target name-pass
))))
949 ,@(when (eq return
:tail
)
953 ,@(unless variable
`((args :more t
,@(unless (eq args
:fixed
)
954 '(:scs
(descriptor-reg control-stack
)))))))
956 ,@(when (memq return
'(:fixed
:unboxed
))
957 '((:results
(values :more t
))))
959 (:save-p
,(if (eq return
:tail
) :compute-only t
))
961 ,@(unless (or (eq return
:tail
)
963 `((:move-args
,(if (eq args
:fixed
)
970 (:info
,@(unless (or variable
(eq return
:tail
)) '(arg-locs))
971 ,@(unless variable
'(nargs))
972 ,@(when (eq named
:direct
) '(fun))
973 ,@(when (eq return
:fixed
) '(nvals))
979 ,@(unless (or variable
(eq return
:tail
)) '(arg-locs))
980 ,@(unless variable
'(args))
982 (:fixed
'(ocfp-temp))
983 (:unboxed
'(ocfp-temp node values
))
984 (:tail
'(old-fp return-pc node
))
985 (:unknown
'(r0-temp))))
987 ,@(unless (eq named
:direct
)
988 `((:temporary
(:sc descriptor-reg
:offset lexenv-offset
989 :from
(:argument
,(if (eq return
:tail
) 0 1))
991 ,(if named
'name-pass
'lexenv
))))
993 (:temporary
(:sc any-reg
:offset nargs-offset
:to
994 ,(if (eq return
:fixed
)
1000 (mapcar #'(lambda (name offset
)
1001 `(:temporary
(:sc descriptor-reg
1005 *register-arg-names
* *register-arg-offsets
*))
1006 ,@(when (eq return
:fixed
)
1007 '((:temporary
(:scs
(descriptor-reg) :from
:eval
) move-temp
)
1008 (:temporary
(:sc any-reg
:from
:eval
:offset ocfp-offset
) ocfp-temp
)))
1009 ,@(when (eq return
:unboxed
)
1010 '((:temporary
(:sc any-reg
:from
:eval
:offset ocfp-offset
) ocfp-temp
)))
1011 ,@(unless (eq return
:tail
)
1012 '((:temporary
(:sc control-stack
:offset nfp-save-offset
) nfp-save
)))
1014 (:temporary
(:sc non-descriptor-reg
:offset lr-offset
) lr
)
1016 (:generator
,(+ (if named
5 0)
1018 (if (eq return
:tail
) 0 10)
1020 (if (eq return
:unknown
) 25 0))
1021 (let* ((cur-nfp (current-nfp-tn vop
))
1024 (list ,@(if (eq return
:tail
)
1032 (flet ((do-next-filler ()
1033 (let* ((next (pop filler
))
1034 (what (if (consp next
) (car next
) next
)))
1038 `((inst sub nargs-pass csp-tn new-fp
)
1039 (inst asr nargs-pass nargs-pass
(- word-shift n-fixnum-tag-bits
))
1040 ,@(do ((arg *register-arg-names
* (cddr arg
))
1043 ((null arg
) (nreverse insts
))
1044 #.
(assert (evenp register-arg-count
))
1045 (push `(inst ldp
,(first arg
) ,(second arg
)
1046 (@ new-fp
,(* i n-word-bytes
)))
1048 (storew cfp-tn new-fp ocfp-save-offset
))
1049 '((unless (consp nargs
)
1050 (load-immediate-word nargs-pass
(fixnumize nargs
))))))
1051 ,@(if (eq return
:tail
)
1053 (inst add nsp-tn cur-nfp
(add-sub-immediate
1054 (bytes-needed-for-non-descriptor-stack-frame)))))
1056 (store-stack-tn nfp-save cur-nfp
))
1058 (move cfp-tn
(cond ,@(and
1060 '(((<= (if (consp nargs
)
1062 nargs
) register-arg-count
)
1067 (insert-step-instrumenting ()
1068 ;; Conditionally insert a conditional trap:
1069 (when step-instrumenting
1072 (load-symbol-value tmp-tn sb-impl
::*stepping
*)
1074 (loadw tmp-tn thread-tn thread-stepping-slot
)
1075 (inst cbz tmp-tn step-done-label
)
1076 ;; CONTEXT-PC will be pointing here when the
1077 ;; interrupt is handled, not after the
1079 (note-this-location vop
:internal-error
)
1080 (inst brk single-step-around-trap
)
1082 (declare (ignorable #'insert-step-instrumenting
))
1086 (descriptor-reg (move name-pass name
))
1088 (load-stack-tn name-pass name
)
1091 (load-constant vop name name-pass
)
1094 (insert-step-instrumenting)))
1097 (descriptor-reg (move lexenv arg-fun
))
1099 (load-stack-tn lexenv arg-fun
)
1102 (load-constant vop arg-fun lexenv
)
1104 (insert-step-instrumenting)
1112 `((loadw lr name-pass fdefn-raw-addr-slot other-pointer-lowtag
)
1113 ,(if (eq return
:tail
)
1114 `(inst add lr lr
4))))
1116 `((inst ldr lr
(@ null-tn
(load-store-offset (static-fun-offset fun
))))
1117 ,(if (eq return
:tail
)
1118 `(inst add lr lr
4)))))
1120 (note-this-location vop
:call-site
)
1123 (if (eq return
:tail
)
1126 (if (eq return
:tail
)
1127 `(tail-call-unnamed lexenv lr fun-type
)
1128 `(call-unnamed lexenv lr fun-type
))))
1132 '((default-unknown-values vop values nvals move-temp node
)
1134 (load-stack-tn cur-nfp nfp-save
))))
1136 '((note-this-location vop
:unknown-return
)
1137 (receive-unknown-values node values-start nvals start count
)
1139 (load-stack-tn cur-nfp nfp-save
))))
1142 (load-stack-tn cur-nfp nfp-save
))))
1145 (define-full-call call nil
:fixed nil
)
1146 (define-full-call call-named t
:fixed nil
)
1147 (define-full-call static-call-named
:direct
:fixed nil
)
1148 (define-full-call multiple-call nil
:unknown nil
)
1149 (define-full-call multiple-call-named t
:unknown nil
)
1150 (define-full-call static-multiple-call-named
:direct
:unknown nil
)
1151 (define-full-call tail-call nil
:tail nil
)
1152 (define-full-call tail-call-named t
:tail nil
)
1153 (define-full-call static-tail-call-named
:direct
:tail nil
)
1155 (define-full-call call-variable nil
:fixed t
)
1156 (define-full-call multiple-call-variable nil
:unknown t
)
1158 (define-full-call fixed-call-named t
:fixed nil
:fixed
)
1159 (define-full-call fixed-tail-call-named t
:tail nil
:fixed
)
1161 (define-full-call unboxed-call-named t
:unboxed nil
)
1162 (define-full-call fixed-unboxed-call-named t
:unboxed nil
:fixed
)
1164 ;;; Defined separately, since needs special code that BLT's the
1166 (define-vop (tail-call-variable)
1168 (args-arg :scs
(any-reg) :target args
)
1169 (function-arg :scs
(descriptor-reg) :target lexenv
)
1170 (old-fp-arg :scs
(any-reg) :load-if nil
)
1171 (lra-arg :scs
(descriptor-reg) :load-if nil
))
1173 (:temporary
(:sc any-reg
:offset nl2-offset
:from
(:argument
0)) args
)
1174 (:temporary
(:sc descriptor-reg
:offset lexenv-offset
:from
(:argument
1)) lexenv
)
1175 (:ignore old-fp-arg lra-arg
)
1178 ;; Move these into the passing locations if they are not already there.
1179 (move args args-arg
)
1180 (move lexenv function-arg
)
1181 ;; Clear the number stack if anything is there.
1182 (let ((cur-nfp (current-nfp-tn vop
)))
1184 (inst add nsp-tn cur-nfp
(add-sub-immediate
1185 (bytes-needed-for-non-descriptor-stack-frame)))))
1186 (invoke-asm-routine (if (eq fun-type
:function
)
1188 'tail-call-callable-variable
)
1192 ;;; Invoke the function-designator FUN.
1193 (defun tail-call-unnamed (lexenv lr type
)
1196 (invoke-asm-routine 'tail-call-symbol tmp-tn
:tail t
))
1199 (when (eq type
:designator
)
1200 (inst and tmp-tn lexenv lowtag-mask
)
1201 (inst cmp tmp-tn fun-pointer-lowtag
)
1203 (invoke-asm-routine 'tail-call-symbol tmp-tn
:tail t
))
1205 (loadw lr lexenv closure-fun-slot fun-pointer-lowtag
)
1209 (defun call-unnamed (lexenv lr type
)
1212 (invoke-asm-routine 'call-symbol tmp-tn
))
1215 (when (eq type
:designator
)
1216 (inst and tmp-tn lexenv lowtag-mask
)
1217 (inst cmp tmp-tn fun-pointer-lowtag
)
1219 (invoke-asm-routine 'call-symbol tmp-tn
)
1222 (loadw lr lexenv closure-fun-slot fun-pointer-lowtag
)
1226 ;;;; Unknown values return:
1228 ;;; Return a single value using the unknown-values convention.
1229 (define-vop (return-single)
1233 (:temporary
(:sc non-descriptor-reg
:offset lr-offset
) lr
)
1234 (:ignore value old-fp return-pc
)
1237 ;; Clear the number stack.
1238 (let ((cur-nfp (current-nfp-tn vop
)))
1240 (inst add nsp-tn cur-nfp
(add-sub-immediate
1241 (bytes-needed-for-non-descriptor-stack-frame)))))
1242 ;; Interrupts leave two words of space for the new frame, so it's safe
1243 ;; to deallocate the frame before accessing OCFP/LR.
1244 (move csp-tn cfp-tn
)
1245 (loadw-pair cfp-tn ocfp-save-offset lr lra-save-offset cfp-tn
)
1246 ;; Clear the control stack, and restore the frame pointer.
1249 (lisp-return lr
:single-value
)))
1251 ;;; Do unknown-values return of a fixed number of values. The Values are
1252 ;;; required to be set up in the standard passing locations. Nvals is the
1253 ;;; number of values returned.
1255 ;;; If returning a single value, then deallocate the current frame, restore
1256 ;;; FP and jump to the single-value entry at Return-PC + 8.
1258 ;;; If returning other than one value, then load the number of values returned,
1259 ;;; NIL out unsupplied values registers, restore FP and return at Return-PC.
1260 ;;; When there are stack values, we must initialize the argument pointer to
1261 ;;; point to the beginning of the values block (which is the beginning of the
1263 (define-vop (return)
1268 (:ignore values old-fp return-pc
)
1270 (:temporary
(:sc descriptor-reg
:offset r0-offset
:from
(:eval
0)) r0
)
1271 (:temporary
(:sc descriptor-reg
:offset r1-offset
:from
(:eval
0)) r1
)
1272 (:temporary
(:sc descriptor-reg
:offset r2-offset
:from
(:eval
0)) r2
)
1273 (:temporary
(:sc descriptor-reg
:offset r3-offset
:from
(:eval
0)) r3
)
1274 (:temporary
(:sc non-descriptor-reg
:offset lr-offset
) lr
)
1275 (:temporary
(:sc any-reg
:offset nargs-offset
) nargs
)
1276 (:temporary
(:sc any-reg
:offset ocfp-offset
) val-ptr
)
1279 ;; Clear the number stack.
1280 (let ((cur-nfp (current-nfp-tn vop
)))
1282 (inst add nsp-tn cur-nfp
(add-sub-immediate
1283 (bytes-needed-for-non-descriptor-stack-frame)))))
1285 ;; Clear the control stack, and restore the frame pointer.
1286 (move csp-tn cfp-tn
)
1287 (loadw-pair cfp-tn ocfp-save-offset lr lra-save-offset cfp-tn
)
1289 (lisp-return lr
:single-value
))
1291 ;; Establish the values pointer.
1292 (move val-ptr cfp-tn
)
1293 ;; restore the frame pointer and clear as much of the control
1294 ;; stack as possible.
1295 (loadw-pair cfp-tn ocfp-save-offset lr lra-save-offset cfp-tn
)
1296 (inst add csp-tn val-ptr
(add-sub-immediate (* nvals n-word-bytes
)))
1297 ;; Establish the values count.
1298 (load-immediate-word nargs
(fixnumize nvals
))
1299 ;; pre-default any argument register that need it.
1300 (when (< nvals register-arg-count
)
1301 (dolist (reg (subseq (list r0 r1 r2 r3
) nvals
))
1302 (move reg null-tn
)))
1304 (lisp-return lr
:multiple-values
)))))
1306 ;;; Do unknown-values return of an arbitrary number of values (passed
1307 ;;; on the stack.) We check for the common case of a single return
1308 ;;; value, and do that inline using the normal single value return
1309 ;;; convention. Otherwise, we branch off to code that calls an
1310 ;;; assembly-routine.
1311 (define-vop (return-multiple)
1313 (old-fp-arg :scs
(any-reg) :to
(:eval
1))
1315 (vals-arg :scs
(any-reg) :target vals
)
1316 (nvals-arg :scs
(any-reg) :target nvals
))
1317 (:temporary
(:sc any-reg
:offset nl2-offset
:from
(:argument
0)) old-fp
)
1318 (:temporary
(:sc any-reg
:offset nl1-offset
:from
(:argument
2)) vals
)
1319 (:temporary
(:sc any-reg
:offset nargs-offset
:from
(:argument
3)) nvals
)
1320 (:temporary
(:sc descriptor-reg
:offset r0-offset
) r0
)
1321 (:temporary
(:sc non-descriptor-reg
:offset lr-offset
) lr
)
1324 (maybe-load-stack-tn lr lra-arg
)
1325 ;; Clear the number stack.
1326 (let ((cur-nfp (current-nfp-tn vop
)))
1328 (inst add nsp-tn cur-nfp
(add-sub-immediate
1329 (bytes-needed-for-non-descriptor-stack-frame)))))
1331 ;; Check for the single case.
1332 (inst cmp nvals-arg
(fixnumize 1))
1333 (inst b
:ne NOT-SINGLE
)
1335 ;; Return with one value.
1336 (inst ldr r0
(@ vals-arg
))
1337 (move csp-tn cfp-tn
)
1338 (move cfp-tn old-fp-arg
)
1339 (lisp-return lr
:single-value
)
1342 (move old-fp old-fp-arg
)
1343 (move vals vals-arg
)
1344 (move nvals nvals-arg
)
1345 (invoke-asm-routine 'return-multiple tmp-tn
:tail t
)))
1349 (define-vop (step-instrument-before-vop)
1350 (:policy
:fast-safe
)
1354 (load-symbol-value tmp-tn sb-impl
::*stepping
*)
1356 (loadw tmp-tn thread-tn thread-stepping-slot
)
1357 (inst cbz tmp-tn DONE
)
1358 ;; CONTEXT-PC will be pointing here when the interrupt is handled,
1359 ;; not after the BREAK.
1360 (note-this-location vop
:internal-error
)
1361 ;; A best-guess effort at a debug trap suitable for a
1362 ;; single-step-before-trap.
1363 (inst brk single-step-before-trap
)