address Relocation::pd_call_destination(address orig_addr) {
assert(is_call(), "should be an address instruction here"); if (NativeCall::is_call_at(addr())) {
address trampoline = nativeCall_at(addr())->get_trampoline(); if (trampoline != NULL) { return nativeCallTrampolineStub_at(trampoline)->destination();
}
} if (orig_addr != NULL) { // the extracted address from the instructions in address orig_addr
address new_addr = MacroAssembler::pd_call_destination(orig_addr); // If call is branch to self, don't try to relocate it, just leave it // as branch to self. This happens during code generation if the code // buffer expands. It will be relocated to the trampoline above once // code generation is complete.
new_addr = (new_addr == orig_addr) ? addr() : new_addr; return new_addr;
} return MacroAssembler::pd_call_destination(addr());
}
void Relocation::pd_set_call_destination(address x) {
assert(is_call(), "should be an address instruction here"); if (NativeCall::is_call_at(addr())) {
address trampoline = nativeCall_at(addr())->get_trampoline(); if (trampoline != NULL) {
nativeCall_at(addr())->set_destination_mt_safe(x, /* assert_lock */false); return;
}
}
MacroAssembler::pd_patch_instruction_size(addr(), x);
address pd_call = pd_call_destination(addr());
assert(pd_call == x, "fail in reloc");
}
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.