diff --git a/src/hotspot/share/opto/compile.cpp b/src/hotspot/share/opto/compile.cpp index 7c1ab6d..f6a8c5f 100644 --- a/src/hotspot/share/opto/compile.cpp +++ b/src/hotspot/share/opto/compile.cpp @@ -33,6 +33,8 @@ #include "compiler/compileLog.hpp" #include "compiler/disassembler.hpp" #include "compiler/oopMap.hpp" +#include "gc/shared/barrierSet.hpp" +#include "gc/shared/c2/barrierSetC2.hpp" #include "memory/resourceArea.hpp" #include "opto/addnode.hpp" #include "opto/block.hpp" @@ -637,6 +639,7 @@ Compile::Compile( ciEnv* ci_env, C2Compiler* compiler, ciMethod* target, int osr _stub_function(NULL), _stub_entry_point(NULL), _method(target), + _barrier_set_state(BarrierSet::barrier_set()->barrier_set_c2()->create_barrier_state()), _entry_bci(osr_bci), _initial_gvn(NULL), _for_igvn(NULL), @@ -772,17 +775,12 @@ Compile::Compile( ciEnv* ci_env, C2Compiler* compiler, ciMethod* target, int osr StartNode* s = new StartNode(root(), tf()->domain()); initial_gvn()->set_type_bottom(s); init_start(s); - if (method()->intrinsic_id() == vmIntrinsics::_Reference_get && UseG1GC) { + if (method()->intrinsic_id() == vmIntrinsics::_Reference_get) { // With java.lang.ref.reference.get() we must go through the - // intrinsic when G1 is enabled - even when get() is the root + // intrinsic - even when get() is the root // method of the compile - so that, if necessary, the value in // the referent field of the reference object gets recorded by // the pre-barrier code. - // Specifically, if G1 is enabled, the value in the referent - // field is recorded by the G1 SATB pre barrier. This will - // result in the referent being marked live and the reference - // object removed from the list of discovered references during - // reference processing. cg = find_intrinsic(method(), false); } if (cg == NULL) {