RFR: 8312522: Implementation of Foreign Function & Memory API [v11]
Jorn Vernee
jvernee at openjdk.org
Wed Sep 6 10:54:46 UTC 2023
On Wed, 6 Sep 2023 10:46:33 GMT, Martin Doerr <mdoerr at openjdk.org> wrote:
>> Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Fix typo in doc
>>
>> Co-authored-by: Paul Sandoz <paul.d.sandoz at googlemail.com>
>
> Please adapt the new `LinuxPPC64Linker` when merging:
>
> diff --git a/src/java.base/share/classes/jdk/internal/foreign/abi/ppc64/linux/LinuxPPC64Linker.java b/src/java.base/share/classes/jdk/inter
> nal/foreign/abi/ppc64/linux/LinuxPPC64Linker.java
> index 150687d4078..7cf2d524bff 100644
> --- a/src/java.base/share/classes/jdk/internal/foreign/abi/ppc64/linux/LinuxPPC64Linker.java
> +++ b/src/java.base/share/classes/jdk/internal/foreign/abi/ppc64/linux/LinuxPPC64Linker.java
> @@ -27,15 +27,22 @@
>
> import jdk.internal.foreign.abi.AbstractLinker;
> import jdk.internal.foreign.abi.LinkerOptions;
> +import jdk.internal.foreign.abi.SharedUtils;
> import jdk.internal.foreign.abi.ppc64.CallArranger;
>
> import java.lang.foreign.FunctionDescriptor;
> +import java.lang.foreign.MemoryLayout;
> +import java.lang.foreign.ValueLayout;
> import java.lang.invoke.MethodHandle;
> import java.lang.invoke.MethodType;
> import java.nio.ByteOrder;
> +import java.util.Map;
>
> public final class LinuxPPC64Linker extends AbstractLinker {
>
> + static final Map<String, MemoryLayout> CANONICAL_LAYOUTS =
> + SharedUtils.canonicalLayouts(ValueLayout.JAVA_LONG, ValueLayout.JAVA_LONG, ValueLayout.JAVA_INT);
> +
> public static LinuxPPC64Linker getInstance() {
> final class Holder {
> private static final LinuxPPC64Linker INSTANCE = new LinuxPPC64Linker();
> @@ -62,4 +69,9 @@ protected UpcallStubFactory arrangeUpcall(MethodType targetType, FunctionDescrip
> protected ByteOrder linkerByteOrder() {
> return ByteOrder.BIG_ENDIAN;
> }
> +
> + @Override
> + public Map<String, MemoryLayout> canonicalLayouts() {
> + return CANONICAL_LAYOUTS;
> + }
> }
>
> The `test/jdk/java/foreign` tests have passed on both, linux PPC64 and PPC64le.
@TheRealMDoerr Thanks for the patch, will include it.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/15103#issuecomment-1708114403
More information about the build-dev
mailing list