Showing the changes to src/vm/execution_table.cpp (1 of 10 files). Show all
Unified · Split
| @@ -509,16 +509,14 @@ namespace · 508 unmodified lines | ||
| 509 | 509 | { |
| 510 | 510 | auto alloc_prev = at_val<vm_alloc_t>(dest); |
| 511 | 511 | auto alloc = at_val<vm_alloc_t>(src); |
| 512 | + pointer_t to_move = nullptr; | |
| 512 | 513 | if (alloc != nullptr) |
| 513 | 514 | { |
| 514 | 515 | alloc->add_ref(); |
| 515 | − pt_ref(dest) = alloc->get_allocation(); | |
| 516 | − } | |
| 517 | − else | |
| 518 | − { | |
| 519 | − pt_ref(dest) = nullptr; | |
| 516 | + to_move = alloc->get_allocation(); | |
| 520 | 517 | } |
| 521 | 518 | |
| 519 | + pt_ref(dest) = to_move; | |
| 522 | 520 | dec_ref_count_and_free(alloc_prev); |
| 523 | 521 | } |
| 524 | 522 | |
| @@ -531,7 +529,6 @@ namespace · 6 unmodified lines | ||
| 531 | 529 | EXEC_DECL(movm) |
| 532 | 530 | { |
| 533 | 531 | assert(r.src != nullptr && r.dest != nullptr); |
| 534 | − | |
| 535 | 532 | std::memmove(r.dest, r.src, vt_ref<word_t>(r.mid)); |
| 536 | 533 | } |
| 537 | 534 | |
| @@ -1087,9 +1084,11 @@ namespace · 549 unmodified lines | ||
| 1087 | 1084 | } |
| 1088 | 1085 | |
| 1089 | 1086 | dec_ref_count_and_free(at_val<vm_alloc_t>(r.dest)); |
| 1090 | − auto new_channel = new vm_channel_t{ type_desc, transfer, buffer_len }; | |
| 1091 | 1087 | |
| 1092 | − if (type_desc->map_in_bytes > 0) | |
| 1088 | + const auto track_object = type_desc->map_in_bytes > 0; | |
| 1089 | + auto new_channel = new vm_channel_t{ std::move(type_desc), transfer, buffer_len }; | |
| 1090 | + | |
| 1091 | + if (track_object) | |
| 1093 | 1092 | vm.get_garbage_collector().track_allocation(new_channel); |
| 1094 | 1093 | |
| 1095 | 1094 | pt_ref(r.dest) = new_channel->get_allocation(); |
| @@ -1107,7 +1106,7 @@ namespace · 11 unmodified lines | ||
| 1107 | 1106 | auto memory_size = vt_ref<word_t>(r.src); |
| 1108 | 1107 | auto channel_data_type = type_descriptor_t::create(memory_size); |
| 1109 | 1108 | |
| 1110 | − _newc_(r, vm, channel_data_type, _channel_movm); | |
| 1109 | + _newc_(r, vm, std::move(channel_data_type), _channel_movm); | |
| 1111 | 1110 | } |
| 1112 | 1111 | |
| 1113 | 1112 | EXEC_DECL(newcmp) |
| @@ -1117,7 +1116,7 @@ namespace · 3 unmodified lines | ||
| 1117 | 1116 | assert(0 <= type_id && type_id < static_cast<word_t>(types.size())); |
| 1118 | 1117 | auto type = types[type_id]; |
| 1119 | 1118 | |
| 1120 | − _newc_(r, vm, type, _channel_movmp); | |
| 1119 | + _newc_(r, vm, std::move(type), _channel_movmp); | |
| 1121 | 1120 | } |
| 1122 | 1121 | |
| 1123 | 1122 | EXEC_DECL(send) |
| @@ -1440,7 +1439,7 @@ namespace · 316 unmodified lines | ||
| 1440 | 1439 | assert(0 <= frame_type_id && frame_type_id < static_cast<word_t>(types.size())); |
| 1441 | 1440 | const auto frame_type = types[frame_type_id]; |
| 1442 | 1441 | |
| 1443 | − pt_ref(r.dest) = r.stack.alloc_frame(frame_type)->base(); | |
| 1442 | + pt_ref(r.dest) = r.stack.alloc_frame(std::move(frame_type))->base(); | |
| 1444 | 1443 | } |
| 1445 | 1444 | |
| 1446 | 1445 | EXEC_DECL(mframe) |
| @@ -1500,7 +1499,8 @@ namespace · 53 unmodified lines | ||
| 1500 | 1499 | |
| 1501 | 1500 | r.next_pc = vt_ref<vm_pc_t>(r.dest); |
| 1502 | 1501 | |
| 1503 | − disvm::debug::log_msg(debug::component_trace_t::stack, debug::log_level_t::debug, "enter: function"); | |
| 1502 | + if (disvm::debug::is_component_tracing_enabled<debug::component_trace_t::stack>()) | |
| 1503 | + disvm::debug::log_msg(debug::component_trace_t::stack, debug::log_level_t::debug, "enter: function"); | |
| 1504 | 1504 | } |
| 1505 | 1505 | |
| 1506 | 1506 | EXEC_DECL(mcall) |