Remove global memory lock mechanism - Wasn't being used but showed up on profile report :( Move enum_pointer_fields and is_offset_pointer impls into cpp file Create enum_pointer_fields_with_offset function since the VM never needs the offset values and the generated code was about 5% bigger. Now the VM can use the callback without the offset. Removed pointless init_memory() usage since alloc_memory() now is required to return zeroed out memory. Fixed bugs in GC Added support - Ranged absolute disassembly in debugger - New duration log component
Showing the changes to src/vm/array.cpp (1 of 12 files). Show all
Unified · Split
| @@ -29,18 +29,7 @@ vm_array_t::vm_array_t(std::shared_ptr<const type_descriptor_t> td, word_t lengt · 28 unmodified lines | ||
| 29 | 29 | _arr = alloc_memory<byte_t>(_length * _element_type->size_in_bytes); |
| 30 | 30 | debug::log_msg(debug::component_trace_t::memory, debug::log_level_t::debug, "init: vm array: %d", _length); |
| 31 | 31 | |
| 32 | − // Initialize the array | |
| 33 | − auto arr_local = _arr; | |
| 34 | − const auto array_len = _length; | |
| 35 | − const auto &element_type = *_element_type; | |
| 36 | − debug::log_msg(debug::component_trace_t::memory, debug::log_level_t::debug, "begin: init: elements: %d", array_len); | |
| 37 | − for (word_t i = 0; i < array_len; ++i) | |
| 38 | − { | |
| 39 | − init_memory(element_type, arr_local); | |
| 40 | − arr_local += element_type.size_in_bytes; | |
| 41 | − } | |
| 42 | − | |
| 43 | − debug::log_msg(debug::component_trace_t::memory, debug::log_level_t::debug, "end: init: elements: %d", array_len); | |
| 32 | + // [SPEC] Element memory is already initialized to zero based on the alloc_memory contract | |
| 44 | 33 | } |
| 45 | 34 | |
| 46 | 35 | vm_array_t::vm_array_t(vm_array_t &original, word_t begin_index, word_t length) |