VM converts the methods callstack::frame_top_at and code_block::offset to use cells instead of void*'s
parent
615420fe61
commit
af270cb4d8
|
@ -127,8 +127,8 @@ void factor_vm::primitive_set_innermost_stack_frame_quot() {
|
|||
jit_compile_quot(quot.value(), true);
|
||||
|
||||
void* inner = stack->top();
|
||||
void* addr = *(void**)inner;
|
||||
code_block* block = code->code_block_for_address((cell)addr);
|
||||
cell addr = *(cell*)inner;
|
||||
code_block* block = code->code_block_for_address(addr);
|
||||
cell offset = block->offset(addr);
|
||||
*(void**)inner = (char*)quot->entry_point + offset;
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ inline void factor_vm::iterate_callstack_object(callstack* stack_,
|
|||
fixnum frame_offset = 0;
|
||||
|
||||
while (frame_offset < frame_length) {
|
||||
cell frame_top = (cell)stack->frame_top_at(frame_offset);
|
||||
cell frame_top = stack->frame_top_at(frame_offset);
|
||||
cell addr = *(cell*)frame_top;
|
||||
cell fixed_addr = Fixup::translated_code_block_map
|
||||
? (cell)fixup.translate_code((code_block*)addr)
|
||||
|
|
|
@ -40,7 +40,7 @@ template <typename Fixup> struct call_frame_code_block_visitor {
|
|||
void operator()(cell frame_top, cell size, code_block* owner, cell addr) {
|
||||
code_block* compiled =
|
||||
Fixup::translated_code_block_map ? owner : fixup.fixup_code(owner);
|
||||
cell fixed_addr = compiled->address_for_offset(owner->offset((void*)addr));
|
||||
cell fixed_addr = compiled->address_for_offset(owner->offset(addr));
|
||||
|
||||
*(cell*)frame_top = fixed_addr;
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ cell code_block::scan(factor_vm* vm, cell addr) const {
|
|||
if (!obj.type_p(QUOTATION_TYPE))
|
||||
return tag_fixnum(-1);
|
||||
|
||||
cell ofs = offset((void*)addr);
|
||||
cell ofs = offset(addr);
|
||||
return tag_fixnum(vm->quot_code_offset_to_scan(obj.value(), ofs));
|
||||
}
|
||||
|
||||
|
|
|
@ -92,7 +92,7 @@ struct code_block {
|
|||
}
|
||||
}
|
||||
|
||||
cell offset(void* addr) const { return (char*)addr - (char*)entry_point(); }
|
||||
cell offset(cell addr) const { return addr - (cell)entry_point(); }
|
||||
|
||||
cell address_for_offset(cell offset) const {
|
||||
return (cell)((char*)entry_point() + offset);
|
||||
|
|
|
@ -305,8 +305,8 @@ struct callstack : public object {
|
|||
/* tagged */
|
||||
cell length;
|
||||
|
||||
void* frame_top_at(cell offset) const {
|
||||
return (void*)((char*)(this + 1) + offset);
|
||||
cell frame_top_at(cell offset) const {
|
||||
return (cell)(this + 1) + offset;
|
||||
}
|
||||
|
||||
void* top() const { return (void*)(this + 1); }
|
||||
|
|
|
@ -295,7 +295,7 @@ template <typename Fixup> struct call_frame_slot_visitor {
|
|||
[size]
|
||||
*/
|
||||
void operator()(cell frame_top, cell size, code_block* owner, cell addr) {
|
||||
cell return_address = owner->offset((void*)addr);
|
||||
cell return_address = owner->offset(addr);
|
||||
|
||||
code_block* compiled =
|
||||
Fixup::translated_code_block_map ? owner
|
||||
|
|
Loading…
Reference in New Issue