本文整理汇总了C++中NativeCall::is_pcrelative方法的典型用法代码示例。如果您正苦于以下问题:C++ NativeCall::is_pcrelative方法的具体用法?C++ NativeCall::is_pcrelative怎么用?C++ NativeCall::is_pcrelative使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NativeCall
的用法示例。
在下文中一共展示了NativeCall::is_pcrelative方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pd_set_call_destination
void Relocation::pd_set_call_destination(address x) {
address inst_addr = addr();
if (NativeFarCall::is_far_call_at(inst_addr)) {
if (!ShortenBranches) {
if (MacroAssembler::is_call_far_pcrelative(inst_addr)) {
address a1 = MacroAssembler::get_target_addr_pcrel(inst_addr+MacroAssembler::nop_size());
#ifdef ASSERT
address a3 = nativeFarCall_at(inst_addr)->destination();
if (a1 != a3) {
unsigned int range = 128;
Assembler::dump_code_range(tty, inst_addr, range, "pc-relative call w/o ShortenBranches?");
assert(false, "pc-relative call w/o ShortenBranches?");
}
#endif
nativeFarCall_at(inst_addr)->set_destination(x, 0);
return;
}
assert(x == (address)-1, "consistency check");
return;
}
int toc_offset = -1;
if (type() == relocInfo::runtime_call_w_cp_type) {
toc_offset = ((runtime_call_w_cp_Relocation *)this)->get_constant_pool_offset();
}
if (toc_offset>=0) {
NativeFarCall* call = nativeFarCall_at(inst_addr);
call->set_destination(x, toc_offset);
return;
}
}
if (NativeCall::is_call_at(inst_addr)) {
NativeCall* call = nativeCall_at(inst_addr);
if (call->is_pcrelative()) {
call->set_destination_mt_safe(x);
return;
}
}
// constant is absolute, must use x
nativeMovConstReg_at(inst_addr)->set_data(((intptr_t)x));
}
示例2: pd_call_destination
address Relocation::pd_call_destination(address orig_addr) {
address inst_addr = addr();
if (NativeFarCall::is_far_call_at(inst_addr)) {
if (!ShortenBranches) {
if (MacroAssembler::is_call_far_pcrelative(inst_addr)) {
address a1 = MacroAssembler::get_target_addr_pcrel(orig_addr+MacroAssembler::nop_size());
#ifdef ASSERT
address a2 = MacroAssembler::get_target_addr_pcrel(inst_addr+MacroAssembler::nop_size());
address a3 = nativeFarCall_at(orig_addr)->destination();
address a4 = nativeFarCall_at(inst_addr)->destination();
if ((a1 != a3) || (a2 != a4)) {
unsigned int range = 128;
Assembler::dump_code_range(tty, inst_addr, range, "pc-relative call w/o ShortenBranches?");
Assembler::dump_code_range(tty, orig_addr, range, "pc-relative call w/o ShortenBranches?");
assert(false, "pc-relative call w/o ShortenBranches?");
}
#endif
return a1;
}
return (address)(-1);
}
NativeFarCall* call;
if (orig_addr == NULL) {
call = nativeFarCall_at(inst_addr);
} else {
// must access location (in CP) where destination is stored in unmoved code, because load from CP is pc-relative
call = nativeFarCall_at(orig_addr);
}
return call->destination();
}
if (NativeCall::is_call_at(inst_addr)) {
NativeCall* call = nativeCall_at(inst_addr);
if (call->is_pcrelative()) {
intptr_t off = inst_addr - orig_addr;
return (address) (call->destination()-off);
}
}
return (address) nativeMovConstReg_at(inst_addr)->data();
}