Showing the changes to src (3 of 3 files). Show all
Unified · Split
| @@ -84,7 +84,7 @@ namespace disvm · 83 unmodified lines | |||
| 84 | 84 | ||
| 85 | // Begin execution of a child thread in the supplied module at the indicated program counter | 85 | // Begin execution of a child thread in the supplied module at the indicated program counter |
| 86 | const runtime::vm_thread_t& fork( | 86 | const runtime::vm_thread_t& fork( |
| 87 | const runtime::vm_thread_t &parent, | 87 | const uint32_t parent_tid, |
| 88 | runtime::vm_module_ref_t &module_ref, | 88 | runtime::vm_module_ref_t &module_ref, |
| 89 | const runtime::vm_frame_t &initial_frame, | 89 | const runtime::vm_frame_t &initial_frame, |
| 90 | runtime::vm_pc_t initial_pc); | 90 | runtime::vm_pc_t initial_pc); |
| @@ -1584,7 +1584,7 @@ namespace · 1583 unmodified lines | |||
| 1584 | const auto starting_pc = vt_ref<vm_pc_t>(r.dest); | 1584 | const auto starting_pc = vt_ref<vm_pc_t>(r.dest); |
| 1585 | 1585 | ||
| 1586 | assert(r.module_ref != nullptr); | 1586 | assert(r.module_ref != nullptr); |
| 1587 | vm.fork(r.thread, *r.module_ref, *spawned_frame, starting_pc); | 1587 | vm.fork(r.thread.get_thread_id(), *r.module_ref, *spawned_frame, starting_pc); |
| 1588 | 1588 | ||
| 1589 | // After the new thread is forked pop off the argument passing frame. | 1589 | // After the new thread is forked pop off the argument passing frame. |
| 1590 | r.stack.pop_frame(); | 1590 | r.stack.pop_frame(); |
| @@ -1613,7 +1613,7 @@ namespace · 22 unmodified lines | |||
| 1613 | if (target_module_ref->is_builtin_module()) | 1613 | if (target_module_ref->is_builtin_module()) |
| 1614 | throw vm_user_exception{ "Spawning a built-in module is not permitted" }; | 1614 | throw vm_user_exception{ "Spawning a built-in module is not permitted" }; |
| 1615 | 1615 | ||
| 1616 | vm.fork(r.thread, *target_module_ref, *spawned_frame, function_ref.entry_pc); | 1616 | vm.fork(r.thread.get_thread_id(), *target_module_ref, *spawned_frame, function_ref.entry_pc); |
| 1617 | 1617 | ||
| 1618 | // After the new thread is forked pop off the argument passing frame. | 1618 | // After the new thread is forked pop off the argument passing frame. |
| 1619 | r.stack.pop_frame(); | 1619 | r.stack.pop_frame(); |
| @@ -104,7 +104,7 @@ const runtime::vm_thread_t& vm_t::exec(std::unique_ptr<runtime::vm_module_t> ent · 103 unmodified lines | |||
| 104 | } | 104 | } |
| 105 | 105 | ||
| 106 | const runtime::vm_thread_t& vm_t::fork( | 106 | const runtime::vm_thread_t& vm_t::fork( |
| 107 | const runtime::vm_thread_t &parent, | 107 | const uint32_t parent_tid, |
| 108 | runtime::vm_module_ref_t &module_ref, | 108 | runtime::vm_module_ref_t &module_ref, |
| 109 | const runtime::vm_frame_t &initial_frame, | 109 | const runtime::vm_frame_t &initial_frame, |
| 110 | runtime::vm_pc_t initial_pc) | 110 | runtime::vm_pc_t initial_pc) |
| @@ -112,7 +112,7 @@ const runtime::vm_thread_t& vm_t::fork( · 1 unmodified line | |||
| 112 | if (initial_pc < 0 || static_cast<vm_pc_t>(module_ref.code_section.size()) <= initial_pc) | 112 | if (initial_pc < 0 || static_cast<vm_pc_t>(module_ref.code_section.size()) <= initial_pc) |
| 113 | throw vm_system_exception{ "Invalid entry program counter" }; | 113 | throw vm_system_exception{ "Invalid entry program counter" }; |
| 114 | 114 | ||
| 115 | auto thread = std::make_unique<vm_thread_t>(module_ref, parent.get_thread_id(), initial_frame, initial_pc); | 115 | auto thread = std::make_unique<vm_thread_t>(module_ref, parent_tid, initial_frame, initial_pc); |
| 116 | return schedule_thread(std::move(thread)); | 116 | return schedule_thread(std::move(thread)); |
| 117 | } | 117 | } |
| 118 | 118 | ||