RFR: 8354996: Reduce dynamic code generation for a single downcall [v2]

Viktor Klang vklang at openjdk.org
Tue Apr 22 08:07:55 UTC 2025


On Fri, 18 Apr 2025 18:25:54 GMT, Chen Liang <liach at openjdk.org> wrote:

>> Perf numbers for simple main:
>> Linking of `Class::forName0` down from ~152 to ~83
>> 
>> For calling little color management system https://bugs.openjdk.org/browse/JDK-8313344:
>> JNI: ~45
>> baseline panama: ~164
>> patch: ~103
>> 
>> Also see #24705.
>
> Chen Liang has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Simplify FFM linker warmup

src/java.base/share/classes/jdk/internal/foreign/abi/AbstractLinker.java line 78:

> 76:         @Override
> 77:         public boolean equals(Object obj) {
> 78:             return obj instanceof LinkRequest other &&

Might be worth checking `obj == this || obj instanceof ...`

src/java.base/share/classes/jdk/internal/foreign/abi/LinkerOptions.java line 149:

> 147:         @Override
> 148:         public boolean equals(Object obj) {
> 149:             return obj instanceof FirstVariadicArg that && index == that.index;

Might be worth checking `obj == this || obj instanceof ...`

src/java.base/share/classes/jdk/internal/foreign/abi/NativeEntryPoint.java line 56:

> 54:         public boolean equals(Object o) {
> 55:             if (!(o instanceof CacheKey other)) return false;
> 56: 

Might be worth checking `o == this`

src/java.base/share/classes/jdk/internal/foreign/abi/VMStorage.java line 55:

> 53:     @Override
> 54:     public boolean equals(Object obj) {
> 55:         return obj instanceof VMStorage that &&

Might be worth checking `obj == this || obj instanceof ...`

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24742#discussion_r2053566427
PR Review Comment: https://git.openjdk.org/jdk/pull/24742#discussion_r2053566702
PR Review Comment: https://git.openjdk.org/jdk/pull/24742#discussion_r2053569651
PR Review Comment: https://git.openjdk.org/jdk/pull/24742#discussion_r2053568877


More information about the core-libs-dev mailing list