History

Implemented basic native shell - takes compiled Command modules Defined shell Command module - should be implemented to pass modules to native shell Updated intrinsic type descriptors so they are not allocated on VM load

arr committed 10 years ago

Commit 330522f1 parent 8506dc611 files · +251 −139Browse files

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

Unified · Split

src/vm/execution_table.cpp+6−6
@@ -773,11 +773,11 @@ namespace · 772 unmodified lines
773773 void _cons(vm_registers_t &r)
774774 {
775775 auto tail_maybe = at_val<vm_list_t>(r.dest);
776+ auto new_list = new vm_list_t{ intrinsic_type_desc::type<PrimitiveType>(), tail_maybe };
777+
776778 if (tail_maybe != nullptr)
777779 tail_maybe->release();
778780
779− auto new_list = new vm_list_t{ intrinsic_type_desc::type<PrimitiveType>(), tail_maybe };
780−
781781 auto value = vt_ref<PrimitiveType>(r.src);
782782 vt_ref<PrimitiveType>(new_list->value()) = value;
783783
@@ -792,11 +792,11 @@ namespace · 8 unmodified lines
792792 EXEC_DECL(consp)
793793 {
794794 auto tail_maybe = at_val<vm_list_t>(r.dest);
795− if (tail_maybe != nullptr)
796− tail_maybe->release();
797795
798796 // Create a new list
799797 auto new_list = new vm_list_t{ intrinsic_type_desc::type<pointer_t>(), tail_maybe };
798+ if (tail_maybe != nullptr)
799+ tail_maybe->release();
800800
801801 auto alloc = at_val<vm_alloc_t>(r.src);
802802 if (alloc != nullptr)
@@ -826,11 +826,11 @@ namespace · 23 unmodified lines
826826 inc_ref_count_in_memory(*type, r.src);
827827
828828 auto tail_maybe = at_val<vm_list_t>(r.dest);
829− if (tail_maybe != nullptr)
830− tail_maybe->release();
831829
832830 // Create a new list
833831 auto new_list = new vm_list_t{ type, tail_maybe };
832+ if (tail_maybe != nullptr)
833+ tail_maybe->release();
834834
835835 auto destination = new_list->value();
836836 std::memmove(destination, r.src, type->size_in_bytes);