# HG changeset patch # User never # Date 1304024413 25200 # Node ID 01fd6090fdd89335c8ea4f82e10a5fe69193c5bb # Parent 149bb459be66b086b0c695b74be74bffc99f9f4f 7032162: assert(flat != TypePtr::BOTTOM) failed: cannot alias-analyze an untyped ptr Reviewed-by: kvn diff -r 149bb459be66 -r 01fd6090fdd8 src/share/vm/ci/ciObject.cpp --- 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(); } diff -r 149bb459be66 -r 01fd6090fdd8 src/share/vm/opto/stringopts.cpp --- a/src/share/vm/opto/stringopts.cpp Wed Apr 27 15:40:36 2011 -0700 +++ b/src/share/vm/opto/stringopts.cpp Thu Apr 28 14:00:13 2011 -0700 @@ -1172,16 +1172,16 @@ Node* PhaseStringOpts::copy_string(GraphKit& kit, Node* str, Node* char_array, Node* start) { Node* string = str; - Node* offset = kit.make_load(NULL, + Node* offset = kit.make_load(kit.control(), kit.basic_plus_adr(string, string, java_lang_String::offset_offset_in_bytes()), TypeInt::INT, T_INT, offset_field_idx); - Node* count = kit.make_load(NULL, + Node* count = kit.make_load(kit.control(), kit.basic_plus_adr(string, string, java_lang_String::count_offset_in_bytes()), TypeInt::INT, T_INT, count_field_idx); const TypeAryPtr* value_type = TypeAryPtr::make(TypePtr::NotNull, TypeAry::make(TypeInt::CHAR,TypeInt::POS), ciTypeArrayKlass::make(T_CHAR), true, 0); - Node* value = kit.make_load(NULL, + Node* value = kit.make_load(kit.control(), kit.basic_plus_adr(string, string, java_lang_String::value_offset_in_bytes()), value_type, T_OBJECT, value_field_idx); @@ -1342,7 +1342,7 @@ } // Node* offset = kit.make_load(NULL, kit.basic_plus_adr(arg, arg, offset_offset), // TypeInt::INT, T_INT, offset_field_idx); - Node* count = kit.make_load(NULL, kit.basic_plus_adr(arg, arg, java_lang_String::count_offset_in_bytes()), + Node* count = kit.make_load(kit.control(), kit.basic_plus_adr(arg, arg, java_lang_String::count_offset_in_bytes()), TypeInt::INT, T_INT, count_field_idx); length = __ AddI(length, count); string_sizes->init_req(argi, NULL);