8212603: Need to step over GC barriers in Node::eqv_uncast()
authorrkennke
Thu, 18 Oct 2018 21:14:49 +0200
changeset 52194 6eb876ac6827
parent 52193 a3cab5d26ef8
child 52195 f08c1d7a5c53
child 56988 3cb9af04c779
8212603: Need to step over GC barriers in Node::eqv_uncast() Reviewed-by: shade, kvn, eosterlund
src/hotspot/share/opto/node.cpp
src/hotspot/share/opto/node.hpp
--- a/src/hotspot/share/opto/node.cpp	Thu Oct 18 09:46:46 2018 -0700
+++ b/src/hotspot/share/opto/node.cpp	Thu Oct 18 21:14:49 2018 +0200
@@ -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<Node*>(this));
+  Node* obj2 = bs->step_over_gc_barrier(const_cast<Node*>(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++) {
--- a/src/hotspot/share/opto/node.hpp	Thu Oct 18 09:46:46 2018 -0700
+++ b/src/hotspot/share/opto/node.hpp	Thu Oct 18 21:14:49 2018 +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);