History

Alter debugger API to accept vector value not reference.

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

arr committed 9 years ago

Commit cc8f2b61 parent 41616d412 files · +167 −250Browse files

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

Unified · Split

src/vm/execution_table.cpp+6−12
@@ -206,8 +206,7 @@ namespace · 205 unmodified lines
206206 assert(len <= buffer.size());
207207
208208 auto new_string = new vm_string_t{ len, reinterpret_cast<uint8_t *>(buffer.data()) };
209− auto prev = at_val<vm_alloc_t>(r.dest);
210− dec_ref_count_and_free(prev);
209+ dec_ref_count_and_free(at_val<vm_alloc_t>(r.dest));
211210
212211 pt_ref(r.dest) = new_string->get_allocation();
213212 }
@@ -232,9 +231,7 @@ namespace · 18 unmodified lines
232231 assert(len <= buffer.size());
233232
234233 auto new_string = new vm_string_t{ len, reinterpret_cast<uint8_t *>(buffer.data()) };
235−
236− auto prev = at_val<vm_alloc_t>(r.dest);
237− dec_ref_count_and_free(prev);
234+ dec_ref_count_and_free(at_val<vm_alloc_t>(r.dest));
238235
239236 pt_ref(r.dest) = new_string->get_allocation();
240237 }
@@ -259,9 +256,7 @@ namespace · 18 unmodified lines
259256 assert(len <= buffer.size());
260257
261258 auto new_string = new vm_string_t{ len, reinterpret_cast<uint8_t *>(buffer.data()) };
262−
263− auto prev = at_val<vm_alloc_t>(r.dest);
264− dec_ref_count_and_free(prev);
259+ dec_ref_count_and_free(at_val<vm_alloc_t>(r.dest));
265260
266261 pt_ref(r.dest) = new_string->get_allocation();
267262 }
@@ -513,8 +508,6 @@ namespace · 245 unmodified lines
513508 void _mov_<vm_alloc_t>(pointer_t dest, pointer_t src, const type_descriptor_t *)
514509 {
515510 auto alloc_prev = at_val<vm_alloc_t>(dest);
516− dec_ref_count_and_free(alloc_prev);
517−
518511 auto alloc = at_val<vm_alloc_t>(src);
519512 if (alloc != nullptr)
520513 {
@@ -525,6 +518,8 @@ namespace · 4 unmodified lines
525518 {
526519 pt_ref(dest) = nullptr;
527520 }
521+
522+ dec_ref_count_and_free(alloc_prev);
528523 }
529524
530525 EXEC_DECL(movb) { _mov_<byte_t>(r.dest, r.src, nullptr); }
@@ -1729,8 +1724,7 @@ namespace · 1198 unmodified lines
17291724 auto exception_destination = reinterpret_cast<pointer_t>(frame_pointer + handler->exception_offset);
17301725
17311726 // Destroy any data at this location.
1732− auto current_value = at_val<vm_alloc_t>(exception_destination);
1733− dec_ref_count_and_free(current_value);
1727+ dec_ref_count_and_free(at_val<vm_alloc_t>(exception_destination));
17341728
17351729 // Set the exception destination.
17361730 pt_ref(exception_destination) = e->get_allocation();