< prev index next >

src/hotspot/share/opto/compile.cpp

Print this page
rev 52443 : 8213489: GC/C2 abstraction for Compile::final_graph_reshaping()
rev 52444 : [mq]: JDK-8213489-1.patch

@@ -2791,10 +2791,21 @@
     }
   }
 #endif
   // Count FPU ops and common calls, implements item (3)
   bool gc_handled = BarrierSet::barrier_set()->barrier_set_c2()->final_graph_reshaping(this, n, nop);
+  if (!gc_handled) {
+    final_graph_reshaping_main_switch(n, frc, nop);
+  }
+
+  // Collect CFG split points
+  if (n->is_MultiBranch() && !n->is_RangeCheck()) {
+    frc._tests.push(n);
+  }
+}
+
+void Compile::final_graph_reshaping_main_switch(Node* n, Final_Reshape_Counts& frc, uint nop) {
   switch( nop ) {
   // Count all float operations that may use FPU
   case Op_AddF:
   case Op_SubF:
   case Op_MulF:

@@ -2943,12 +2954,11 @@
   case Op_LoadRange:
   case Op_LoadS: {
   handle_mem:
 #ifdef ASSERT
     if( VerifyOptoOopOffsets ) {
-      assert( n->is_Mem(), "" );
-      MemNode *mem  = (MemNode*)n;
+      MemNode* mem  = n->as_Mem();
       // Check to see if address types have grounded out somehow.
       const TypeInstPtr *tp = mem->in(MemNode::Address)->bottom_type()->isa_instptr();
       assert( !tp || oop_offset_is_sane(tp), "" );
     }
 #endif

@@ -3462,22 +3472,15 @@
       n->subsume_by(cmp, this);
     }
     break;
   }
   default:
-    if (!gc_handled) {
       assert(!n->is_Call(), "");
       assert(!n->is_Mem(), "");
       assert(nop != Op_ProfileBoolean, "should be eliminated during IGVN");
-    }
     break;
   }
-
-  // Collect CFG split points
-  if (n->is_MultiBranch() && !n->is_RangeCheck()) {
-    frc._tests.push(n);
-  }
 }
 
 //------------------------------final_graph_reshaping_walk---------------------
 // Replacing Opaque nodes with their input in final_graph_reshaping_impl(),
 // requires that the walk visits a node's inputs before visiting the node.
< prev index next >