# HG changeset patch # User rkennke # Date 1539808291 -7200 # Wed Oct 17 22:31:31 2018 +0200 # Node ID a38da5041fabce8629d8cb1f67fa6f383b98316f # Parent 597ed181a9e81de9da4d70f7d940e0c732d25f3c JDK-8212603: Need to step over GC barriers in Node::eqv_uncast() Reviewed-by: shade, kvn, eosterlund diff --git a/src/hotspot/share/opto/node.cpp b/src/hotspot/share/opto/node.cpp --- a/src/hotspot/share/opto/node.cpp +++ b/src/hotspot/share/opto/node.cpp @@ -899,6 +899,13 @@ return (Node*) this; } +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()); +} + // Find out of current node that matches opcode. Node* Node::find_out_with(int opcode) { for (DUIterator_Fast imax, i = fast_outs(imax); i < imax; i++) { diff --git a/src/hotspot/share/opto/node.hpp b/src/hotspot/share/opto/node.hpp --- a/src/hotspot/share/opto/node.hpp +++ b/src/hotspot/share/opto/node.hpp @@ -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);