diff --git a/src/hotspot/share/gc/z/zBarrierSet.cpp b/src/hotspot/share/gc/z/zBarrierSet.cpp index a4893fc351a..43ea791a260 100644 --- a/src/hotspot/share/gc/z/zBarrierSet.cpp +++ b/src/hotspot/share/gc/z/zBarrierSet.cpp @@ -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()); } }