changeset 11078:2b3fe74309b6

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
author kvn
date Tue, 02 Jul 2013 10:30:49 -0700
parents a023ec3452c7
children 738e04fb1232
files src/share/vm/opto/graphKit.cpp
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/opto/graphKit.cpp	Mon Jul 01 14:14:16 2013 -0700
+++ b/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()) {