528 assert(!Universe::heap()->is_in_reserved(name) || GC_locker::is_active(), |
528 assert(!Universe::heap()->is_in_reserved(name) || GC_locker::is_active(), |
529 "proposed name of symbol must be stable"); |
529 "proposed name of symbol must be stable"); |
530 |
530 |
531 Handle string; |
531 Handle string; |
532 // try to reuse the string if possible |
532 // try to reuse the string if possible |
533 if (!string_or_null.is_null() && string_or_null()->is_perm()) { |
533 if (!string_or_null.is_null() && (!JavaObjectsInPerm || string_or_null()->is_perm())) { |
534 string = string_or_null; |
534 string = string_or_null; |
535 } else { |
535 } else { |
536 string = java_lang_String::create_tenured_from_unicode(name, len, CHECK_NULL); |
536 string = java_lang_String::create_tenured_from_unicode(name, len, CHECK_NULL); |
537 } |
537 } |
538 |
538 |
660 for (int i = 0; i < the_table()->table_size(); ++i) { |
660 for (int i = 0; i < the_table()->table_size(); ++i) { |
661 HashtableEntry<oop>* p = the_table()->bucket(i); |
661 HashtableEntry<oop>* p = the_table()->bucket(i); |
662 for ( ; p != NULL; p = p->next()) { |
662 for ( ; p != NULL; p = p->next()) { |
663 oop s = p->literal(); |
663 oop s = p->literal(); |
664 guarantee(s != NULL, "interned string is NULL"); |
664 guarantee(s != NULL, "interned string is NULL"); |
665 guarantee(s->is_perm(), "interned string not in permspace"); |
665 guarantee(s->is_perm() || !JavaObjectsInPerm, "interned string not in permspace"); |
666 |
666 |
667 int length; |
667 int length; |
668 jchar* chars = java_lang_String::as_unicode_string(s, length); |
668 jchar* chars = java_lang_String::as_unicode_string(s, length); |
669 unsigned int h = hash_string(chars, length); |
669 unsigned int h = hash_string(chars, length); |
670 guarantee(p->hash() == h, "broken hash in string table entry"); |
670 guarantee(p->hash() == h, "broken hash in string table entry"); |