hotspot/src/share/vm/opto/graphKit.cpp
changeset 18505 51e4bfb89d40
parent 17383 3665c0901a0d
child 19709 33aa3e85cc75
--- a/hotspot/src/share/vm/opto/graphKit.cpp	Mon Jul 01 14:14:16 2013 -0700
+++ b/hotspot/src/share/vm/opto/graphKit.cpp	Tue Jul 02 10:30:49 2013 -0700
@@ -3332,9 +3332,14 @@
   if (ptr == NULL) {     // reduce dumb test in callers
     return NULL;
   }
-  ptr = ptr->uncast();  // strip a raw-to-oop cast
-  if (ptr == NULL)  return NULL;
-
+  if (ptr->is_CheckCastPP()) { // strip only one raw-to-oop cast
+    ptr = ptr->in(1);
+    if (ptr == NULL) return NULL;
+  }
+  // Return NULL for allocations with several casts:
+  //   j.l.reflect.Array.newInstance(jobject, jint)
+  //   Object.clone()
+  // to keep more precise type from last cast.
   if (ptr->is_Proj()) {
     Node* allo = ptr->in(0);
     if (allo != NULL && allo->is_Allocate()) {