< prev index next >

src/hotspot/share/opto/node.cpp

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -38,10 +38,13 @@
 #include "opto/opcodes.hpp"
 #include "opto/regmask.hpp"
 #include "opto/type.hpp"
 #include "utilities/copy.hpp"
 #include "utilities/macros.hpp"
+#if INCLUDE_SHENANDOAHGC
+#include "gc/shenandoah/c2/shenandoahBarrierSetC2.hpp"
+#endif
 
 class RegMask;
 // #include "phase.hpp"
 class PhaseTransform;
 class PhaseGVN;

@@ -1140,10 +1143,14 @@
     // Condition for subI(x,subI(y,z)) ==> subI(addI(x,z),y)
     return n->Opcode() == op && n->in(2) == this;
   } else if (is_If() && (n->is_IfFalse() || n->is_IfTrue())) {
     // See IfProjNode::Identity()
     return true;
+#if INCLUDE_SHENANDOAHGC
+  } else if (op == Op_ShenandoahWriteBarrier) {
+    return n->Opcode() == Op_ShenandoahWBMemProj;
+#endif
   }
   return false;
 };
 
 //--------------------------find_exact_control---------------------------------

@@ -1386,10 +1393,15 @@
             // Push store's uses on worklist to enable folding optimization for
             // store/store and store/load to the same address.
             // The restriction (outcnt() <= 2) is the same as in set_req_X()
             // and remove_globally_dead_node().
             igvn->add_users_to_worklist( n );
+#if INCLUDE_SHENANDOAHGC
+          // TODO: Move into below enqueue_useful_gc_barrier() call
+          } else if (n->Opcode() == Op_AddP && ShenandoahBarrierSetC2::has_only_shenandoah_wb_pre_uses(n)) {
+            igvn->add_users_to_worklist(n);
+#endif
           } else {
             BarrierSet::barrier_set()->barrier_set_c2()->enqueue_useful_gc_barrier(igvn->_worklist, n);
           }
         }
       }
< prev index next >