mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8219554: Redundant lookup_common in SymbolTable::add
Reviewed-by: iklam, coleenp, mikael
This commit is contained in:
parent
504562b3a4
commit
c97af8c3f7
2 changed files with 6 additions and 15 deletions
|
@ -436,18 +436,16 @@ Symbol* SymbolTable::lookup_only_unicode(const jchar* name, int utf16_length,
|
|||
}
|
||||
}
|
||||
|
||||
void SymbolTable::add(ClassLoaderData* loader_data, const constantPoolHandle& cp,
|
||||
int names_count, const char** names, int* lengths,
|
||||
int* cp_indices, unsigned int* hashValues, TRAPS) {
|
||||
void SymbolTable::new_symbols(ClassLoaderData* loader_data, const constantPoolHandle& cp,
|
||||
int names_count, const char** names, int* lengths,
|
||||
int* cp_indices, unsigned int* hashValues, TRAPS) {
|
||||
bool c_heap = !loader_data->is_the_null_class_loader_data();
|
||||
for (int i = 0; i < names_count; i++) {
|
||||
const char *name = names[i];
|
||||
int len = lengths[i];
|
||||
unsigned int hash = hashValues[i];
|
||||
Symbol* sym = SymbolTable::the_table()->lookup_common(name, len, hash);
|
||||
if (sym == NULL) {
|
||||
sym = SymbolTable::the_table()->do_add_if_needed(name, len, hash, c_heap, CHECK);
|
||||
}
|
||||
assert(SymbolTable::the_table()->lookup_shared(name, len, hash) == NULL, "must have checked already");
|
||||
Symbol* sym = SymbolTable::the_table()->do_add_if_needed(name, len, hash, c_heap, CHECK);
|
||||
assert(sym->refcount() != 0, "lookup should have incremented the count");
|
||||
cp->symbol_at_put(cp_indices[i], sym);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue