src/hotspot/share/classfile/symbolTable.cpp
changeset 54942 2523496f5107
parent 54927 1512d88b24c6
child 55134 72474808e305
child 58678 9cf78a70fa4f
equal deleted inserted replaced
54941:af28daff6b98 54942:2523496f5107
   479   bool rehash_warning = false;
   479   bool rehash_warning = false;
   480   Symbol* sym = NULL;
   480   Symbol* sym = NULL;
   481   Thread* THREAD = Thread::current();
   481   Thread* THREAD = Thread::current();
   482 
   482 
   483   do {
   483   do {
       
   484     // Callers have looked up the symbol once, insert the symbol.
       
   485     sym = allocate_symbol(name, len, heap);
       
   486     if (_local_table->insert(THREAD, lookup, sym, &rehash_warning, &clean_hint)) {
       
   487       break;
       
   488     }
       
   489     // In case another thread did a concurrent add, return value already in the table.
       
   490     // This could fail if the symbol got deleted concurrently, so loop back until success.
   484     if (_local_table->get(THREAD, lookup, stg, &rehash_warning)) {
   491     if (_local_table->get(THREAD, lookup, stg, &rehash_warning)) {
   485       sym = stg.get_res_sym();
   492       sym = stg.get_res_sym();
   486       break;
       
   487     }
       
   488     sym = allocate_symbol(name, len, heap);
       
   489     if (_local_table->insert(THREAD, lookup, sym, &rehash_warning, &clean_hint)) {
       
   490       break;
   493       break;
   491     }
   494     }
   492   } while(true);
   495   } while(true);
   493 
   496 
   494   update_needs_rehash(rehash_warning);
   497   update_needs_rehash(rehash_warning);