8226705: [REDO] Deoptimize with handshakes

Reviewed-by: eosterlund, dcubed, dlong, pchilanomate
This commit is contained in:
Robbin Ehn 2019-09-19 10:52:22 +02:00
parent 336b741b1c
commit 35a9f6864a
33 changed files with 398 additions and 326 deletions

View file

@ -1520,7 +1520,10 @@ JVMCI::CodeInstallResult JVMCIRuntime::register_method(JVMCIEnv* JVMCIENV,
comp_level, method_name, nm->entry_point());
}
// Allow the code to be executed
method->set_code(method, nm);
MutexLocker ml(CompiledMethod_lock, Mutex::_no_safepoint_check_flag);
if (nm->make_in_use()) {
method->set_code(method, nm);
}
} else {
LogTarget(Info, nmethod, install) lt;
if (lt.is_enabled()) {
@ -1529,12 +1532,14 @@ JVMCI::CodeInstallResult JVMCIRuntime::register_method(JVMCIEnv* JVMCIENV,
lt.print("Installing osr method (%d) %s @ %d",
comp_level, method_name, entry_bci);
}
InstanceKlass::cast(method->method_holder())->add_osr_nmethod(nm);
MutexLocker ml(CompiledMethod_lock, Mutex::_no_safepoint_check_flag);
if (nm->make_in_use()) {
InstanceKlass::cast(method->method_holder())->add_osr_nmethod(nm);
}
}
} else {
assert(!nmethod_mirror.is_hotspot() || data->get_nmethod_mirror(nm, /* phantom_ref */ false) == HotSpotJVMCI::resolve(nmethod_mirror), "must be");
}
nm->make_in_use();
}
result = nm != NULL ? JVMCI::ok :JVMCI::cache_full;
}