RFR: 8266015: Implement AdapterHandlerLibrary lookup fast-path for common adapters [v4]

Coleen Phillimore coleenp at openjdk.java.net
Fri May 7 16:04:58 UTC 2021


On Mon, 3 May 2021 23:41:09 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
>
> Claes Redestad has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Restructure initializer, reuse AdapterSignatureIterator in create_native_wrapper, minor improvements

This looks good to me!

src/hotspot/share/runtime/sharedRuntime.cpp line 2473:

> 2471:           case T_DOUBLE: st.print("D");    break;
> 2472:           case T_VOID:   break;
> 2473:           default: ShouldNotReachHere();

For some reason, I thought there'd be some mapping from T_INT to JVM_SIGNATURE_INT that you could do
st.print(signature_char(v)); and avoid this work.

-------------

Marked as reviewed by coleenp (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/3706


More information about the hotspot-runtime-dev mailing list