--- old/src/hotspot/share/opto/graphKit.cpp 2018-04-27 15:30:08.382202061 +0200 +++ new/src/hotspot/share/opto/graphKit.cpp 2018-04-27 15:30:08.138202069 +0200 @@ -25,9 +25,6 @@ #include "precompiled.hpp" #include "ci/ciUtilities.hpp" #include "compiler/compileLog.hpp" -#include "gc/g1/g1BarrierSet.hpp" -#include "gc/g1/g1CardTable.hpp" -#include "gc/g1/heapRegion.hpp" #include "gc/shared/barrierSet.hpp" #include "gc/shared/cardTable.hpp" #include "gc/shared/cardTableBarrierSet.hpp" @@ -48,7 +45,7 @@ #include "opto/runtime.hpp" #include "runtime/deoptimization.hpp" #include "runtime/sharedRuntime.hpp" -#if INCLUDE_ALL_GCS +#if INCLUDE_G1GC #include "gc/g1/g1CardTable.hpp" #include "gc/g1/g1ThreadLocalData.hpp" #include "gc/g1/heapRegion.hpp" @@ -1567,9 +1564,12 @@ BarrierSet* bs = BarrierSet::barrier_set(); set_control(ctl); switch (bs->kind()) { + +#if INCLUDE_G1GC case BarrierSet::G1BarrierSet: g1_write_barrier_pre(do_load, obj, adr, adr_idx, val, val_type, pre_val, bt); break; +#endif case BarrierSet::CardTableBarrierSet: break; @@ -1583,8 +1583,11 @@ bool GraphKit::can_move_pre_barrier() const { BarrierSet* bs = BarrierSet::barrier_set(); switch (bs->kind()) { + +#if INCLUDE_G1GC case BarrierSet::G1BarrierSet: return true; // Can move it if no safepoint +#endif case BarrierSet::CardTableBarrierSet: return true; // There is no pre-barrier @@ -1606,9 +1609,11 @@ BarrierSet* bs = BarrierSet::barrier_set(); set_control(ctl); switch (bs->kind()) { +#if INCLUDE_G1GC case BarrierSet::G1BarrierSet: g1_write_barrier_post(store, obj, adr, adr_idx, val, bt, use_precise); break; +#endif case BarrierSet::CardTableBarrierSet: write_barrier_post(store, obj, adr, adr_idx, val, use_precise); @@ -3931,6 +3936,9 @@ // Final sync IdealKit and GraphKit. final_sync(ideal); } + +#if INCLUDE_G1GC + /* * Determine if the G1 pre-barrier can be removed. The pre-barrier is * required by SATB to make sure all objects live at the start of the @@ -4363,6 +4371,7 @@ } #undef __ +#endif // INCLUDE_G1GC Node* GraphKit::load_String_length(Node* ctrl, Node* str) { Node* len = load_array_length(load_String_value(ctrl, str));