本文整理汇总了C++中instruction_operand::rel_type方法的典型用法代码示例。如果您正苦于以下问题:C++ instruction_operand::rel_type方法的具体用法?C++ instruction_operand::rel_type怎么用?C++ instruction_operand::rel_type使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类instruction_operand
的用法示例。
在下文中一共展示了instruction_operand::rel_type方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: operator
void operator()(instruction_operand op)
{
switch(op.rel_type())
{
case RT_XT:
{
code_block *compiled = op.load_code_block();
cell owner = compiled->owner;
if(to_boolean(owner)) op.store_value(parent->compute_xt_address(owner));
break;
}
case RT_XT_PIC:
{
code_block *compiled = op.load_code_block();
cell owner = parent->code_block_owner(compiled);
if(to_boolean(owner)) op.store_value(parent->compute_xt_pic_address(owner));
break;
}
case RT_XT_PIC_TAIL:
{
code_block *compiled = op.load_code_block();
cell owner = parent->code_block_owner(compiled);
if(to_boolean(owner)) op.store_value(parent->compute_xt_pic_tail_address(owner));
break;
}
default:
break;
}
}
示例2: operator
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;
}
}
示例3: store_external_address
void factor_vm::store_external_address(instruction_operand op)
{
code_block *compiled = op.compiled;
array *parameters = (to_boolean(compiled->parameters) ? untag<array>(compiled->parameters) : NULL);
cell index = op.index;
switch(op.rel_type())
{
case RT_DLSYM:
op.store_value(compute_dlsym_address(parameters,index));
break;
case RT_THIS:
op.store_value((cell)compiled->entry_point());
break;
case RT_MEGAMORPHIC_CACHE_HITS:
op.store_value((cell)&dispatch_stats.megamorphic_cache_hits);
break;
case RT_VM:
op.store_value(compute_vm_address(array_nth(parameters,index)));
break;
case RT_CARDS_OFFSET:
op.store_value(cards_offset);
break;
case RT_DECKS_OFFSET:
op.store_value(decks_offset);
break;
#ifdef WINDOWS
case RT_EXCEPTION_HANDLER:
op.store_value((cell)&factor::exception_handler);
break;
#endif
#ifdef FACTOR_PPC
case RT_DLSYM_TOC:
op.store_value(compute_dlsym_toc_address(parameters,index));
break;
#endif
case RT_INLINE_CACHE_MISS:
op.store_value((cell)&factor::inline_cache_miss);
break;
case RT_SAFEPOINT:
op.store_value((cell)code->safepoint_page);
break;
default:
critical_error("Bad rel type in store_external_address()",op.rel_type());
break;
}
}
示例4: operator
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()));
}
示例5: operator
void operator()(instruction_operand op)
{
if(op.rel_type() == RT_DLSYM && op.pointer <= return_address)
{
code_block *compiled = op.compiled;
array *parameters = untag<array>(compiled->parameters);
cell index = op.index;
symbol = array_nth(parameters,index);
library = array_nth(parameters,index + 1);
}
}
示例6: store_external_address
void factor_vm::store_external_address(instruction_operand op)
{
code_block *compiled = op.parent_code_block();
array *parameters = (to_boolean(compiled->parameters) ? untag<array>(compiled->parameters) : NULL);
cell index = op.parameter_index();
switch(op.rel_type())
{
case RT_PRIMITIVE:
op.store_value(compute_primitive_address(array_nth(parameters,index)));
break;
case RT_DLSYM:
op.store_value(compute_dlsym_address(parameters,index));
break;
case RT_THIS:
op.store_value((cell)compiled->xt());
break;
case RT_CONTEXT:
op.store_value(compute_context_address());
break;
case RT_MEGAMORPHIC_CACHE_HITS:
op.store_value((cell)&dispatch_stats.megamorphic_cache_hits);
break;
case RT_VM:
op.store_value(compute_vm_address(array_nth(parameters,index)));
break;
case RT_CARDS_OFFSET:
op.store_value(cards_offset);
break;
case RT_DECKS_OFFSET:
op.store_value(decks_offset);
break;
default:
critical_error("Bad rel type",op.rel_type());
break;
}
}
示例7: operator
void operator()(instruction_operand op)
{
switch(op.rel_type())
{
case RT_ENTRY_POINT:
{
code_block *compiled = op.load_code_block();
cell owner = compiled->owner;
if(to_boolean(owner))
op.store_value(parent->compute_entry_point_address(owner));
break;
}
case RT_ENTRY_POINT_PIC:
{
code_block *compiled = op.load_code_block();
if(reset_inline_caches || !compiled->pic_p())
{
cell owner = parent->code_block_owner(compiled);
if(to_boolean(owner))
op.store_value(parent->compute_entry_point_pic_address(owner));
}
break;
}
case RT_ENTRY_POINT_PIC_TAIL:
{
code_block *compiled = op.load_code_block();
if(reset_inline_caches || !compiled->pic_p())
{
cell owner = parent->code_block_owner(compiled);
if(to_boolean(owner))
op.store_value(parent->compute_entry_point_pic_tail_address(owner));
}
break;
}
default:
break;
}
}
示例8: operator
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;
}
}
示例9: operator
void operator()(instruction_operand op) {
if (op.rel_type() == RT_LITERAL)
op.store_value(visitor->visit_pointer(op.load_value()));
}