Attribute method inlining
This inlines a couple of methods on struct attribute, improving the
performance of DWARF partial symbol reading. These methods were
discovered as hot spots using callgrind.
For this patch, and for all the patches in this series, I tested gdb's
performance on three programs:
1. gdb itself -- I built gdb and copied it to /tmp, ensuring that the
same version was used in all tests.
2. The system libxul.so, the main library of Firefox. I installed the
separate debuginfo and ensured that gdb read it.
3. A large-ish Ada program that I happen to have.
I ran gdb 10 times like:
/bin/time -f %e \
./gdb/gdb --data-directory ./gdb/data-directory -nx \
-iex 'set debug-file-directory /usr/lib/debug' \
-batch $X
... where $X was the test executable. Then I computed the mean time.
This was all done with a standard (-g -O2) build of gdb.
The baseline times were
gdb 1.90
libxul 2.12
Ada 2.61
This patch brings the numbers down to
gdb 1.88
libxul 2.11
Ada 2.60
Not a huge change, but still visible in the results.
gdb/ChangeLog
2020-05-27 Tom Tromey <tromey@adacore.com>
* dwarf2/attribute.h (struct attribute) <form_is_ref>: Inline.
<get_ref_die_offset>: Inline.
<get_ref_die_offset_complaint>: New method.
* dwarf2/attribute.c (attribute::form_is_ref): Move to header.
(attribute::get_ref_die_offset_complaint): Rename from
get_ref_die_offset. Just issue complaint.