From 9f6f36fdec789d9adc7b7e609d6ba9b6836f6d5f Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Sat, 29 Oct 2011 18:13:22 -0700 Subject: [PATCH] cpu.x86.bootstrap: simplify leaf-signal-handler We can use RET (stack-frame-size - cell) instead of doing stack gymnastics. --- basis/cpu/x86/bootstrap.factor | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/basis/cpu/x86/bootstrap.factor b/basis/cpu/x86/bootstrap.factor index 480b0efa90..e0d1ef9bf7 100644 --- a/basis/cpu/x86/bootstrap.factor +++ b/basis/cpu/x86/bootstrap.factor @@ -119,19 +119,9 @@ big-endian off jit-save-context temp0 vm-reg vm-signal-handler-addr-offset [+] MOV temp0 CALL - ! Stack at this point has a fake stack frame set up to represent the - ! leaf procedure we interrupted. We must tear down that frame in - ! addition to our own before resuming. - ! 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 + frame-size jit-signal-handler-epilog + ! Pop the fake leaf frame along with our return address + stack-frame-size cell - RET ] \ leaf-signal-handler define-sub-primitive [