Showing the changes to src/vm/execution_table.cpp (1 of 14 files). Show all
Unified · Split
| @@ -1750,12 +1750,13 @@ namespace · 1749 unmodified lines | |||
| 1750 | dec_ref_count_and_free(at_val<vm_alloc_t>(r.dest)); | 1750 | dec_ref_count_and_free(at_val<vm_alloc_t>(r.dest)); |
| 1751 | pt_ref(r.dest) = nullptr; | 1751 | pt_ref(r.dest) = nullptr; |
| 1752 | 1752 | ||
| 1753 | auto imported_module = std::shared_ptr<const vm_module_t>{}; | 1753 | auto imported_module = std::shared_ptr<vm_module_t>{}; |
| 1754 | 1754 | ||
| 1755 | // Handle self loading module optimization. | 1755 | // Handle self loading module optimization. |
| 1756 | if (std::strcmp(str->str(), "$self") == 0) | 1756 | if (std::strcmp(str->str(), "$self") == 0) |
| 1757 | { | 1757 | { |
| 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); | ||
| 1759 | } | 1760 | } |
| 1760 | else | 1761 | else |
| 1761 | { | 1762 | { |
| @@ -1779,6 +1780,11 @@ namespace · 17 unmodified lines | |||
| 1779 | 1780 | ||
| 1780 | auto entry_module_ref = new vm_module_ref_t{ imported_module, function_imports }; | 1781 | auto entry_module_ref = new vm_module_ref_t{ imported_module, function_imports }; |
| 1781 | pt_ref(r.dest) = entry_module_ref->get_allocation(); | 1782 | 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); | ||
| 1782 | } | 1788 | } |
| 1783 | } | 1789 | } |
| 1784 | 1790 | ||