diff src/share/vm/ci/ciObject.cpp @ 3283:01fd6090fdd8

7032162: assert(flat != TypePtr::BOTTOM) failed: cannot alias-analyze an untyped ptr Reviewed-by: kvn
author never
date Thu, 28 Apr 2011 14:00:13 -0700
parents f95d63e2154a
children 28a9fe9534ea
line wrap: on
line diff
--- a/src/share/vm/ci/ciObject.cpp	Wed Apr 27 15:40:36 2011 -0700
+++ b/src/share/vm/ci/ciObject.cpp	Thu Apr 28 14:00:13 2011 -0700
@@ -194,6 +194,16 @@
 // ciObject::should_be_constant()
 bool ciObject::should_be_constant() {
   if (ScavengeRootsInCode >= 2)  return true;  // force everybody to be a constant
+  if (!JavaObjectsInPerm && !is_null_object()) {
+    // We want Strings and Classes to be embeddable by default since
+    // they used to be in the perm world.  Not all Strings used to be
+    // embeddable but there's no easy way to distinguish the interned
+    // from the regulars ones so just treat them all that way.
+    ciEnv* env = CURRENT_ENV;
+    if (klass() == env->String_klass() || klass() == env->Class_klass()) {
+      return true;
+    }
+  }
   return handle() == NULL || !is_scavengable();
 }