vm: fix 64-bit regression

db4
Slava Pestov 2010-10-09 15:14:14 -07:00
parent a84d7af2c5
commit 813e13140a
3 changed files with 7 additions and 9 deletions

View File

@ -13,7 +13,7 @@ cell gc_info::return_address_index(cell return_address)
return i; return i;
} }
return gc_info_missing_value; return (cell)-1;
} }
} }

View File

@ -1,8 +1,6 @@
namespace factor namespace factor
{ {
const cell gc_info_missing_value = (cell)-1;
struct gc_info { struct gc_info {
u32 scrub_d_count; u32 scrub_d_count;
u32 scrub_r_count; u32 scrub_r_count;
@ -58,7 +56,7 @@ struct gc_info {
+ index * gc_root_count; + index * gc_root_count;
} }
cell lookup_base_pointer(cell index, cell derived_root) u32 lookup_base_pointer(cell index, cell derived_root)
{ {
return base_pointer_map()[index * derived_root_count + derived_root]; return base_pointer_map()[index * derived_root_count + derived_root];
} }

View File

@ -293,7 +293,7 @@ struct call_frame_slot_visitor {
assert(return_address < compiled->size()); assert(return_address < compiled->size());
cell callsite = info->return_address_index(return_address); cell callsite = info->return_address_index(return_address);
if(callsite == gc_info_missing_value) if(callsite == (cell)-1)
return; return;
#ifdef DEBUG_GC_MAPS #ifdef DEBUG_GC_MAPS
@ -305,8 +305,8 @@ struct call_frame_slot_visitor {
/* Subtract old value of base pointer from every derived pointer. */ /* Subtract old value of base pointer from every derived pointer. */
for(cell spill_slot = 0; spill_slot < info->derived_root_count; spill_slot++) for(cell spill_slot = 0; spill_slot < info->derived_root_count; spill_slot++)
{ {
cell base_pointer = info->lookup_base_pointer(callsite, spill_slot); u32 base_pointer = info->lookup_base_pointer(callsite, spill_slot);
if(base_pointer != gc_info_missing_value) if(base_pointer != (u32)-1)
{ {
#ifdef DEBUG_GC_MAPS #ifdef DEBUG_GC_MAPS
std::cout << "visiting derived root " << spill_slot std::cout << "visiting derived root " << spill_slot
@ -334,8 +334,8 @@ struct call_frame_slot_visitor {
/* Add the base pointers to obtain new derived pointer values. */ /* Add the base pointers to obtain new derived pointer values. */
for(cell spill_slot = 0; spill_slot < info->derived_root_count; spill_slot++) for(cell spill_slot = 0; spill_slot < info->derived_root_count; spill_slot++)
{ {
cell base_pointer = info->lookup_base_pointer(callsite, spill_slot); u32 base_pointer = info->lookup_base_pointer(callsite, spill_slot);
if(base_pointer != gc_info_missing_value) if(base_pointer != (u32)-1)
stack_pointer[spill_slot] += stack_pointer[base_pointer]; stack_pointer[spill_slot] += stack_pointer[base_pointer];
} }
} }