8343158: [JVMCI] ZGC should deoptimize on old gen allocation

Reviewed-by: aboldtch, eosterlund
This commit is contained in:
Tom Rodriguez 2025-05-05 17:26:01 +00:00
parent 32f67a3e38
commit cc34135fff

View File

@ -115,7 +115,9 @@ static void deoptimize_allocation(JavaThread* thread) {
assert(caller_frame.is_compiled_frame(), "must be compiled");
const nmethod* const nm = caller_frame.cb()->as_nmethod();
if (nm->is_compiled_by_c2() && !caller_frame.is_deoptimized_frame()) {
if ((nm->is_compiled_by_c2() || nm->is_compiled_by_jvmci()) && !caller_frame.is_deoptimized_frame()) {
// The JIT might have elided barriers on this object so deoptimize the frame and let the
// intepreter deal with it.
Deoptimization::deoptimize_frame(thread, caller_frame.id());
}
}