changeset 27142:31444af8b365

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
author roland
date Mon, 06 Oct 2014 14:53:30 +0200
parents e326bfa8aeed
children 8de2f4b629fb
files hotspot/src/share/vm/opto/escape.cpp
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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;