fix platform dependency in leaf-signal-handler

db4
Joe Groff 2011-10-31 16:49:23 -07:00
parent abaa051768
commit 252915a37c
2 changed files with 7 additions and 5 deletions

View File

@ -114,6 +114,8 @@ big-endian off
frame-size jit-signal-handler-epilog
] \ signal-handler define-sub-primitive
: leaf-frame-size ( -- n ) 4 bootstrap-cells ;
[| |
jit-signal-handler-prolog :> frame-size
jit-save-context
@ -121,7 +123,7 @@ big-endian off
temp0 CALL
frame-size jit-signal-handler-epilog
! Pop the fake leaf frame along with our return address
stack-frame-size cell - RET
leaf-frame-size cell - RET
] \ leaf-signal-handler define-sub-primitive
[

View File

@ -53,10 +53,10 @@ void factor_vm::dispatch_signal_handler(cell *sp, cell *pc, cell handler)
code_block *leaf_block = code->code_block_for_address(*pc);
assert(leaf_block != NULL);
cell newsp = *sp - 32;
*(cell*)(newsp + 32 - sizeof(cell)) = 32;
*(cell*)(newsp + 32 - 2*sizeof(cell)) = (cell)leaf_block->entry_point();
*(cell*) newsp = *pc;
cell newsp = *sp - 4*sizeof(cell);
*(cell*)(newsp + 3*sizeof(cell)) = 4*sizeof(cell);
*(cell*)(newsp + 2*sizeof(cell)) = (cell)leaf_block->entry_point();
*(cell*) newsp = *pc;
*sp = newsp;
handler_word = tagged<word>(special_objects[LEAF_SIGNAL_HANDLER_WORD]);
}