< prev index next >

src/hotspot/share/opto/cfgnode.cpp

Print this page

        

@@ -40,10 +40,14 @@
 #include "opto/phaseX.hpp"
 #include "opto/regmask.hpp"
 #include "opto/runtime.hpp"
 #include "opto/subnode.hpp"
 #include "utilities/vmError.hpp"
+#include "utilities/macros.hpp"
+#if INCLUDE_SHENANDOAHGC
+#include "gc/shenandoah/c2/shenandoahBarrierSetC2.hpp"
+#endif
 
 // Portions of code courtesy of Clifford Click
 
 // Optimization - Graph Style
 

@@ -612,10 +616,13 @@
             assert( n->req() == 2 &&  n->in(1) != NULL, "Only one data input expected" );
             in = n->in(1);               // replaced by unique input
             if( n->as_Phi()->is_unsafe_data_reference(in) )
               in = phase->C->top();      // replaced by top
           }
+          if (UseShenandoahGC && n->outcnt() == 0) {
+            in = phase->C->top();
+          }
           igvn->replace_node(n, in);
         }
         else if( n->is_Region() ) { // Update all incoming edges
           assert( !igvn->eqv(n, this), "Must be removed from DefUse edges");
           uint uses_found = 0;

@@ -1303,12 +1310,19 @@
   if( b->_test._test == BoolTest::ne ) {
   } else if( b->_test._test == BoolTest::eq ) {
     flipped = 1-flipped;
   } else return NULL;
 
-  // Build int->bool conversion
-  Node *n = new Conv2BNode( cmp->in(1) );
+  // Build int->bool concfgversion
+  Node *in1 = cmp->in(1);
+#if INCLUDE_SHENANDOAHGC
+  if (UseShenandoahGC) {
+    BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
+    in1 = bs->step_over_gc_barrier(in1);
+  }
+#endif
+  Node *n = new Conv2BNode(in1);
   if( flipped )
     n = new XorINode( phase->transform(n), phase->intcon(1) );
 
   return n;
 }

@@ -1670,11 +1684,16 @@
       if (n != top) {           // Not already top?
         PhaseIterGVN *igvn = phase->is_IterGVN();
         if (can_reshape && igvn != NULL) {
           igvn->_worklist.push(r);
         }
-        set_req(j, top);        // Nuke it down
+        // Nuke it down
+        if (UseShenandoahGC && can_reshape) {
+          set_req_X(j, top, igvn);
+        } else {
+          set_req(j, top);
+        }
         progress = this;        // Record progress
       }
     }
   }
 
< prev index next >