8019247: SIGSEGV in compiled method c8e.e.t_.getArray(Ljava/lang/Class;)[Ljava/lang/Object
authorkvn
Tue, 02 Jul 2013 10:30:49 -0700
changeset 18505 51e4bfb89d40
parent 18504 b116e46230d2
child 18506 af8765fafc07
8019247: SIGSEGV in compiled method c8e.e.t_.getArray(Ljava/lang/Class;)[Ljava/lang/Object Summary: Undo recent changes (and add more comments) in Ideal_allocation(). Reviewed-by: roland
hotspot/src/share/vm/opto/graphKit.cpp
--- 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()) {