Skip to content

Commit

Permalink
VM: better way to set signal_resumable
Browse files Browse the repository at this point in the history
  • Loading branch information
bjourne committed Aug 26, 2015
1 parent 663e5e2 commit a9c33cb
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions vm/cpu-x86.cpp
Expand Up @@ -10,8 +10,6 @@ void factor_vm::dispatch_non_resumable_signal(cell* sp, cell* pc,
call stack from *sp and instead use the last saved "good value"
which we get from ctx->callstack_top. Then launch the handler
without going through the resumable subprimitive. */
signal_resumable = false;

cell frame_top = ctx->callstack_top;
cell seg_start = ctx->callstack_seg->start;

Expand Down Expand Up @@ -40,8 +38,6 @@ void factor_vm::dispatch_non_resumable_signal(cell* sp, cell* pc,

void factor_vm::dispatch_resumable_signal(cell* sp, cell* pc, cell handler) {

signal_resumable = true;

/* Fault came from Factor, and we've got a good callstack. Route the
signal handler through the resumable signal handler
subprimitive. */
Expand Down Expand Up @@ -81,8 +77,9 @@ void factor_vm::dispatch_signal_handler(cell* sp, cell* pc, cell handler) {

bool in_code_seg = code->seg->in_segment_p(*pc);
cell cs_limit = ctx->callstack_seg->start + stack_reserved;
bool resumable_p = in_code_seg && *sp >= cs_limit;
if (resumable_p) {
signal_resumable = in_code_seg && *sp >= cs_limit;

if (signal_resumable) {
dispatch_resumable_signal(sp, pc, handler);
} else {
dispatch_non_resumable_signal(sp, pc, handler, cs_limit);
Expand Down

0 comments on commit a9c33cb

Please sign in to comment.