cell slot_visitor<Fixup>::visit_pointer(cell pointer) { if (immediate_p(pointer)) return pointer; object* untagged = fixup.fixup_data(untag<object>(pointer)); return RETAG(untagged, TAG(pointer)); }
cell slot_visitor<Visitor>::visit_pointer(cell pointer) { if(immediate_p(pointer)) return pointer; object *untagged = untag<object>(pointer); untagged = visitor(untagged); return RETAG(untagged,TAG(pointer)); }
void operator()(instruction_operand op) { cell old_offset = op.rel_offset() + (cell)old_address->entry_point(); switch(op.rel_type()) { case RT_LITERAL: { cell value = op.load_value(old_offset); if(immediate_p(value)) op.store_value(value); else op.store_value(RETAG(fixup.fixup_data(untag<object>(value)),TAG(value))); break; } case RT_ENTRY_POINT: case RT_ENTRY_POINT_PIC: case RT_ENTRY_POINT_PIC_TAIL: case RT_HERE: { cell value = op.load_value(old_offset); cell offset = TAG(value); code_block *compiled = (code_block *)UNTAG(value); op.store_value((cell)fixup.fixup_code(compiled) + offset); break; } case RT_THIS: case RT_CARDS_OFFSET: case RT_DECKS_OFFSET: parent->store_external_address(op); break; default: op.store_value(op.load_value(old_offset)); break; } }
inline static cell tag_dynamic(object *value) { return RETAG(value,tag_for(value->h.hi_tag())); }
template <typename TYPE> cell tag(TYPE *value) { return RETAG(value,tag_for(TYPE::type_number)); }
inline static cell tag_dynamic(object *value) { return RETAG(value,value->type()); }
template<typename Type> cell tag(Type *value) { return RETAG(value,Type::type_number); }
inline static cell tag_fixnum(fixnum untagged) { return RETAG(untagged << TAG_BITS,FIXNUM_TYPE); }