mirror of
https://github.com/openjdk/jdk.git
synced 2026-04-05 04:31:36 +00:00
8294538: missing is_unloading() check in SharedRuntime::fixup_callers_callsite()
Reviewed-by: kvn, thartmann, eosterlund
This commit is contained in:
parent
6acbdb59da
commit
b5efa2afe2
@ -1266,15 +1266,6 @@ address Method::make_adapters(const methodHandle& mh, TRAPS) {
|
||||
return adapter->get_c2i_entry();
|
||||
}
|
||||
|
||||
address Method::from_compiled_entry_no_trampoline() const {
|
||||
CompiledMethod *code = Atomic::load_acquire(&_code);
|
||||
if (code) {
|
||||
return code->verified_entry_point();
|
||||
} else {
|
||||
return adapter()->get_c2i_entry();
|
||||
}
|
||||
}
|
||||
|
||||
// The verified_code_entry() must be called when a invoke is resolved
|
||||
// on this method.
|
||||
|
||||
|
||||
@ -147,7 +147,6 @@ class Method : public Metadata {
|
||||
|
||||
static address make_adapters(const methodHandle& mh, TRAPS);
|
||||
address from_compiled_entry() const;
|
||||
address from_compiled_entry_no_trampoline() const;
|
||||
address from_interpreted_entry() const;
|
||||
|
||||
// access flag
|
||||
|
||||
@ -2097,8 +2097,6 @@ JRT_LEAF(void, SharedRuntime::fixup_callers_callsite(Method* method, address cal
|
||||
|
||||
AARCH64_PORT_ONLY(assert(pauth_ptr_is_raw(caller_pc), "should be raw"));
|
||||
|
||||
address entry_point = moop->from_compiled_entry_no_trampoline();
|
||||
|
||||
// It's possible that deoptimization can occur at a call site which hasn't
|
||||
// been resolved yet, in which case this function will be called from
|
||||
// an nmethod that has been patched for deopt and we can ignore the
|
||||
@ -2109,8 +2107,16 @@ JRT_LEAF(void, SharedRuntime::fixup_callers_callsite(Method* method, address cal
|
||||
// "to interpreter" stub in order to load up the Method*. Don't
|
||||
// ask me how I know this...
|
||||
|
||||
// Result from nmethod::is_unloading is not stable across safepoints.
|
||||
NoSafepointVerifier nsv;
|
||||
|
||||
CompiledMethod* callee = moop->code();
|
||||
if (callee == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
CodeBlob* cb = CodeCache::find_blob(caller_pc);
|
||||
if (cb == NULL || !cb->is_compiled() || entry_point == moop->get_c2i_entry()) {
|
||||
if (cb == NULL || !cb->is_compiled() || callee->is_unloading()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -2168,6 +2174,7 @@ JRT_LEAF(void, SharedRuntime::fixup_callers_callsite(Method* method, address cal
|
||||
}
|
||||
}
|
||||
address destination = call->destination();
|
||||
address entry_point = callee->verified_entry_point();
|
||||
if (should_fixup_call_destination(destination, entry_point, caller_pc, moop, cb)) {
|
||||
call->set_destination_mt_safe(entry_point);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user