8058746: escape analysis special case code for array copy broken by 7173584
authorroland
Mon, 06 Oct 2014 14:53:30 +0200
changeset 27142 31444af8b365
parent 27019 e326bfa8aeed
child 27145 8de2f4b629fb
8058746: escape analysis special case code for array copy broken by 7173584 Summary: escape analysis doesn't handler arraycopy nodes properly Reviewed-by: kvn, iveresov, vlivanov
hotspot/src/share/vm/opto/escape.cpp
--- a/hotspot/src/share/vm/opto/escape.cpp	Fri Oct 10 02:24:35 2014 -0700
+++ b/hotspot/src/share/vm/opto/escape.cpp	Mon Oct 06 14:53:30 2014 +0200
@@ -882,9 +882,14 @@
       assert(false, "should be done already");
       break;
 #endif
+    case Op_ArrayCopy:
     case Op_CallLeafNoFP:
-      is_arraycopy = (call->as_CallLeaf()->_name != NULL &&
-                      strstr(call->as_CallLeaf()->_name, "arraycopy") != 0);
+      // Most array copies are ArrayCopy nodes at this point but there
+      // are still a few direct calls to the copy subroutines (See
+      // PhaseStringOpts::copy_string())
+      is_arraycopy = (call->Opcode() == Op_ArrayCopy) ||
+        (call->as_CallLeaf()->_name != NULL &&
+         strstr(call->as_CallLeaf()->_name, "arraycopy") != 0);
       // fall through
     case Op_CallLeaf: {
       // Stub calls, objects do not escape but they are not scale replaceable.
@@ -894,6 +899,9 @@
       for (uint i = TypeFunc::Parms; i < d->cnt(); i++) {
         const Type* at = d->field_at(i);
         Node *arg = call->in(i);
+        if (arg == NULL) {
+          continue;
+        }
         const Type *aat = _igvn->type(arg);
         if (arg->is_top() || !at->isa_ptr() || !aat->isa_ptr())
           continue;