--- old/src/hotspot/share/gc/shared/c2/barrierSetC2.hpp 2018-11-07 22:36:32.218269366 +0100 +++ new/src/hotspot/share/gc/shared/c2/barrierSetC2.hpp 2018-11-07 22:36:32.054270342 +0100 @@ -288,6 +288,9 @@ #ifdef ASSERT virtual bool verify_gc_alias_type(const TypePtr* adr_type, int offset) const { return false; } #endif + + virtual bool final_graph_reshaping(Compile* compile, Node* n, uint opcode) const { return false; } + }; #endif // SHARE_GC_SHARED_C2_BARRIERSETC2_HPP --- old/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp 2018-11-07 22:36:32.640266855 +0100 +++ new/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp 2018-11-07 22:36:32.484267783 +0100 @@ -1435,15 +1435,14 @@ return type == T_OBJECT || type == T_ARRAY; } -bool ZBarrierSetC2::final_graph_reshaping(Compile* compile, Node* n) const { +bool ZBarrierSetC2::final_graph_reshaping(Compile* compile, Node* n, uint opcode) const { bool handled; switch (n->Opcode()) { case Op_LoadBarrierSlowReg: case Op_LoadBarrierWeakSlowReg: #ifdef ASSERT if (VerifyOptoOopOffsets) { - assert(n->is_Mem(), ""); - MemNode* mem = (MemNode*)n; + MemNode* mem = n->as_Mem(); // Check to see if address types have grounded out somehow. const TypeInstPtr* tp = mem->in(MemNode::Address)->bottom_type()->isa_instptr(); ciInstanceKlass* k = tp->klass()->as_instance_klass(); --- old/src/hotspot/share/gc/z/c2/zBarrierSetC2.hpp 2018-11-07 22:36:33.098264129 +0100 +++ new/src/hotspot/share/gc/z/c2/zBarrierSetC2.hpp 2018-11-07 22:36:32.939265075 +0100 @@ -207,7 +207,7 @@ static void find_dominating_barriers(PhaseIterGVN& igvn); static void loop_optimize_gc_barrier(PhaseIdealLoop* phase, Node* node, bool last_round); - virtual bool final_graph_reshaping(Compile* compile, Node* n) const; + virtual bool final_graph_reshaping(Compile* compile, Node* n, uint opcode) const; #ifdef ASSERT virtual void verify_gc_barriers(Compile* compile, CompilePhase phase) const; --- old/src/hotspot/share/opto/compile.cpp 2018-11-07 22:36:33.534261535 +0100 +++ new/src/hotspot/share/opto/compile.cpp 2018-11-07 22:36:33.373262493 +0100 @@ -2792,7 +2792,7 @@ } #endif // Count FPU ops and common calls, implements item (3) - bool gc_handled = BarrierSet::barrier_set()->barrier_set_c2()->final_graph_reshaping(this, n); + bool gc_handled = BarrierSet::barrier_set()->barrier_set_c2()->final_graph_reshaping(this, n, nop); switch( nop ) { // Count all float operations that may use FPU case Op_AddF: @@ -2939,10 +2939,6 @@ case Op_LoadL_unaligned: case Op_LoadPLocked: case Op_LoadP: -#if INCLUDE_ZGC - case Op_LoadBarrierSlowReg: - case Op_LoadBarrierWeakSlowReg: -#endif case Op_LoadN: case Op_LoadRange: case Op_LoadS: {