--- old/src/hotspot/share/opto/node.cpp 2018-10-17 19:53:13.810601434 +0200 +++ new/src/hotspot/share/opto/node.cpp 2018-10-17 19:53:13.647602485 +0200 @@ -2456,3 +2456,10 @@ uint TypeNode::ideal_reg() const { return _type->ideal_reg(); } + +bool Node::eqv_uncast(const Node* n) const { + BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2(); + Node* obj1 = bs->step_over_gc_barrier(const_cast(this)); + Node* obj2 = bs->step_over_gc_barrier(const_cast(n)); + return (obj1->uncast() == obj2->uncast()); +} --- old/src/hotspot/share/opto/node.hpp 2018-10-17 19:53:14.420597504 +0200 +++ new/src/hotspot/share/opto/node.hpp 2018-10-17 19:53:14.259598542 +0200 @@ -457,10 +457,9 @@ // Strip away casting. (It is depth-limited.) Node* uncast() const; - // Return whether two Nodes are equivalent, after stripping casting. - bool eqv_uncast(const Node* n) const { - return (this->uncast() == n->uncast()); - } + // Return whether two Nodes are equivalent, after stripping casting + // and GC barriers. + bool eqv_uncast(const Node* n) const; // Find out of current node that matches opcode. Node* find_out_with(int opcode);