summaryrefslogtreecommitdiff
path: root/gdb/symtab.c
diff options
context:
space:
mode:
authorChristian Biesinger <cbiesinger@google.com>2019-10-03 13:05:06 -0500
committerChristian Biesinger <cbiesinger@google.com>2019-10-03 13:17:12 -0500
commitb4fbb96b58d152194f0ffeefd35eea9a1bd89a52 (patch)
treef368d93c07bc97344b97dfbd909237f24efa7475 /gdb/symtab.c
parente1f6a52ca259c3b9bb4b90022f77ee5c99743ccc (diff)
downloadbinutils-gdb-b4fbb96b58d152194f0ffeefd35eea9a1bd89a52.tar.gz
Precompute hash value for symbol_set_namesusers/cbiesinger/parallel-minsyms-mutex
We can also compute the hash for the mangled name on a background thread so make this function even faster (about a 7% speedup). gdb/ChangeLog: 2019-10-03 Christian Biesinger <cbiesinger@google.com> * minsyms.c (minimal_symbol_reader::install): Also compute the hash of the mangled name on the background thread. * symtab.c (symbol_set_names): Allow passing in the hash of the linkage_name. * symtab.h (symbol_set_names): Likewise.
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r--gdb/symtab.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 47da5cf4e8c..40cc34b2059 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -808,7 +808,7 @@ symbol_find_demangled_name (struct general_symbol_info *gsymbol,
void
symbol_set_names (struct general_symbol_info *gsymbol,
const char *linkage_name, int len, bool copy_name,
- struct objfile_per_bfd_storage *per_bfd)
+ struct objfile_per_bfd_storage *per_bfd, hashval_t hash)
{
struct demangled_name_entry **slot;
/* A 0-terminated copy of the linkage name. */
@@ -854,9 +854,11 @@ symbol_set_names (struct general_symbol_info *gsymbol,
create_demangled_names_hash (per_bfd);
entry.mangled = linkage_name_copy;
+ if (hash == 0)
+ hash = hash_demangled_name_entry (&entry);
slot = ((struct demangled_name_entry **)
- htab_find_slot (per_bfd->demangled_names_hash.get (),
- &entry, INSERT));
+ htab_find_slot_with_hash (per_bfd->demangled_names_hash.get (),
+ &entry, hash, INSERT));
/* If this name is not in the hash table, add it. */
if (*slot == NULL