[review v6] Compute msymbol hash codes in parallel
Christian Biesinger (Code Review)
gerrit@gnutoolchain-gerrit.osci.io
Tue Nov 26 22:25:00 GMT 2019
Christian Biesinger has posted comments on this change.
Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/308
......................................................................
Patch Set 6:
(2 comments)
| --- gdb/minsyms.c
| +++ gdb/minsyms.c
| @@ -1256,17 +1254,19 @@ clear_minimal_symbol_hash_tables (struct objfile *objfile)
| objfile->per_bfd->msymbol_hash[i] = 0;
| objfile->per_bfd->msymbol_demangled_hash[i] = 0;
| }
| }
|
| struct computed_hash_values
| {
| size_t name_length;
| hashval_t mangled_name_hash;
| + unsigned int minsym_hash;
| + unsigned int minsym_demangled_hash;
PS5, Line 1264:
Done
| };
|
| /* Build (or rebuild) the minimal symbol hash tables. This is necessary
| after compacting or sorting the table since the entries move around
| thus causing the internal minimal_symbol pointers to become jumbled. */
|
| static void
| -build_minimal_symbol_hash_tables (struct objfile *objfile)
| +build_minimal_symbol_hash_tables
...
| @@ -1396,16 +1401,21 @@ #endif
| (msym, demangled_name,
| &m_objfile->per_bfd->storage_obstack);
| msym->name_set = 1;
|
| hash_values[idx].mangled_name_hash
| = fast_hash (msym->name, hash_values[idx].name_length);
| }
| + hash_values[idx].minsym_hash
| + = msymbol_hash (msym->linkage_name ());
| + hash_values[idx].minsym_demangled_hash
| + = search_name_hash (MSYMBOL_LANGUAGE (msym),
| + msym->search_name ());
PS5, Line 1412:
Done (that is, I am computing this is search_name != linkage_name
matching the code in build_minimal_symbol_hash_tables)
| }
| {
| /* To limit how long we hold the lock, we only acquire it here
| and not while we demangle the names above. */
| #if CXX_STD_THREAD
| std::lock_guard<std::mutex> guard (demangled_mutex);
| #endif
| for (minimal_symbol *msym = start; msym < end; ++msym)
| {
--
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: Ifaa3346e9998f05743bff9e2eaad3f83b954d071
Gerrit-Change-Number: 308
Gerrit-PatchSet: 6
Gerrit-Owner: Christian Biesinger <cbiesinger@google.com>
Gerrit-Reviewer: Christian Biesinger <cbiesinger@google.com>
Gerrit-Reviewer: Tom Tromey <tromey@sourceware.org>
Gerrit-Comment-Date: Tue, 26 Nov 2019 22:25:18 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Tom Tromey <tromey@sourceware.org>
Gerrit-MessageType: comment
More information about the Gdb-patches
mailing list