History

Reduce assembly footprint of execute function to allow for specialized tool dispatcher logic Fix locking strategy in scheduler - Release lock prior to notify Change default build optimization to 'for speed' rather than 'full' Add current thread quanta to register and specify size for thread state enum No longer free tool dispatcher after all tools have detached

arr committed 10 years ago

Commit 81423391 parent ed790b411 files · +241 −66Browse files

Showing the changes to src/vm/execution_table.cpp (1 of 11 files). Show all

Unified · Split

src/vm/execution_table.cpp+9−3
@@ -1466,7 +1466,9 @@ namespace · 1465 unmodified lines
14661466 r.mp_base = r.module_ref->mp_base;
14671467 }
14681468
1469− r.stack.pop_frame();
1469+ auto new_frame = r.stack.pop_frame();
1470+ if (new_frame == nullptr)
1471+ r.current_thread_state = vm_thread_state_t::empty_stack;
14701472
14711473 if (debug::is_component_tracing_enabled<debug::component_trace_t::stack>())
14721474 debug::log_msg(debug::component_trace_t::stack, debug::log_level_t::debug, "exit: function\n");
@@ -1587,7 +1589,9 @@ namespace · 114 unmodified lines
15871589 vm.fork(r.thread.get_thread_id(), *r.module_ref, *spawned_frame, starting_pc);
15881590
15891591 // After the new thread is forked pop off the argument passing frame.
1590− r.stack.pop_frame();
1592+ auto new_frame = r.stack.pop_frame();
1593+ if (new_frame == nullptr)
1594+ r.current_thread_state = vm_thread_state_t::empty_stack;
15911595 }
15921596
15931597 EXEC_DECL(mspawn)
@@ -1616,7 +1620,9 @@ namespace · 22 unmodified lines
16161620 vm.fork(r.thread.get_thread_id(), *target_module_ref, *spawned_frame, function_ref.entry_pc);
16171621
16181622 // After the new thread is forked pop off the argument passing frame.
1619− r.stack.pop_frame();
1623+ auto new_frame = r.stack.pop_frame();
1624+ if (new_frame == nullptr)
1625+ r.current_thread_state = vm_thread_state_t::empty_stack;
16201626 }
16211627
16221628 EXEC_DECL(exit)