History

Debugger supports breakpoints (set/clear/list) Clean up usage of final and override on various classes Distinguish tool events for vm loading module and thread loading module

arr committed 10 years ago

Commit e2f8e251 parent d8c9a3314 files · +382 −177Browse files

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

Unified · Split

src/vm/execution_table.cpp+8−2
@@ -1750,12 +1750,13 @@ namespace · 1749 unmodified lines
17501750 dec_ref_count_and_free(at_val<vm_alloc_t>(r.dest));
17511751 pt_ref(r.dest) = nullptr;
17521752
1753− auto imported_module = std::shared_ptr<const vm_module_t>{};
1753+ auto imported_module = std::shared_ptr<vm_module_t>{};
17541754
17551755 // Handle self loading module optimization.
17561756 if (std::strcmp(str->str(), "$self") == 0)
17571757 {
1758− imported_module = r.module_ref->module;
1758+ // Remove 'const' from the module type in the shared_ptr<>
1759+ imported_module = std::const_pointer_cast<vm_module_t>(r.module_ref->module);
17591760 }
17601761 else
17611762 {
@@ -1779,6 +1780,11 @@ namespace · 17 unmodified lines
17791780
17801781 auto entry_module_ref = new vm_module_ref_t{ imported_module, function_imports };
17811782 pt_ref(r.dest) = entry_module_ref->get_allocation();
1783+
1784+ // Check if the tool dispatcher has been supplied
1785+ auto tool_dispatch = r.tool_dispatch.load();
1786+ if (tool_dispatch != nullptr)
1787+ tool_dispatch->on_module_thread_load(r, imported_module);
17821788 }
17831789 }
17841790