--- old/src/hotspot/share/opto/macro.cpp 2020-01-17 17:14:35.607115849 +0100 +++ new/src/hotspot/share/opto/macro.cpp 2020-01-17 17:14:35.508115854 +0100 @@ -47,9 +47,13 @@ #include "opto/subnode.hpp" #include "opto/type.hpp" #include "runtime/sharedRuntime.hpp" +#include "utilities/macros.hpp" #if INCLUDE_G1GC #include "gc/g1/g1ThreadLocalData.hpp" #endif // INCLUDE_G1GC +#if INCLUDE_SHENANDOAHGC +#include "gc/shenandoah/c2/shenandoahBarrierSetC2.hpp" +#endif // @@ -458,7 +462,14 @@ if (val == mem) { values.at_put(j, mem); } else if (val->is_Store()) { - values.at_put(j, val->in(MemNode::ValueIn)); + Node* n = val->in(MemNode::ValueIn); +#if INCLUDE_SHENANDOAHGC + if (UseShenandoahGC) { + BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2(); + n = bs->step_over_gc_barrier(n); + } +#endif + values.at_put(j, n); } else if(val->is_Proj() && val->in(0) == alloc) { values.at_put(j, _igvn.zerocon(ft)); } else if (val->is_Phi()) { @@ -569,7 +580,14 @@ // hit a sentinel, return appropriate 0 value return _igvn.zerocon(ft); } else if (mem->is_Store()) { - return mem->in(MemNode::ValueIn); + Node* n = mem->in(MemNode::ValueIn); +#if INCLUDE_SHENANDOAHGC + if (UseShenandoahGC) { + BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2(); + n = bs->step_over_gc_barrier(n); + } +#endif + return n; } else if (mem->is_Phi()) { // attempt to produce a Phi reflecting the values on the input paths of the Phi Node_Stack value_phis(a, 8); @@ -646,6 +664,7 @@ k < kmax && can_eliminate; k++) { Node* n = use->fast_out(k); if (!n->is_Store() && n->Opcode() != Op_CastP2X && + SHENANDOAHGC_ONLY((!UseShenandoahGC || !ShenandoahBarrierSetC2::is_shenandoah_wb_pre_call(n)) &&) !(n->is_ArrayCopy() && n->as_ArrayCopy()->is_clonebasic() && n->in(ArrayCopyNode::Dest) == use)) {