Ejemplo n.º 1
0
	void operator()(instruction_operand op)
	{
		code_block *compiled = op.parent_code_block();
		cell old_offset = op.rel_offset() + (cell)compiled->entry_point() - code_offset;

		switch(op.rel_type())
		{
		case RT_LITERAL:
			op.store_value(data_visitor.visit_pointer(op.load_value(old_offset)));
			break;
		case RT_ENTRY_POINT:
		case RT_ENTRY_POINT_PIC:
		case RT_ENTRY_POINT_PIC_TAIL:
			op.store_code_block(code_visitor(op.load_code_block(old_offset)));
			break;
		case RT_HERE:
			op.store_value(op.load_value(old_offset) + code_offset);
			break;
		case RT_UNTAGGED:
			break;
		default:
			parent->store_external_address(op);
			break;
		}
	}
Ejemplo n.º 2
0
	void operator()(instruction_operand op)
	{
		relocation_type type = op.rel_type();
		if(type == RT_ENTRY_POINT
			|| type == RT_ENTRY_POINT_PIC
			|| type == RT_ENTRY_POINT_PIC_TAIL)
			op.store_code_block(visitor(op.load_code_block()));
	}