RFR: 8266015: Implement AdapterHandlerLibrary lookup fast-path for common adapters
Claes Redestad
redestad at openjdk.java.net
Wed Apr 28 14:56:13 UTC 2021
On Tue, 27 Apr 2021 00:27:56 GMT, Claes Redestad <redestad at openjdk.org> wrote:
> This patch refactors AdapterHandlerLibrary initialization so that we can initialize a handful of commonly used adapters early during bootstrap, and avoid taking the AdapterHandlerLibrary_lock when looking up these adapters.
>
> Since the 5 most common adapters plus the abstract adapter constitutes roughly 60% of the method shapes loaded and linked on a Hello World, this means a relatively significant startup optimization (~2M insns on Hello World); most of the win is in lookup code that will be a significant part of the cost of class loading even when no adapters need to be generated.
>
> This enhancement partially recuperates the regression reported in https://bugs.openjdk.java.net/browse/JDK-8265523
To avoid making this code more complex, and enable splitting apart `get_adapter`, this patch simplifies the output for the develop flag `PrintAdapterHandlers` somewhat. Before this would arbitrarily print the signature of the method that happen to cause the adapter to be generated. Since adapters for methods with the same basic type arguments are shared it makes more sense to distill to BasicType strings.
Before:
AHE at 0x00007efc503007a0: 0xbaabbaa0 i2c: 0x00007efc399484e0 c2i: 0x00007efc399485e2 c2iUV: 0x00007efc399485a8 c2iNCI: 0x00007efc3994861f
i2c argument handler #246 for: static ([Ljava/lang/Object;IILjava/util/Comparator;[Ljava/lang/Object;II)V 0xbaabbaa0 (614 bytes generated)
c2i argument handler starts at 0x7efc399485e2
After:
AHE at 0x00007fc28c2f6850: 0x0baabbaa i2c: 0x00007fc27570d460 c2i: 0x00007fc27570d562 c2iUV: 0x00007fc27570d528 c2iNCI: 0x00007fc27570d59f
i2c argument handler #244 for: LIILLII 0x0baabbaa (614 bytes generated)
c2i argument handler starts at 0x7fc27570d562
-------------
PR: https://git.openjdk.java.net/jdk/pull/3706
More information about the hotspot-runtime-dev
mailing list