< prev index next >

src/share/vm/opto/callnode.cpp

Print this page
rev 10535 : incremental inlining fixes

@@ -37,10 +37,11 @@
 #include "opto/parse.hpp"
 #include "opto/regalloc.hpp"
 #include "opto/regmask.hpp"
 #include "opto/rootnode.hpp"
 #include "opto/runtime.hpp"
+#include "opto/valuetypenode.hpp"
 
 // Portions of code courtesy of Clifford Click
 
 // Optimization - Graph Style
 

@@ -1136,11 +1137,35 @@
 
 
 //------------------------------Ideal------------------------------------------
 // Skip over any collapsed Regions
 Node *SafePointNode::Ideal(PhaseGVN *phase, bool can_reshape) {
-  return remove_dead_region(phase, can_reshape) ? this : NULL;
+  if (remove_dead_region(phase, can_reshape)) {
+    return this;
+  }
+  if (jvms() != NULL) {
+    bool progress = false;
+    // A ValueTypeNode with a valid object input in the debug info?
+    // Reference the object directly. Helps removal of useless value
+    // type allocations with incremental inlining.
+    for (uint i = jvms()->debug_start(); i < jvms()->debug_end(); i++) {
+      Node *arg = in(i);
+      if (arg->is_ValueType()) {
+        ValueTypeNode* vt = arg->as_ValueType();
+        Node* in_oop = vt->get_oop();
+        const Type* oop_type = phase->type(in_oop);
+        if (oop_type->meet(TypePtr::NULL_PTR) != oop_type) {
+          set_req(i, in_oop);
+          progress = true;
+        }
+      }
+    }
+    if (progress) {
+      return this;
+    }
+  }
+  return NULL;
 }
 
 //------------------------------Identity---------------------------------------
 // Remove obviously duplicate safepoints
 Node* SafePointNode::Identity(PhaseGVN* phase) {

@@ -1375,11 +1400,14 @@
   }
 }
 
 //=============================================================================
 Node* AllocateArrayNode::Ideal(PhaseGVN *phase, bool can_reshape) {
-  if (remove_dead_region(phase, can_reshape))  return this;
+  Node* res = SafePointNode::Ideal(phase, can_reshape);
+  if (res != NULL) {
+    return res;
+  }
   // Don't bother trying to transform a dead node
   if (in(0) && in(0)->is_top())  return NULL;
 
   const Type* type = phase->type(Ideal_length());
   if (type->isa_int() && type->is_int()->_hi < 0) {
< prev index next >