diff --git a/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp b/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp index bc51a2b4468..3795b1fc176 100644 --- a/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp @@ -363,8 +363,12 @@ static void emit_store_fast_path_check_c2(MacroAssembler* masm, Address ref_addr } static bool is_c2_compilation() { +#ifdef COMPILER2 CompileTask* task = ciEnv::current()->task(); return task != nullptr && is_c2_compile(task->comp_level()); +#else + return false; +#endif } void ZBarrierSetAssembler::store_barrier_fast(MacroAssembler* masm,