< prev index next >

src/hotspot/share/opto/node.cpp

Print this page
rev 54995 : 8224675: Late GC barrier insertion for ZGC
Reviewed-by:

@@ -544,10 +544,13 @@
     n->as_Call()->clone_jvms(C);
   }
   if (n->is_SafePoint()) {
     n->as_SafePoint()->clone_replaced_nodes();
   }
+  if (n->is_Load()) {
+    n->as_Load()->copy_barrier_info(this);
+  }
   return n;                     // Return the clone
 }
 
 //---------------------------setup_is_top--------------------------------------
 // Call this when changing the top node, to reassert the invariants

@@ -562,11 +565,10 @@
     if (_out == NULL)  _out = NO_OUT_ARRAY;
     assert(!is_top(), "must not be top");
   }
 }
 
-
 //------------------------------~Node------------------------------------------
 // Fancy destructor; eagerly attempt to reclaim Node numberings and storage
 void Node::destruct() {
   // Eagerly reclaim unique Node numberings
   Compile* compile = Compile::current();

@@ -1452,17 +1454,20 @@
 }
 
 //------------------------------needs_anti_dependence_check---------------------
 // Nodes which use memory without consuming it, hence need antidependences.
 bool Node::needs_anti_dependence_check() const {
-  if( req() < 2 || (_flags & Flag_needs_anti_dependence_check) == 0 )
+  if (req() < 2 || (_flags & Flag_needs_anti_dependence_check) == 0) {
     return false;
-  else
+  }
+  BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
+  if (!bs->needs_anti_dependence_check(this)) {
+    return false;
+  }
     return in(1)->bottom_type()->has_memory();
 }
 
-
 // Get an integer constant from a ConNode (or CastIINode).
 // Return a default value if there is no apparent constant here.
 const TypeInt* Node::find_int_type() const {
   if (this->is_Type()) {
     return this->as_Type()->type()->isa_int();
< prev index next >