7032162: assert(flat != TypePtr::BOTTOM) failed: cannot alias-analyze an untyped ptr

Reviewed-by: kvn
This commit is contained in:
Tom Rodriguez 2011-04-28 14:00:13 -07:00
parent 2126589fd0
commit eb8db40092
2 changed files with 14 additions and 4 deletions

View file

@ -194,6 +194,16 @@ bool ciObject::can_be_constant() {
// 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();
}