RFR: 8218675: Reduce verification overhead in ClassFileParser
Claes Redestad
claes.redestad at oracle.com
Fri Feb 8 16:07:20 UTC 2019
Hi,
the code to verify method and field signatures in ClassFileParser has a
number of inefficiencies:
- Symbol names are routinely copied into stack- or heap-allocated
buffers.
- In verify_unqualified_name we unnecessarily test to detect non-ASCII
characters: each byte in multi-byte characters will be over > 127, so
it's faster to keep the loop simple. Rewriting as a switch improves it
further (this code is exercised by some internal calls independent of
-Xverify mode)
- skip_over_field_name has a slowpath for non-ASCII doing upcalls to
both Character::isJavaIdentifierStart and
Character::isJavaIdentifierPart for each unicode character - which seems
like a bug...
Webrev: http://cr.openjdk.java.net/~redestad/8218675/open.00/
Bug: https://bugs.openjdk.java.net/browse/JDK-8218675
The now superfluous copying is probably a remnant from a time when
ClassFileParser called out to the separate verifier and had to be
more conservative.
Fixing these issues reduces bytecode verification overhead by ~15%
on a Hello World with -Xshare:off -Xverify:all.
Testing: tier1-3
Thanks!
/Claes
More information about the hotspot-runtime-dev
mailing list