本文整理汇总了C++中NativeMovConstReg类的典型用法代码示例。如果您正苦于以下问题:C++ NativeMovConstReg类的具体用法?C++ NativeMovConstReg怎么用?C++ NativeMovConstReg使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了NativeMovConstReg类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: nativeCall_at
void CodeInstaller::pd_relocate_ForeignCall(NativeInstruction* inst, jlong foreign_call_destination, TRAPS) {
address pc = (address) inst;
if (inst->is_call()) {
// NOTE: for call without a mov, the offset must fit a 32-bit immediate
// see also CompilerToVM.getMaxCallTargetOffset()
NativeCall* call = nativeCall_at(pc);
call->set_destination((address) foreign_call_destination);
_instructions->relocate(call->instruction_address(), runtime_call_Relocation::spec(), Assembler::call32_operand);
} else if (inst->is_mov_literal64()) {
NativeMovConstReg* mov = nativeMovConstReg_at(pc);
mov->set_data((intptr_t) foreign_call_destination);
_instructions->relocate(mov->instruction_address(), runtime_call_Relocation::spec(), Assembler::imm_operand);
} else if (inst->is_jump()) {
NativeJump* jump = nativeJump_at(pc);
jump->set_jump_destination((address) foreign_call_destination);
_instructions->relocate(jump->instruction_address(), runtime_call_Relocation::spec(), Assembler::call32_operand);
} else if (inst->is_cond_jump()) {
address old_dest = nativeGeneralJump_at(pc)->jump_destination();
address disp = Assembler::locate_operand(pc, Assembler::call32_operand);
*(jint*) disp += ((address) foreign_call_destination) - old_dest;
_instructions->relocate(pc, runtime_call_Relocation::spec(), Assembler::call32_operand);
} else {
JVMCI_ERROR("unsupported relocation for foreign call");
}
TRACE_jvmci_3("relocating (foreign call) at " PTR_FORMAT, p2i(inst));
}
示例2: nativeMovConstReg_at
oop InlineCacheBuffer::ic_buffer_cached_oop(address code_begin) {
// creation also verifies the object
NativeMovConstReg* move = nativeMovConstReg_at(code_begin);
// Verifies the jump
NativeJump* jump = nativeJump_at(move->next_instruction_address());
return (oop)move->data();
}
示例3: nativeCall_at
// Release the CompiledICHolder* associated with this call site is there is one.
void CompiledIC::cleanup_call_site(virtual_call_Relocation* call_site) {
// This call site might have become stale so inspect it carefully.
NativeCall* call = nativeCall_at(call_site->addr());
if (is_icholder_entry(call->destination())) {
NativeMovConstReg* value = nativeMovConstReg_at(call_site->cached_value());
InlineCacheBuffer::queue_for_release((CompiledICHolder*)value->data());
}
}
示例4: nativeMovConstReg32_at
void CodeInstaller::pd_patch_MetaspaceConstant(int pc_offset, Handle constant, TRAPS) {
address pc = _instructions->start() + pc_offset;
if (HotSpotMetaspaceConstantImpl::compressed(constant)) {
#ifdef _LP64
NativeMovConstReg32* move = nativeMovConstReg32_at(pc);
narrowKlass narrowOop = record_narrow_metadata_reference(constant, CHECK);
move->set_data((intptr_t)narrowOop);
TRACE_jvmci_3("relocating (narrow metaspace constant) at %p/%p", pc, narrowOop);
#else
JVMCI_ERROR("compressed Klass* on 32bit");
#endif
} else {
NativeMovConstReg* move = nativeMovConstReg_at(pc);
Metadata* reference = record_metadata_reference(constant, CHECK);
move->set_data((intptr_t)reference);
TRACE_jvmci_3("relocating (metaspace constant) at %p/%p", pc, reference);
}
}
示例5: JVMCI_ERROR
void CodeInstaller::pd_patch_OopConstant(int pc_offset, Handle constant, TRAPS) {
address pc = _instructions->start() + pc_offset;
Handle obj = HotSpotObjectConstantImpl::object(constant);
jobject value = JNIHandles::make_local(obj());
if (HotSpotObjectConstantImpl::compressed(constant)) {
#ifdef _LP64
int oop_index = _oop_recorder->find_index(value);
RelocationHolder rspec = oop_Relocation::spec(oop_index);
_instructions->relocate(pc, rspec, 1);
#else
JVMCI_ERROR("compressed oop on 32bit");
#endif
} else {
NativeMovConstReg* move = nativeMovConstReg_at(pc);
move->set_data((intptr_t) value);
// We need two relocations: one on the sethi and one on the add.
int oop_index = _oop_recorder->find_index(value);
RelocationHolder rspec = oop_Relocation::spec(oop_index);
_instructions->relocate(pc + NativeMovConstReg::sethi_offset, rspec);
_instructions->relocate(pc + NativeMovConstReg::add_offset, rspec);
}
}
示例6: cb
// Code for unit testing implementation of NativeMovConstReg class
void NativeMovConstReg::test() {
#ifdef ASSERT
ResourceMark rm;
CodeBuffer cb("test", 100, 100);
MacroAssembler* a = new MacroAssembler(&cb);
NativeMovConstReg* nm;
uint idx;
int offsets[] = {
0x0,
0x7fffffff,
0x80000000,
0xffffffff,
0x20,
4096,
4097,
};
VM_Version::allow_all();
AddressLiteral al1(0xaaaabbbb, relocInfo::external_word_type);
a->sethi(al1, I3);
a->add(I3, al1.low10(), I3);
AddressLiteral al2(0xccccdddd, relocInfo::external_word_type);
a->sethi(al2, O2);
a->add(O2, al2.low10(), O2);
nm = nativeMovConstReg_at( cb.insts_begin() );
nm->print();
nm = nativeMovConstReg_at( nm->next_instruction_address() );
for (idx = 0; idx < ARRAY_SIZE(offsets); idx++) {
nm->set_data( offsets[idx] );
assert(nm->data() == offsets[idx], "check unit test");
}
nm->print();
VM_Version::revert();
#endif
}
示例7: nativeMovConstReg_at
address InlineCacheBuffer::ic_buffer_entry_point(address code_begin) {
NativeMovConstReg* move = nativeMovConstReg_at(code_begin); // creation also verifies the object
NativeJump* jump = nativeJump_at(move->next_instruction_address());
return jump->jump_destination();
}
示例8: nativeMovConstReg_at
void* InlineCacheBuffer::ic_buffer_cached_value(address code_begin) {
NativeMovConstReg* move = nativeMovConstReg_at(code_begin); // creation also verifies the object
NativeJump* jump = nativeJump_at(move->next_instruction_address());
void* o = (void*)move->data();
return o;
}
示例9: nativeMovConstReg_at
void* InlineCacheBuffer::ic_buffer_cached_value(address code_begin) {
NativeMovConstReg* move = nativeMovConstReg_at(code_begin);
return (void*)move->data();
}