mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-01 17:27:15 +08:00
Speed up dict_hash
This speeds up dict_hash a bit, by moving the "TKB" check into the switch in the loop. For "gdb -nx -readnow -batch gdb", this improves the time from ~9.8s before to ~8.5s afterward. gdb/ChangeLog 2017-11-09 Tom Tromey <tom@tromey.com> * dictionary.c (dict_hash): Move "TKB" check into the "switch".
This commit is contained in:
@ -1,3 +1,7 @@
|
|||||||
|
2017-11-09 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
|
* dictionary.c (dict_hash): Move "TKB" check into the "switch".
|
||||||
|
|
||||||
2017-11-08 Joel Brobecker <brobecker@adacore.com>
|
2017-11-08 Joel Brobecker <brobecker@adacore.com>
|
||||||
|
|
||||||
* ada-exp.y (write_var_from_sym): Remove parameter
|
* ada-exp.y (write_var_from_sym): Remove parameter
|
||||||
|
@ -790,17 +790,6 @@ default_search_name_hash (const char *string0)
|
|||||||
hash = 0;
|
hash = 0;
|
||||||
while (*string)
|
while (*string)
|
||||||
{
|
{
|
||||||
/* Ignore "TKB" suffixes.
|
|
||||||
|
|
||||||
These are used by Ada for subprograms implementing a task body.
|
|
||||||
For instance for a task T inside package Pck, the name of the
|
|
||||||
subprogram implementing T's body is `pck__tTKB'. We need to
|
|
||||||
ignore the "TKB" suffix because searches for this task body
|
|
||||||
subprogram are going to be performed using `pck__t' (the encoded
|
|
||||||
version of the natural name `pck.t'). */
|
|
||||||
if (strcmp (string, "TKB") == 0)
|
|
||||||
return hash;
|
|
||||||
|
|
||||||
switch (*string)
|
switch (*string)
|
||||||
{
|
{
|
||||||
case '$':
|
case '$':
|
||||||
@ -822,14 +811,25 @@ default_search_name_hash (const char *string0)
|
|||||||
return hash;
|
return hash;
|
||||||
hash = 0;
|
hash = 0;
|
||||||
string += 2;
|
string += 2;
|
||||||
break;
|
continue;
|
||||||
}
|
}
|
||||||
/* FALL THROUGH */
|
break;
|
||||||
default:
|
case 'T':
|
||||||
hash = SYMBOL_HASH_NEXT (hash, *string);
|
/* Ignore "TKB" suffixes.
|
||||||
string += 1;
|
|
||||||
|
These are used by Ada for subprograms implementing a task body.
|
||||||
|
For instance for a task T inside package Pck, the name of the
|
||||||
|
subprogram implementing T's body is `pck__tTKB'. We need to
|
||||||
|
ignore the "TKB" suffix because searches for this task body
|
||||||
|
subprogram are going to be performed using `pck__t' (the encoded
|
||||||
|
version of the natural name `pck.t'). */
|
||||||
|
if (strcmp (string, "TKB") == 0)
|
||||||
|
return hash;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hash = SYMBOL_HASH_NEXT (hash, *string);
|
||||||
|
string += 1;
|
||||||
}
|
}
|
||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user