< prev index next >

src/hotspot/share/opto/split_if.cpp

Print this page

        

@@ -25,10 +25,11 @@
 #include "precompiled.hpp"
 #include "memory/allocation.inline.hpp"
 #include "opto/callnode.hpp"
 #include "opto/loopnode.hpp"
 #include "opto/movenode.hpp"
+#include "opto/valuetypenode.hpp"
 
 
 //------------------------------split_thru_region------------------------------
 // Split Node 'n' through merge point.
 Node *PhaseIdealLoop::split_thru_region( Node *n, Node *region ) {

@@ -229,10 +230,19 @@
   const Type* rtype = NULL;
   if (n->Opcode() == Op_ConvI2L && n->bottom_type() != TypeLong::INT) {
     rtype = TypeLong::INT;
   }
 
+  // Value types should not be split through Phis but each value input
+  // needs to be merged individually. At this point, value types should
+  // only be used by AllocateNodes. Try to remove redundant allocations
+  // and unlink the now dead value type node.
+  if (n->is_ValueType()) {
+    n->as_ValueType()->remove_redundant_allocations(&_igvn, this);
+    return true; // n is now dead
+  }
+
   // Now actually split-up this guy.  One copy per control path merging.
   Node *phi = PhiNode::make_blank(blk1, n);
   for( uint j = 1; j < blk1->req(); j++ ) {
     Node *x = n->clone();
     // Widen the type of the ConvI2L when pushing up.

@@ -465,12 +475,11 @@
         Node* m = n->out(j);
         // If m is dead, throw it away, and declare progress
         if (_nodes[m->_idx] == NULL) {
           _igvn.remove_dead_node(m);
           // fall through
-        }
-        else if (m != iff && split_up(m, region, iff)) {
+        } else if (m != iff && split_up(m, region, iff)) {
           // fall through
         } else {
           continue;
         }
         // Something unpredictable changed.
< prev index next >