src/share/vm/classfile/symbolTable.cpp

changeset 5785
a5ac0873476c
parent 5784
190899198332
parent 5775
461159cd7a91
child 6229
5a32d2a3cc1e
equal deleted inserted replaced
5784:190899198332 5785:a5ac0873476c
339 return table->basic_add(index, (u1*)name, (int)strlen(name), hash, false, THREAD); 339 return table->basic_add(index, (u1*)name, (int)strlen(name), hash, false, THREAD);
340 } 340 }
341 341
342 Symbol* SymbolTable::basic_add(int index_arg, u1 *name, int len, 342 Symbol* SymbolTable::basic_add(int index_arg, u1 *name, int len,
343 unsigned int hashValue_arg, bool c_heap, TRAPS) { 343 unsigned int hashValue_arg, bool c_heap, TRAPS) {
344 assert(!Universe::heap()->is_in_reserved(name) || GC_locker::is_active(), 344 assert(!Universe::heap()->is_in_reserved(name),
345 "proposed name of symbol must be stable"); 345 "proposed name of symbol must be stable");
346 346
347 // Don't allow symbols to be created which cannot fit in a Symbol*. 347 // Don't allow symbols to be created which cannot fit in a Symbol*.
348 if (len > Symbol::max_length()) { 348 if (len > Symbol::max_length()) {
349 THROW_MSG_0(vmSymbols::java_lang_InternalError(), 349 THROW_MSG_0(vmSymbols::java_lang_InternalError(),
683 683
684 // Found 684 // Found
685 if (found_string != NULL) return found_string; 685 if (found_string != NULL) return found_string;
686 686
687 debug_only(StableMemoryChecker smc(name, len * sizeof(name[0]))); 687 debug_only(StableMemoryChecker smc(name, len * sizeof(name[0])));
688 assert(!Universe::heap()->is_in_reserved(name) || GC_locker::is_active(), 688 assert(!Universe::heap()->is_in_reserved(name),
689 "proposed name of symbol must be stable"); 689 "proposed name of symbol must be stable");
690 690
691 Handle string; 691 Handle string;
692 // try to reuse the string if possible 692 // try to reuse the string if possible
693 if (!string_or_null.is_null()) { 693 if (!string_or_null.is_null()) {

mercurial