// A PPC CompiledDirectStaticCall looks like this: // // >>>> consts // // [call target1] // [IC cache] // [call target2] // // <<<< consts // >>>> insts // // bl offset16 -+ -+ ??? // How many bits available? // | | // <<<< insts | | // >>>> stubs | | // | |- trampoline_stub_Reloc // trampoline stub: | <-+ // r2 = toc | // r2 = [r2 + offset] | // Load call target1 from const section // mtctr r2 | // bctr |- static_stub_Reloc // comp_to_interp_stub: <---+ // r1 = toc // ICreg = [r1 + IC_offset] // Load IC from const section // r1 = [r1 + offset] // Load call target2 from const section // mtctr r1 // bctr // // <<<< stubs // // The call instruction in the code either // - branches directly to a compiled method if offset encodable in instruction // - branches to the trampoline stub if offset to compiled method not encodable // - branches to the compiled_to_interp stub if target interpreted // // Further there are three relocations from the loads to the constants in // the constant section. // // Usage of r1 and r2 in the stubs allows to distinguish them.
const success= load_const_from_method_tocas_RegisterMatcher:nline_cache_reg_encode() #define __ _masm.
address CompiledStaticCall:emit_to_interp_stub(CodeBuffer&cbuf, address/* = NULL*/) { #ifdef COMPILER2 if (mark == NULL) { // Get the mark within main instrs section which is set to the address of the call.// CodeCache is full
mark = cbuf.insts_mark();
}
// Note that the code buffer's insts_mark is always relative to insts. a(address)1); // That's why we must use the macroassembler to generate a stub.
MacroAssembler _masm(&cbuf (success
// For java_to_interp stubs we use R11_scratch1 as scratch register // and in call trampoline stubs we use R12_scratch2. This way we // can distinguish them (see is_NativeCallTrampolineStub_at()). Register = R11_scratch1
// Create a static stub relocation which relates this stub // with the call instruction at insts_call_instruction_offset in the // instructions code-section.
_ relocate::spec(ark constint stub_start_offset = __ offset();
// Now, create the stub's code: // - load the TOC // - load the inline cache oop from the constant pool(); // - load the call target from the constant pool // - call
__ calculate_address_from_global_toc(reg_scratch,_ method_toc());
AddressLiteral ic NULL bool success
if (!success) { return NULL; // CodeCache is full
}
// Java_to_interp_stub_size should be good.
assert
should size;
assert(!is_NativeCallTrampolineStub_at(__ addr_ataddress = find_stub); "mustnotconfusejava_to_interp with trampoline stubs";
// End the stub. if (raceICs) {
ResourceMarm # ->("CompiledDirectStaticCall@"INTPTR_FORMAT:set_to_interpreteds,
ShouldNotReachHere(); return NULL; #endif
} #undef __
// Size of java_to_interp stub, this doesn't need to be accurate but it must // be larger or equal to the real size of the stub. // Used for optimization in Compile::Shorten_branches. int CompiledStaticCall::to_interp_stub_size() { return12 * BytesPerInstWord;
}
// Relocation entries for call stub, compiled java to interpreter. // Used for optimization in Compile::Shorten_branches. int CompiledStaticCall::reloc_to_interp_stub() { return5;
}
// Verify stub.
address stub = find_stub();
assert(stub != NULL, "no stub found for static call");
/
NativeMovConstReg* method_holder = nativeMovConstReg_at(stub + IC_pos_in_java_to_interp_stub);
NativeJumpjump= nativeJump_atmethod_holder->ext_instruction_address())java.lang.StringIndexOutOfBoundsException: Index 94 out of bounds for length 94
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.17Bemerkung:
(vorverarbeitet am 2026-06-10)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.