History

Altered API getting the allocation from a vm_alloc_t. Added preliminary internal file descriptor type. Test groups now print out their name.

arr committed 10 years ago

Commit 5a417ba1 parent 9881f459 files · +230 −104Browse files

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

Unified · Split

src/vm/execution_table.cpp+23−23
@@ -152,7 +152,7 @@ namespace · 151 unmodified lines
152152
153153 auto str = at_val<vm_string_t>(r.src);
154154 auto new_array = new vm_array_t(str);
155− pt_ref(r.dest) = new_array->allocation();
155+ pt_ref(r.dest) = new_array->get_allocation();
156156 }
157157
158158 EXEC_DECL(cvtac)
@@ -167,7 +167,7 @@ namespace · 8 unmodified lines
167167 throw vm_user_exception{ "Invalid array element type for string conversion" };
168168
169169 auto new_string = new vm_string_t(arr->get_length(), reinterpret_cast<uint8_t *>(arr->at(0)));
170− str = new_string->allocation();
170+ str = new_string->get_allocation();
171171 }
172172
173173 pt_ref(r.dest) = str;
@@ -196,7 +196,7 @@ namespace · 22 unmodified lines
196196 auto str = at_val<vm_string_t>(r.dest);
197197 dec_ref_count_and_free(str);
198198
199− pt_ref(r.dest) = new_string->allocation();
199+ pt_ref(r.dest) = new_string->get_allocation();
200200 }
201201
202202 EXEC_DECL(cvtcf)
@@ -221,7 +221,7 @@ namespace · 18 unmodified lines
221221 auto new_string = new vm_string_t(len, reinterpret_cast<uint8_t *>(buffer.data()));
222222
223223 auto str = at_val<vm_string_t>(r.dest);
224− pt_ref(r.dest) = new_string->allocation();
224+ pt_ref(r.dest) = new_string->get_allocation();
225225 dec_ref_count_and_free(str);
226226 }
227227
@@ -247,7 +247,7 @@ namespace · 19 unmodified lines
247247 auto new_string = new vm_string_t(len, reinterpret_cast<uint8_t *>(buffer.data()));
248248
249249 auto str = at_val<vm_string_t>(r.dest);
250− pt_ref(r.dest) = new_string->allocation();
250+ pt_ref(r.dest) = new_string->get_allocation();
251251 dec_ref_count_and_free(str);
252252 }
253253
@@ -399,7 +399,7 @@ namespace · 145 unmodified lines
399399 if (alloc != nullptr)
400400 {
401401 alloc->add_ref();
402− pt_ref(dest) = alloc->allocation();
402+ pt_ref(dest) = alloc->get_allocation();
403403 }
404404 else
405405 {
@@ -626,7 +626,7 @@ namespace · 220 unmodified lines
626626 auto old_str = at_val<vm_string_t>(r.dest);
627627 if (str != old_str)
628628 {
629− pt_ref(r.dest) = str->allocation();
629+ pt_ref(r.dest) = str->get_allocation();
630630 dec_ref_count_and_free(old_str);
631631 }
632632 }
@@ -678,7 +678,7 @@ namespace · 45 unmodified lines
678678
679679 if (!append_to_source)
680680 {
681− pt_ref(r.dest) = str->allocation();
681+ pt_ref(r.dest) = str->get_allocation();
682682 dec_ref_count_and_free(dest_maybe);
683683 }
684684 }
@@ -692,7 +692,7 @@ namespace · 7 unmodified lines
692692 if (str != nullptr)
693693 {
694694 auto new_string = new vm_string_t(*str, start, end);
695− pt_ref(r.dest) = new_string->allocation();
695+ pt_ref(r.dest) = new_string->get_allocation();
696696 }
697697 else if (start == 0 && end == 0)
698698 {
@@ -744,7 +744,7 @@ namespace · 45 unmodified lines
744744 if (arr->alloc_type->map_in_bytes > 0)
745745 vm.get_garbage_collector().track_allocation(new_array);
746746
747− pt_ref(r.dest) = new_array->allocation();
747+ pt_ref(r.dest) = new_array->get_allocation();
748748 }
749749
750750 EXEC_DECL(slicela)
@@ -810,7 +810,7 @@ namespace · 59 unmodified lines
810810 auto value = vt_ref<PrimitiveType>(r.src);
811811 vt_ref<PrimitiveType>(new_list->value()) = value;
812812
813− pt_ref(r.dest) = new_list->allocation();
813+ pt_ref(r.dest) = new_list->get_allocation();
814814 }
815815
816816 EXEC_DECL(consb) { _cons<byte_t>(r); }
@@ -830,7 +830,7 @@ namespace · 13 unmodified lines
830830 if (alloc != nullptr)
831831 {
832832 alloc->add_ref();
833− pt_ref(new_list->value()) = alloc->allocation();
833+ pt_ref(new_list->value()) = alloc->get_allocation();
834834
835835 vm.get_garbage_collector().track_allocation(new_list);
836836 }
@@ -840,7 +840,7 @@ namespace · 3 unmodified lines
840840 }
841841
842842 // Return the list
843− pt_ref(r.dest) = new_list->allocation();
843+ pt_ref(r.dest) = new_list->get_allocation();
844844 }
845845
846846 EXEC_DECL(consmp)
@@ -866,7 +866,7 @@ namespace · 19 unmodified lines
866866 vm.get_garbage_collector().track_allocation(new_list);
867867
868868 // Return the list
869− pt_ref(r.dest) = new_list->allocation();
869+ pt_ref(r.dest) = new_list->get_allocation();
870870 }
871871
872872 template<typename PrimitiveType>
@@ -917,7 +917,7 @@ namespace · 44 unmodified lines
917917
918918 auto tail_maybe = list->get_tail();
919919 if (tail_maybe != nullptr)
920− tail = tail_maybe->allocation();
920+ tail = tail_maybe->get_allocation();
921921
922922 // Use the address of the local variable.
923923 r.src = reinterpret_cast<pointer_t>(&tail);
@@ -973,7 +973,7 @@ namespace · 49 unmodified lines
973973 if (type_desc->map_in_bytes > 0)
974974 vm.get_garbage_collector().track_allocation(new_channel);
975975
976− pt_ref(r.dest) = new_channel->allocation();
976+ pt_ref(r.dest) = new_channel->get_allocation();
977977 }
978978 }
979979
@@ -1061,7 +1061,7 @@ namespace · 81 unmodified lines
10611061
10621062 word_t cancel_outstanding_channel_requests(uint32_t request_thread_id, vm_alt_stack_layout_t *alt, const vm_channel_t &handled_channel)
10631063 {
1064− auto alloc = handled_channel.allocation();
1064+ auto alloc = handled_channel.get_allocation();
10651065
10661066 auto handled_index = word_t{ -1 };
10671067 const auto channel_count = (alt->send_count + alt->receive_count);
@@ -1216,7 +1216,7 @@ namespace · 148 unmodified lines
12161216 if (type_desc->map_in_bytes > 0)
12171217 vm.get_garbage_collector().track_allocation(new_alloc);
12181218
1219− pt_ref(r.dest) = new_alloc->allocation();
1219+ pt_ref(r.dest) = new_alloc->get_allocation();
12201220 }
12211221 }
12221222
@@ -1248,7 +1248,7 @@ namespace · 25 unmodified lines
12481248 if (type_desc->map_in_bytes > 0)
12491249 vm.get_garbage_collector().track_allocation(new_alloc);
12501250
1251− pt_ref(r.dest) = new_alloc->allocation();
1251+ pt_ref(r.dest) = new_alloc->get_allocation();
12521252 }
12531253
12541254 namespace
@@ -1270,7 +1270,7 @@ namespace · 15 unmodified lines
12701270 if (type_desc->map_in_bytes > 0)
12711271 vm.get_garbage_collector().track_allocation(new_array);
12721272
1273− pt_ref(r.dest) = new_array->allocation();
1273+ pt_ref(r.dest) = new_array->get_allocation();
12741274 }
12751275 }
12761276
@@ -1535,7 +1535,7 @@ namespace · 258 unmodified lines
15351535 // The first pointer in the exception is a string type
15361536 // that is used to uniquely identify the exception type.
15371537 // The remainder of the type is user-defined.
1538− auto content = e->allocation();
1538+ auto content = e->get_allocation();
15391539 exception_id = at_val<vm_string_t>(content);
15401540
15411541 if (debug::is_component_tracing_enabled<debug::component_trace_t::exception>())
@@ -1580,7 +1580,7 @@ namespace · 38 unmodified lines
15801580 dec_ref_count_and_free(current_value);
15811581
15821582 // Set the exception destination.
1583− pt_ref(exception_destination) = e->allocation();
1583+ pt_ref(exception_destination) = e->get_allocation();
15841584
15851585 r.pc = handler_pc;
15861586 }
@@ -1630,7 +1630,7 @@ namespace · 43 unmodified lines
16301630 const auto &function_imports = imports[module_import_index];
16311631
16321632 auto entry_module_ref = new vm_module_ref_t{ imported_module, function_imports };
1633− pt_ref(r.dest) = entry_module_ref->allocation();
1633+ pt_ref(r.dest) = entry_module_ref->get_allocation();
16341634 }
16351635 }
16361636