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

Chen Liang liach at openjdk.org
Mon Apr 28 12:29:46 UTC 2025


On Mon, 28 Apr 2025 11:51:23 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> 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/NativeEntryPoint.java line 57:
> 
>> 55:             if (!(o instanceof CacheKey other)) return false;
>> 56: 
>> 57:             return methodType == other.methodType && abi == other.abi && capturedStateMask == other.capturedStateMask
> 
> Is this correct? The old code was using `MethodType::equals`, but now we seem to use `==` instead. I suppose the idea is that method types are interned, and their `equals` method is only really meaningful when checking whether a method type with same shape has already been interned?

Yep, equals are only used on primordial method types for the intern table. Identity is significant for invokers sharing.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24742#discussion_r2063551903


More information about the core-libs-dev mailing list