cpu.x86.bootstrap: simplify leaf-signal-handler
We can use RET (stack-frame-size - cell) instead of doing stack gymnastics.db4
parent
40bc8459db
commit
9f6f36fdec
|
@ -119,19 +119,9 @@ big-endian off
|
||||||
jit-save-context
|
jit-save-context
|
||||||
temp0 vm-reg vm-signal-handler-addr-offset [+] MOV
|
temp0 vm-reg vm-signal-handler-addr-offset [+] MOV
|
||||||
temp0 CALL
|
temp0 CALL
|
||||||
! Stack at this point has a fake stack frame set up to represent the
|
frame-size jit-signal-handler-epilog
|
||||||
! leaf procedure we interrupted. We must tear down that frame in
|
! Pop the fake leaf frame along with our return address
|
||||||
! addition to our own before resuming.
|
stack-frame-size cell - RET
|
||||||
! Grab our frame's return address and place it just underneath the leaf proc's
|
|
||||||
! return address, since we can't touch any registers once they've been
|
|
||||||
! restored. If we got this far there should be no faults here and we
|
|
||||||
! can get away with corrupting the stack frame.
|
|
||||||
temp0 stack-reg frame-size bootstrap-cell - [+] MOV
|
|
||||||
stack-reg frame-size stack-frame-size + 2 bootstrap-cells - [+] temp0 MOV
|
|
||||||
|
|
||||||
! Pop enough of the fake frame to leave the resume address at the top of the
|
|
||||||
! stack when we RET.
|
|
||||||
frame-size stack-frame-size + bootstrap-cell - jit-signal-handler-epilog
|
|
||||||
] \ leaf-signal-handler define-sub-primitive
|
] \ leaf-signal-handler define-sub-primitive
|
||||||
|
|
||||||
[
|
[
|
||||||
|
|
Loading…
Reference in New Issue