On Tue, 17 May 2022 06:00:37 GMT, Rémi Forax <[email protected]> wrote:
>> Jorn Vernee has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> BootstrapMethodError -> ExceptionInInitializerError
>
> src/java.base/share/classes/jdk/internal/foreign/abi/BindingSpecializer.java
> line 157:
>
>> 155: }
>> 156:
>> 157: static MethodHandle doSpecialize(MethodHandle leafHandle,
>> CallingSequence callingSequence, ABIDescriptor abi) {
>
> I think thise method should be split in to, one version for the upcall, one
> for the downcall, i do not see the point of merging the two codes.
I've split this method into a specializeDowncall and specializeUpcall method.
> src/java.base/share/classes/jdk/internal/foreign/abi/BindingSpecializer.java
> line 816:
>
>> 814: return;
>> 815: }
>> 816: if (con instanceof Integer) {
>
> those can use the instanceof + type pattern
Done
> src/java.base/share/classes/jdk/internal/foreign/abi/BindingSpecializer.java
> line 967:
>
>> 965:
>> 966: // unaligned constants
>> 967: public final static ValueLayout.OfBoolean JAVA_BOOLEAN_UNALIGNED =
>> JAVA_BOOLEAN;
>
> as far as i understand, those constants are accessed from the bytecode, they
> should be in their own class to cleanly separate the specializer part and the
> runtime part.
I've put these in a nest `Runtime` class, with a comment explaining that they
are referenced from the generated code.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8685