]> gitweb.factorcode.org Git - factor.git/commitdiff
VM: better way to set signal_resumable 1460/head
authorBjörn Lindqvist <bjourne@gmail.com>
Wed, 26 Aug 2015 18:15:42 +0000 (20:15 +0200)
committerBjörn Lindqvist <bjourne@gmail.com>
Wed, 26 Aug 2015 18:23:28 +0000 (20:23 +0200)
vm/cpu-x86.cpp

index 6573f0d7aa669463c5872da096090ad27570bd3c..494ce6fa8f67260f8fba53e0a8c976e78ac0e7f0 100644 (file)
@@ -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;
 
@@ -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. */
@@ -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);