6732732: CTW with EA: assert(n != 0L,"Bad immediate dominator info.")
authorkvn
Wed, 27 Aug 2008 16:33:34 -0700
changeset 1069 ef51f81ebe0f
parent 1068 720698d9c89b
child 1070 e03de091796e
6732732: CTW with EA: assert(n != 0L,"Bad immediate dominator info.") Summary: Missing edge to a call's return value in EA Connection Graph. Reviewed-by: never
hotspot/src/share/vm/opto/escape.cpp
--- a/hotspot/src/share/vm/opto/escape.cpp	Wed Aug 27 14:47:32 2008 -0700
+++ b/hotspot/src/share/vm/opto/escape.cpp	Wed Aug 27 16:33:34 2008 -0700
@@ -1810,6 +1810,7 @@
         } else if (call_analyzer->is_return_local()) {
           // determine whether any arguments are returned
           set_escape_state(call_idx, PointsToNode::NoEscape);
+          bool ret_arg = false;
           for (uint i = TypeFunc::Parms; i < d->cnt(); i++) {
             const Type* at = d->field_at(i);
 
@@ -1817,6 +1818,7 @@
               Node *arg = call->in(i)->uncast();
 
               if (call_analyzer->is_arg_returned(i - TypeFunc::Parms)) {
+                ret_arg = true;
                 PointsToNode *arg_esp = ptnode_adr(arg->_idx);
                 if (arg_esp->node_type() == PointsToNode::UnknownType)
                   done = false;
@@ -1828,6 +1830,11 @@
               }
             }
           }
+          if (done && !ret_arg) {
+            // Returns unknown object.
+            set_escape_state(call_idx, PointsToNode::GlobalEscape);
+            add_pointsto_edge(resproj_idx, _phantom_object);
+          }
           copy_dependencies = true;
         } else {
           set_escape_state(call_idx, PointsToNode::GlobalEscape);
@@ -2234,7 +2241,9 @@
         if (in->is_top() || in == n)
           continue;  // ignore top or inputs which go back this node
         int ti = in->_idx;
-        if (ptnode_adr(in->_idx)->node_type() == PointsToNode::JavaObject) {
+        PointsToNode::NodeType nt = ptnode_adr(ti)->node_type();
+        assert(nt != PointsToNode::UnknownType, "all nodes should be known");
+        if (nt == PointsToNode::JavaObject) {
           add_pointsto_edge(n_idx, ti);
         } else {
           add_deferred_edge(n_idx, ti);