History

Create disvm-asm static lib (Used for working with bytecode) - Convert functions for opcode <--> string Factor out common GYP settings

arr committed 10 years ago

Commit 8f296181 parent f2c6ef310 files · +328 −101Browse files

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

Unified · Split

src/vm/module_reader.cpp+3−3
@@ -1,6 +1,6 @@
1//1//
2// Dis VM2// Dis VM
3// File: loader.cpp3// File: module_loader.cpp
4// Author: arr4// Author: arr
5//5//
6 6
@@ -380,7 +380,7 @@ namespace · 373 unmodified lines
380 auto vm_module_type = modobj.type_section[module_constants::vm_module_type_desc_number];380 auto vm_module_type = modobj.type_section[module_constants::vm_module_type_desc_number];
381 if (vm_module_type->size_in_bytes != modobj.header.data_size) throw module_reader_exception{ "Invalid type desc for MP" };381 if (vm_module_type->size_in_bytes != modobj.header.data_size) throw module_reader_exception{ "Invalid type desc for MP" };
382 382
383 // The Dis VM spec does not guarantee the MP segment (i.e. data segment) of the loaded383 // [SPEC] The Dis VM spec does not guarantee the MP segment (i.e. data segment) of the loaded
384 // module will be initialized to zero, but it is the C/C++ approach so defer to that.384 // module will be initialized to zero, but it is the C/C++ approach so defer to that.
385 modobj.original_mp.reset(vm_alloc_t::allocate(vm_module_type, vm_alloc_t::zero_memory));385 modobj.original_mp.reset(vm_alloc_t::allocate(vm_module_type, vm_alloc_t::zero_memory));
386 }386 }
@@ -652,7 +652,7 @@ namespace · 265 unmodified lines
652 // [SPEC] The operand read above contains two pieces of data.652 // [SPEC] The operand read above contains two pieces of data.
653 // The higher 16-bits represent the number of exception cases that catch exception types.653 // The higher 16-bits represent the number of exception cases that catch exception types.
654 // The lower 16-bits represent the total number of handled cases.654 // The lower 16-bits represent the total number of handled cases.
655 // In the limbo language strings and exceptions can be caught in an exception handler.655 // In the limbo language, strings and exceptions can be caught in an exception handler.
656 // Based on Inferno implementation libinterp/load.c.656 // Based on Inferno implementation libinterp/load.c.
657 handler.exception_type_count = word_t{ handler_cases >> 16 };657 handler.exception_type_count = word_t{ handler_cases >> 16 };
658 const auto total_count = (handler_cases & 0xffff);658 const auto total_count = (handler_cases & 0xffff);