Showing the changes to src/vm/module_ref.cpp (1 of 31 files). Show all
Unified · Split
| @@ -10,8 +10,22 @@ · 9 unmodified lines | |||
| 10 | #include <utils.h> | 10 | #include <utils.h> |
| 11 | #include <debug.h> | 11 | #include <debug.h> |
| 12 | 12 | ||
| 13 | using namespace disvm; | 13 | using disvm::debug::component_trace_t; |
| 14 | using namespace disvm::runtime; | 14 | using disvm::debug::log_level_t; |
| 15 | |||
| 16 | using disvm::runtime::type_descriptor_t; | ||
| 17 | using disvm::runtime::intrinsic_type_desc; | ||
| 18 | using disvm::runtime::byte_t; | ||
| 19 | using disvm::runtime::word_t; | ||
| 20 | using disvm::runtime::vm_array_t; | ||
| 21 | using disvm::runtime::vm_string_t; | ||
| 22 | using disvm::runtime::vm_module_t; | ||
| 23 | using disvm::runtime::vm_module_ref_t; | ||
| 24 | using disvm::runtime::export_section_t; | ||
| 25 | using disvm::runtime::import_vm_module_t; | ||
| 26 | using disvm::runtime::vm_module_function_ref_t; | ||
| 27 | using disvm::runtime::vm_system_exception; | ||
| 28 | using disvm::runtime::vm_user_exception; | ||
| 15 | 29 | ||
| 16 | namespace | 30 | namespace |
| 17 | { | 31 | { |
| @@ -47,11 +61,11 @@ namespace · 29 unmodified lines | |||
| 47 | ref.entry_pc = export_entry.pc; | 61 | ref.entry_pc = export_entry.pc; |
| 48 | ref.frame_type = export_entry.frame_type; | 62 | ref.frame_type = export_entry.frame_type; |
| 49 | 63 | ||
| 50 | if (debug::is_component_tracing_enabled<debug::component_trace_t::module>()) | 64 | if (disvm::debug::is_component_tracing_enabled<component_trace_t::module>()) |
| 51 | { | 65 | { |
| 52 | debug::log_msg( | 66 | disvm::debug::log_msg( |
| 53 | debug::component_trace_t::module, | 67 | component_trace_t::module, |
| 54 | debug::log_level_t::debug, | 68 | log_level_t::debug, |
| 55 | "export: %d %#08x >>%s<<", | 69 | "export: %d %#08x >>%s<<", |
| 56 | index, | 70 | index, |
| 57 | export_entry.sig, | 71 | export_entry.sig, |
| @@ -79,8 +93,8 @@ vm_module_ref_t::vm_module_ref_t(std::shared_ptr<const vm_module_t> module) · 21 unmodified lines | |||
| 79 | if (module->original_mp != nullptr) | 93 | if (module->original_mp != nullptr) |
| 80 | mp_base = vm_alloc_t::copy(*module->original_mp); | 94 | mp_base = vm_alloc_t::copy(*module->original_mp); |
| 81 | 95 | ||
| 82 | if (debug::is_component_tracing_enabled<debug::component_trace_t::memory>()) | 96 | if (disvm::debug::is_component_tracing_enabled<component_trace_t::memory>()) |
| 83 | debug::log_msg(debug::component_trace_t::memory, debug::log_level_t::debug, "init: vm module ref"); | 97 | disvm::debug::log_msg(component_trace_t::memory, log_level_t::debug, "init: vm module ref"); |
| 84 | } | 98 | } |
| 85 | 99 | ||
| 86 | vm_module_ref_t::vm_module_ref_t(std::shared_ptr<const vm_module_t> module, const import_vm_module_t &imports) | 100 | vm_module_ref_t::vm_module_ref_t(std::shared_ptr<const vm_module_t> module, const import_vm_module_t &imports) |
| @@ -97,8 +111,8 @@ vm_module_ref_t::vm_module_ref_t(std::shared_ptr<const vm_module_t> module, cons · 10 unmodified lines | |||
| 97 | if (module->original_mp != nullptr) | 111 | if (module->original_mp != nullptr) |
| 98 | mp_base = vm_alloc_t::copy(*module->original_mp); | 112 | mp_base = vm_alloc_t::copy(*module->original_mp); |
| 99 | 113 | ||
| 100 | if (debug::is_component_tracing_enabled<debug::component_trace_t::memory>()) | 114 | if (disvm::debug::is_component_tracing_enabled<component_trace_t::memory>()) |
| 101 | debug::log_msg(debug::component_trace_t::memory, debug::log_level_t::debug, "init: vm module ref: exported %d", _function_refs->get_length()); | 115 | disvm::debug::log_msg(component_trace_t::memory, log_level_t::debug, "init: vm module ref: exported %d", _function_refs->get_length()); |
| 102 | } | 116 | } |
| 103 | 117 | ||
| 104 | vm_module_ref_t::~vm_module_ref_t() | 118 | vm_module_ref_t::~vm_module_ref_t() |
| @@ -108,8 +122,8 @@ vm_module_ref_t::~vm_module_ref_t() · 3 unmodified lines | |||
| 108 | if (_function_refs != nullptr) | 122 | if (_function_refs != nullptr) |
| 109 | _function_refs->release(); | 123 | _function_refs->release(); |
| 110 | 124 | ||
| 111 | if (debug::is_component_tracing_enabled<debug::component_trace_t::memory>()) | 125 | if (disvm::debug::is_component_tracing_enabled<component_trace_t::memory>()) |
| 112 | debug::log_msg(debug::component_trace_t::memory, debug::log_level_t::debug, "destroy: vm module ref"); | 126 | disvm::debug::log_msg(component_trace_t::memory, log_level_t::debug, "destroy: vm module ref"); |
| 113 | } | 127 | } |
| 114 | 128 | ||
| 115 | bool vm_module_ref_t::is_builtin_module() const | 129 | bool vm_module_ref_t::is_builtin_module() const |