Re: RFR: 8312522: Implementation of Foreign Function & Memory API [v2]

2023-08-10 Thread Jorn Vernee
ama-foreign/pull/849 Several test fixes to > make sure the `jdk_foreign` tests can pass on 32-bit machines, taking > linux-x86 as a test bed. > 9. https://github.com/openjdk/panama-foreign/pull/850 Make the linker API > required. The `Linker::nativeLinker` method is not longer allo

Re: RFR: 8312522: Implementation of Foreign Function & Memory API

2023-08-10 Thread Jorn Vernee
On Tue, 1 Aug 2023 10:29:06 GMT, Jorn Vernee wrote: > This patch contains the implementation of the foreign linker & memory API JEP > for Java 22. The initial patch is composed of commits brought over directly > from the [panama-foreign repo](https://github.com/openjdk/panama-for

Integrated: 8313889: Fix -Wconversion warnings in foreign benchmarks

2023-08-08 Thread Jorn Vernee
On Mon, 7 Aug 2023 14:40:42 GMT, Jorn Vernee wrote: > Fix these -Wconversion warnings in the foreign benchmarks: > > > ./test/micro/org/openjdk/bench/java/lang/foreign/libQSortJNI.c: In function > ‘Java_org_openjdk_bench_java_lang_foreign_QSort_jni_1qsort_1optimized’: >

RFR: 8313889: Fix -Wconversion warnings in foreign benchmarks

2023-08-07 Thread Jorn Vernee
Fix these -Wconversion warnings in the foreign benchmarks: ./test/micro/org/openjdk/bench/java/lang/foreign/libQSortJNI.c: In function ‘Java_org_openjdk_bench_java_lang_foreign_QSort_jni_1qsort_1optimized’: ./test/micro/org/openjdk/bench/java/lang/foreign/libQSortJNI.c:59:17: warning: conversio

Re: RFR: 8310643: Misformatted copyright messages in FFM [v3]

2023-08-07 Thread Jorn Vernee
On Mon, 7 Aug 2023 10:53:20 GMT, Per Minborg wrote: >> This PR suggests updating some of the ill-formed copyright headers in the >> FFM API and the implementation and test thereof. >> >> Some of the test files will have now the "classpath" exception. Is this >> correct? > > Per Minborg has upd

Re: RFR: 8310643: Misformatted copyright messages in FFM [v2]

2023-08-07 Thread Jorn Vernee
On Mon, 7 Aug 2023 08:57:56 GMT, Per Minborg wrote: >> This PR suggests updating some of the ill-formed copyright headers in the >> FFM API and the implementation and test thereof. >> >> Some of the test files will have now the "classpath" exception. Is this >> correct? > > Per Minborg has upd

Re: RFR: 8313406: nep_invoker_blob can be simplified more

2023-08-02 Thread Jorn Vernee
On Thu, 3 Aug 2023 04:07:27 GMT, Yasumasa Suenaga wrote: > then shuffling would remain somewhare even if we could eliminate them from > NEP stub. Since things on the Java side are visible to the JIT, it should be able to avoid the extra data motion. > Thus this topic would be lower priority i

Re: RFR: 8313406: nep_invoker_blob can be simplified more

2023-08-02 Thread Jorn Vernee
On Wed, 2 Aug 2023 12:35:50 GMT, Yasumasa Suenaga wrote: > I guess you suggested that ArgumentShuffle in HotSpot moves into > DowncallLinker, right? No, ArgumentShuffle should stay inside HotSpot. We can not do all the shuffling on the Java side. We can only eliminate some of the register move

[jdk21] Integrated: 8313023: Return value corrupted when using CCS + isTrivial (mainline)

2023-08-02 Thread Jorn Vernee
On Mon, 31 Jul 2023 08:13:55 GMT, Jorn Vernee wrote: > Hi all, > > This pull request contains a backport of commit > [6fca2898](https://github.com/openjdk/jdk/commit/6fca28988794b52a6aa974bed1ed6f4f07e0994b) > from the [openjdk/jdk](https://git.openjdk.org/jdk) repository.

Re: RFR: 8313406: nep_invoker_blob can be simplified more

2023-08-01 Thread Jorn Vernee
On Mon, 31 Jul 2023 12:22:00 GMT, Yasumasa Suenaga wrote: > In FFM, native function would be called via `nep_invoker_blob`. If the > function has two arguments, it would be following: > > > Decoding RuntimeStub - nep_invoker_blob 0x7fcae394cd10 > ---

Re: RFR: 8312522: Implementation of Foreign Function & Memory API

2023-08-01 Thread Jorn Vernee
On Tue, 1 Aug 2023 11:17:57 GMT, ExE Boss wrote: >> This patch contains the implementation of the foreign linker & memory API >> JEP for Java 22. The initial patch is composed of commits brought over >> directly from the [panama-foreign >> repo](https://github.com/openjdk/panama-foreign). The

Re: RFR: 8312522: Implementation of Foreign Function & Memory API

2023-08-01 Thread Jorn Vernee
On Tue, 1 Aug 2023 10:29:06 GMT, Jorn Vernee wrote: > This patch contains the implementation of the foreign linker & memory API JEP > for Java 22. The initial patch is composed of commits brought over directly > from the [panama-foreign repo](https://github.com/openjdk/panama-for

RFR: 8312522: Implementation of Foreign Function & Memory API

2023-08-01 Thread Jorn Vernee
This patch contains the implementation of the foreign linker & memory API JEP for Java 22. The initial patch is composed of commits brought over directly from the [panama-foreign repo](https://github.com/openjdk/panama-foreign). The main changes found in this patch come from the following PRs:

Re: RFR: 8313406: nep_invoker_blob can be simplified more

2023-08-01 Thread Jorn Vernee
On Mon, 31 Jul 2023 12:22:00 GMT, Yasumasa Suenaga wrote: > In FFM, native function would be called via `nep_invoker_blob`. If the > function has two arguments, it would be following: > > > Decoding RuntimeStub - nep_invoker_blob 0x7fcae394cd10 > ---

Re: RFR: 8313406: nep_invoker_blob can be simplified more

2023-07-31 Thread Jorn Vernee
On Mon, 31 Jul 2023 12:22:00 GMT, Yasumasa Suenaga wrote: > In FFM, native function would be called via `nep_invoker_blob`. If the > function has two arguments, it would be following: > > > Decoding RuntimeStub - nep_invoker_blob 0x7fcae394cd10 > ---

[jdk21] RFR: 8313023: Return value corrupted when using CCS + isTrivial (mainline)

2023-07-31 Thread Jorn Vernee
Hi all, This pull request contains a backport of commit [6fca2898](https://github.com/openjdk/jdk/commit/6fca28988794b52a6aa974bed1ed6f4f07e0994b) from the [openjdk/jdk](https://git.openjdk.org/jdk) repository. The commit being backported was authored by Jorn Vernee on 31 Jul 2023 and was

Re: RFR: 8311630: [s390] Implementation of Foreign Function & Memory API (Preview) [v6]

2023-07-31 Thread Jorn Vernee
On Fri, 28 Jul 2023 03:59:26 GMT, sid8606 wrote: >> Implementation of "Foreign Function & Memory API" for s390x (Big Endian). > > sid8606 has updated the pull request incrementally with one additional commit > since the last revision: > > Preserve and restore register Z_R6 > > Though Z_R

Integrated: 8313023: Return value corrupted when using CCS + isTrivial (mainline)

2023-07-31 Thread Jorn Vernee
On Tue, 25 Jul 2023 19:17:38 GMT, Jorn Vernee wrote: > Port of: https://github.com/openjdk/panama-foreign/pull/848 from the > panama-foreign repo. > > Copying the PR body here for convenience: > > Due to a bug in the downcall linker stub generation, we don't save t

Re: RFR: 8310643: Misformatted copyright messages in FFM

2023-07-26 Thread Jorn Vernee
On Wed, 26 Jul 2023 15:43:12 GMT, Per Minborg wrote: > Some of the test files will have now the "classpath" exception. Is this > correct? No. The test files should not have the classpath exception. - PR Comment: https://git.openjdk.org/jdk/pull/15042#issuecomment-1652367609

Re: RFR: 8313023: Return value corrupted when using CCS + isTrivial (mainline)

2023-07-25 Thread Jorn Vernee
On Tue, 25 Jul 2023 19:17:38 GMT, Jorn Vernee wrote: > Port of: https://github.com/openjdk/panama-foreign/pull/848 from the > panama-foreign repo. > > Copying the PR body here for convenience: > > Due to a bug in the downcall linker stub generation, we don't save t

Re: RFR: 8311630: [s390] Implementation of Foreign Function & Memory API (Preview) [v3]

2023-07-25 Thread Jorn Vernee
On Sat, 8 Jul 2023 10:48:15 GMT, sid8606 wrote: >> Implementation of "Foreign Function & Memory API" for s390x (Big Endian). > > sid8606 has updated the pull request incrementally with one additional commit > since the last revision: > > Address suggestion

RFR: 8313023: Return value corrupted when using CCS + isTrivial (mainline)

2023-07-25 Thread Jorn Vernee
Port of: https://github.com/openjdk/panama-foreign/pull/848 from the panama-foreign repo. Copying the PR body here for convenience: Due to a bug in the downcall linker stub generation, we don't save the return value when capturing call state for trivial functions, and the return value gets cor

Re: RFR: JDK-8311822: AIX : test/jdk/java/foreign/TestLayouts.java fails because of different output - expected [[i4](struct)] but found [[I4](struct)]

2023-07-24 Thread Jorn Vernee
On Mon, 24 Jul 2023 09:51:33 GMT, Per Minborg wrote: > This PR suggests making a test independent of the underlying platform byte > ordering and to test both ordering variants rather than just one. Marked as reviewed by jvernee (Reviewer). - PR Review: https://git.openjdk.org/jdk/

Re: RFR: 8311630: [s390] Implementation of Foreign Function & Memory API (Preview) [v3]

2023-07-21 Thread Jorn Vernee
On Sat, 8 Jul 2023 10:48:15 GMT, sid8606 wrote: >> Implementation of "Foreign Function & Memory API" for s390x (Big Endian). > > sid8606 has updated the pull request incrementally with one additional commit > since the last revision: > > Address suggestion

Re: RFR: 8311630: [s390] Implementation of Foreign Function & Memory API (Preview) [v3]

2023-07-21 Thread Jorn Vernee
On Sat, 8 Jul 2023 10:48:15 GMT, sid8606 wrote: >> Implementation of "Foreign Function & Memory API" for s390x (Big Endian). > > sid8606 has updated the pull request incrementally with one additional commit > since the last revision: > > Address suggestions

Re: RFR: 8199149: Improve the exception message thrown by VarHandle of unsupported operation [v5]

2023-07-20 Thread Jorn Vernee
On Thu, 20 Jul 2023 16:53:14 GMT, Mandy Chung wrote: >> `VarForm::getMemberName` currently throws UOE with no information if the >> requested access mode is unsupported. To provide the var handle >> information, move the access mode check to `VarHandle` so that the exception >> message can i

Re: RFR: 8199149: Improve the exception message thrown by VarHandle of unsupported operation [v4]

2023-07-20 Thread Jorn Vernee
On Thu, 20 Jul 2023 15:53:10 GMT, Chen Liang wrote: >> src/java.base/share/classes/java/lang/invoke/VarHandle.java line 2010: >> >>> 2008: static AccessMode valueFromOrdinal(int mode) { >>> 2009: return VALUES[mode]; >>> 2010: } >> >> Also, I'll throw this out there,

Re: RFR: 8199149: Improve the exception message thrown by VarHandle of unsupported operation [v4]

2023-07-20 Thread Jorn Vernee
On Thu, 20 Jul 2023 01:04:08 GMT, Mandy Chung wrote: >> `VarForm::getMemberName` currently throws UOE with no information if the >> requested access mode is unsupported. To provide the var handle >> information, move the access mode check to `VarHandle` so that the exception >> message can i

Re: RFR: 8199149: Improve the exception message thrown by VarHandle of unsupported operation [v4]

2023-07-20 Thread Jorn Vernee
On Thu, 20 Jul 2023 01:04:08 GMT, Mandy Chung wrote: >> `VarForm::getMemberName` currently throws UOE with no information if the >> requested access mode is unsupported. To provide the var handle >> information, move the access mode check to `VarHandle` so that the exception >> message can i

Re: RFR: 8312424: 80% throughput decrease in Arrays.hashCode(Object[]) after JDK-8312164

2023-07-20 Thread Jorn Vernee
On Thu, 20 Jul 2023 01:11:43 GMT, Glavo wrote: > The changes to `Arrays.hashCode(Object[])` in JDK-8312164 caused its > performance is reduced by about 80%. > > This PR reverts this change. With a size of `1`, the polymorphic version is not really polymorphic. This seems to be about profile

Re: RFR: 8199149: Improve the exception message thrown by VarHandle of unsupported operation [v2]

2023-07-19 Thread Jorn Vernee
On Wed, 19 Jul 2023 02:19:58 GMT, Mandy Chung wrote: >> `VarForm::getMemberName` currently throws UOE with no information if the >> requested access mode is unsupported. To provide the var handle >> information, move the access mode check to `VarHandle` so that the exception >> message can i

Re: RFR: 6983726: Reimplement MethodHandleProxies.asInterfaceInstance [v26]

2023-07-17 Thread Jorn Vernee
.267 ± 0.019 ns/op >> MethodHandleProxiesAsIFInstanceCall.direct avgt5 >> 0.266 ± 0.013 ns/op >> MethodHandleProxiesAsIFInstanceCreate.createCallInterfaceInstance avgt5 >> 18.057 ± 0.182 ... > > Chen Liang has

Re: RFR: 6983726: Reimplement MethodHandleProxies.asInterfaceInstance [v25]

2023-07-17 Thread Jorn Vernee
On Tue, 11 Jul 2023 19:22:58 GMT, Chen Liang wrote: >> As John Rose has pointed out in this issue, the current j.l.r.Proxy based >> implementation of MethodHandleProxies.asInterface has a few issues: >> 1. Exposes too much information via Proxy supertype (and WrapperInstance >> interface) >> 2.

Integrated: 8310157: Allow void-returning filters for MethodHandles::collectCoordinates

2023-07-17 Thread Jorn Vernee
On Thu, 15 Jun 2023 15:44:04 GMT, Jorn Vernee wrote: > This patch changes the implementation of `MethodHandles::collectCoordinates` > to allow using filters that return `void`. This brings the behavior in line > with the previously existing `MethodHandles::collectArgument` which opera

Re: RFR: 8310157: Allow void-returning filters for MethodHandles::collectCoordinates [v3]

2023-07-14 Thread Jorn Vernee
On Fri, 16 Jun 2023 15:15:07 GMT, Jorn Vernee wrote: >> This patch changes the implementation of `MethodHandles::collectCoordinates` >> to allow using filters that return `void`. This brings the behavior in line >> with the previously existing `MethodHandles::collectArgume

Re: RFR: 6983726: Reimplement MethodHandleProxies.asInterfaceInstance [v22]

2023-07-11 Thread Jorn Vernee
On Tue, 11 Jul 2023 13:16:21 GMT, Chen Liang wrote: > 1. I think the type profile pollution only happens with the instance-field > approach, as I recall different instance fields' MHs pollute profiling. The > comment need to be corrected if I'm right. What happens is not really 'profile pollut

Re: [jdk21] RFR: 8311593: Minor doc issue in MemorySegment::copy

2023-07-11 Thread Jorn Vernee
On Tue, 11 Jul 2023 00:40:40 GMT, Maurizio Cimadamore wrote: > Clean backport of https://git.openjdk.org/jdk/pull/14813 > (sorry for filing another one, I realized there was an issue with the JBS > issues pointing the wrong way) Marked as reviewed by jvernee (Reviewer). - PR Revi

Re: [jdk21] RFR: 8311593: Minor doc issue in MemorySegment::copy

2023-07-10 Thread Jorn Vernee
On Mon, 10 Jul 2023 15:08:00 GMT, Maurizio Cimadamore wrote: > Clean backport of https://git.openjdk.org/jdk/pull/14813 Marked as reviewed by jvernee (Reviewer). - PR Review: https://git.openjdk.org/jdk21/pull/107#pullrequestreview-1522609664

Re: RFR: 8311630: [s390] Implementation of Foreign Function & Memory API (Preview) [v3]

2023-07-10 Thread Jorn Vernee
On Sat, 8 Jul 2023 10:48:15 GMT, sid8606 wrote: >> Implementation of "Foreign Function & Memory API" for s390x (Big Endian). > > sid8606 has updated the pull request incrementally with one additional commit > since the last revision: > > Address suggestion

Re: RFR: 8311593: Minor doc issue in MemorySegment::copy

2023-07-10 Thread Jorn Vernee
On Mon, 10 Jul 2023 11:00:54 GMT, Maurizio Cimadamore wrote: > This simple PR fixes an issue where `this segment` was used in the javadoc of > two static methods. Marked as reviewed by jvernee (Reviewer). - PR Review: https://git.openjdk.org/jdk/pull/14813#pullrequestreview-15222

Re: RFR: 8311630: [s390] Implementation of Foreign Function & Memory API (Preview) [v3]

2023-07-08 Thread Jorn Vernee
On Sat, 8 Jul 2023 10:48:15 GMT, sid8606 wrote: >> Implementation of "Foreign Function & Memory API" for s390x (Big Endian). > > sid8606 has updated the pull request incrementally with one additional commit > since the last revision: > > Address suggestions

Re: RFR: 8311630: [s390] Implementation of Foreign Function & Memory API (Preview) [v2]

2023-07-07 Thread Jorn Vernee
On Fri, 7 Jul 2023 18:25:58 GMT, sid8606 wrote: >> Ah, wait, now I see. The native side uses `int` as a type, but we try to >> load it as a `JAVA_BYTE`. I think this is a bug in the test. The Java side >> should use `JAVA_INT` instead, and the size passed to `reinterpret` should >> be `4` (whi

Re: RFR: 8311630: [s390] Implementation of Foreign Function & Memory API (Preview) [v2]

2023-07-07 Thread Jorn Vernee
On Fri, 7 Jul 2023 14:54:54 GMT, sid8606 wrote: >> src/hotspot/cpu/s390/upcallLinker_s390.cpp line 141: >> >>> 139: >>> 140: // The Java call uses the JIT ABI, but we also call C. >>> 141: int out_arg_area = MAX2(frame::z_jit_out_preserve_size + >>> arg_shuffle.out_arg_bytes(), (int)frame:

Re: RFR: 8311630: [s390] Implementation of Foreign Function & Memory API (Preview) [v2]

2023-07-07 Thread Jorn Vernee
On Fri, 7 Jul 2023 10:01:20 GMT, sid8606 wrote: >> Implementation of "Foreign Function & Memory API" for s390x. > > sid8606 has updated the pull request incrementally with one additional commit > since the last revision: > > Address Amit's review comments Overall looks great! I'd mostly like

Re: RFR: 6983726: Reimplement MethodHandleProxies.asInterfaceInstance [v20]

2023-07-05 Thread Jorn Vernee
On Wed, 5 Jul 2023 16:00:11 GMT, Mandy Chung wrote: >> Ok, thanks. This is similar to the solution I would have suggested. >> >> The only thing I'm unsure about is races. ClassValue allows multiple threads >> to race to compute the final value, but in the end only 1 is chosen that is >> return

Re: RFR: 6983726: Reimplement MethodHandleProxies.asInterfaceInstance [v20]

2023-07-04 Thread Jorn Vernee
On Tue, 4 Jul 2023 21:00:30 GMT, Mandy Chung wrote: >> src/java.base/share/classes/java/lang/invoke/MethodHandleProxies.java line >> 324: >> >>> 322: r = PROXY_LOOKUPS.get(intfc); >>> 323: } >>> 324: return r.get(); >> >> This doesn't look right to me. AFAICT the Lo

Re: RFR: 6983726: Reimplement MethodHandleProxies.asInterfaceInstance [v20]

2023-07-04 Thread Jorn Vernee
On Sun, 2 Jul 2023 02:05:23 GMT, Chen Liang wrote: >> As John Rose has pointed out in this issue, the current j.l.r.Proxy based >> implementation of MethodHandleProxies.asInterface has a few issues: >> 1. Exposes too much information via Proxy supertype (and WrapperInstance >> interface) >> 2.

Re: RFR: 6983726: Reimplement MethodHandleProxies.asInterfaceInstance [v20]

2023-07-04 Thread Jorn Vernee
On Tue, 4 Jul 2023 13:37:45 GMT, Jorn Vernee wrote: >> Chen Liang has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 44 commits: >> >> - Merge branch 'master' into explore/mhp-iface >> -

[jdk21] Integrated: 8310914: Remove 2 malformed java/foreign ProblemList entries

2023-06-28 Thread Jorn Vernee
On Tue, 27 Jun 2023 20:48:57 GMT, Jorn Vernee wrote: > Hi all, > > This pull request contains a backport of commit > [f07e396b](https://github.com/openjdk/jdk/commit/f07e396bda4567fd35677704b9aa974426266363) > from the [openjdk/jdk](https://git.openjdk.org/jdk) repository.

[jdk21] Integrated: 8310405: Linker.Option.firstVariadicArg should specify which index values are valid

2023-06-28 Thread Jorn Vernee
On Wed, 28 Jun 2023 17:34:51 GMT, Jorn Vernee wrote: > Hi all, > > This pull request contains a backport of commit > [7fffdb5e](https://github.com/openjdk/jdk/commit/7fffdb5e60351026c9ee77f438b8fe505d85de4c) > from the [openjdk/jdk](https://git.openjdk.org/jdk) repository.

[jdk21] RFR: 8310405: Linker.Option.firstVariadicArg should specify which index values are valid

2023-06-28 Thread Jorn Vernee
Hi all, This pull request contains a backport of commit [7fffdb5e](https://github.com/openjdk/jdk/commit/7fffdb5e60351026c9ee77f438b8fe505d85de4c) from the [openjdk/jdk](https://git.openjdk.org/jdk) repository. The commit being backported was authored by Jorn Vernee on 28 Jun 2023 and was

Integrated: 8310405: Linker.Option.firstVariadicArg should specify which index values are valid

2023-06-28 Thread Jorn Vernee
On Tue, 20 Jun 2023 14:21:26 GMT, Jorn Vernee wrote: > Improve the specification of `Linker.Option.firstVariadicArg`, by specifying > more clearly which index values are valid. This pull request has now been integrated. Changeset: 7fffdb5e Author: Jorn Vernee URL:

[jdk21] RFR: 8310914: Remove 2 malformed java/foreign ProblemList entries

2023-06-27 Thread Jorn Vernee
Hi all, This pull request contains a backport of commit [f07e396b](https://github.com/openjdk/jdk/commit/f07e396bda4567fd35677704b9aa974426266363) from the [openjdk/jdk](https://git.openjdk.org/jdk) repository. The commit being backported was authored by Jorn Vernee on 27 Jun 2023 and was

Integrated: 8310914: Remove 2 malformed java/foreign ProblemList entries

2023-06-27 Thread Jorn Vernee
On Mon, 26 Jun 2023 19:33:50 GMT, Jorn Vernee wrote: > Remove 2 malformed problem list entries. These entries are considered > malformed according to [1] since they are missing a bug number. > > The `java/foreign/callarranger/TestAarch64CallArranger.java` test was > removed

Re: RFR: 8310914: Remove 2 malformed java/foreign ProblemList entries

2023-06-27 Thread Jorn Vernee
On Tue, 27 Jun 2023 06:22:06 GMT, Jaikiran Pai wrote: > > The `java/foreign/callarranger/TestAarch64CallArranger.java` test was > > removed, > > It looks like this test is still present in mainline > https://github.com/openjdk/jdk/blob/master/test/jdk/java/foreign/callarranger/TestLinuxAArch64

RFR: 8310914: Remove 2 malformed java/foreign ProblemList entries

2023-06-26 Thread Jorn Vernee
Remove 2 malformed problem list entries. These entries are considered malformed according to [1] since they are missing a bug number. The `java/foreign/callarranger/TestAarch64CallArranger.java` test was removed, and the `java/foreign/TestLargeSegmentCopy.java` disables x86 in the jtreg test h

Re: RFR: 8296477: Foreign linker implementation update following JEP 434 [v2]

2023-06-26 Thread Jorn Vernee
On Wed, 7 Dec 2022 09:24:24 GMT, Jaikiran Pai wrote: >> I'm not sure what the conventional move here would be. Adding them to the >> problem list doesn't seem to make the failures go away in GHA at least. I >> can exclude them with `@requires` as well. > > Hello Jorn, > >> Adding them to the p

Re: RFR: 8310405: Linker.Option.firstVariadicArg should specify which index values are valid [v3]

2023-06-23 Thread Jorn Vernee
On Fri, 23 Jun 2023 23:58:05 GMT, Jorn Vernee wrote: >> Improve the specification of `Linker.Option.firstVariadicArg`, by specifying >> more clearly which index values are valid. > > Jorn Vernee has updated the pull request incrementally with three additional > commits si

Re: RFR: 8310405: Linker.Option.firstVariadicArg should specify which index values are valid [v3]

2023-06-23 Thread Jorn Vernee
> Improve the specification of `Linker.Option.firstVariadicArg`, by specifying > more clearly which index values are valid. Jorn Vernee has updated the pull request incrementally with three additional commits since the last revision: - review comments - Update src/java.base/share/c

Re: RFR: 8310405: Linker.Option.firstVariadicArg should specify which index values are valid [v2]

2023-06-21 Thread Jorn Vernee
On Wed, 21 Jun 2023 07:34:20 GMT, Per Minborg wrote: >> Possible suggestion/thing to try: use a bullet list to spell out all cases >> for `index`. E.g. we know there's index == 0 (all variadic). Then we know >> there's index = N (no variadic). Then there's index == m, 0 < m < N - which >> mean

Re: RFR: 8310405: Linker.Option.firstVariadicArg should specify which index values are valid [v2]

2023-06-21 Thread Jorn Vernee
> Improve the specification of `Linker.Option.firstVariadicArg`, by specifying > more clearly which index values are valid. Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision: polish doc, review comments - Changes:

[jdk21] Integrated: 8310053: VarHandle and slice handle derived from layout are lacking alignment check

2023-06-21 Thread Jorn Vernee
On Wed, 21 Jun 2023 00:08:03 GMT, Jorn Vernee wrote: > Hi all, > > This pull request contains a backport of commit > [e022e876](https://github.com/openjdk/jdk/commit/e022e876543b65b531027662326f35b497861f33) > from the [openjdk/jdk](https://git.openjdk.org/jdk) repository.

[jdk21] RFR: 8310053: VarHandle and slice handle derived from layout are lacking alignment check

2023-06-20 Thread Jorn Vernee
Hi all, This pull request contains a backport of commit [e022e876](https://github.com/openjdk/jdk/commit/e022e876543b65b531027662326f35b497861f33) from the [openjdk/jdk](https://git.openjdk.org/jdk) repository. The commit being backported was authored by Jorn Vernee on 21 Jun 2023 and was

Integrated: 8310053: VarHandle and slice handle derived from layout are lacking alignment check

2023-06-20 Thread Jorn Vernee
On Wed, 14 Jun 2023 19:30:10 GMT, Jorn Vernee wrote: > Add missing alignment checks for the alignment constraint of the root layout > of a VarHandle created through `MemoryLayout::varHandle` and a MethodHandle > `MemoryLayout::sliceHandle`. > > Testing: `jdk_foreign` test s

Re: RFR: 8310405: Linker.Option.firstVariadicArg should specify which index values are valid

2023-06-20 Thread Jorn Vernee
On Tue, 20 Jun 2023 22:54:47 GMT, Maurizio Cimadamore wrote: >> Improve the specification of `Linker.Option.firstVariadicArg`, by specifying >> more clearly which index values are valid. > > src/java.base/share/classes/java/lang/foreign/Linker.java line 652: > >> 650: * The {@code ind

Re: RFR: 8310405: Linker.Option.firstVariadicArg should specify which index values are valid

2023-06-20 Thread Jorn Vernee
On Tue, 20 Jun 2023 22:59:42 GMT, Maurizio Cimadamore wrote: >> src/java.base/share/classes/java/lang/foreign/Linker.java line 650: >> >>> 648: * function descriptor associated with a downcall >>> linkage request} >>> 649: * >>> 650: * The {@code index} val

RFR: 8310405: Linker.Option.firstVariadicArg should specify which index values are valid

2023-06-20 Thread Jorn Vernee
Improve the specification of `Linker.Option.firstVariadicArg`, by specifying more clearly which index values are valid. - Commit messages: - improve firstVariadicArg doc Changes: https://git.openjdk.org/jdk/pull/14565/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=14565&ra

Re: RFR: 8310157: Allow void-returning filters for MethodHandles::collectCoordinates [v2]

2023-06-16 Thread Jorn Vernee
On Fri, 16 Jun 2023 01:53:29 GMT, Jorn Vernee wrote: >> This patch changes the implementation of `MethodHandles::collectCoordinates` >> to allow using filters that return `void`. This brings the behavior in line >> with the previously existing `MethodHandles::collectArgume

Re: RFR: 8310157: Allow void-returning filters for MethodHandles::collectCoordinates [v3]

2023-06-16 Thread Jorn Vernee
> > Testing: jdk-tier1,2,3 Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision: update javadoc - Changes: - all: https://git.openjdk.org/jdk/pull/14496/files - new: https://git.openjdk.org/jdk/pull/14496/files/1a10d48a.

Re: RFR: 8310157: Allow void-returning filters for MethodHandles::collectCoordinates [v2]

2023-06-15 Thread Jorn Vernee
> > Testing: jdk-tier1,2,3 Jorn Vernee has updated the pull request incrementally with two additional commits since the last revision: - typo - polish javadoc - Changes: - all: https://git.openjdk.org/jdk/pull/14496/files - new: https://git.openjdk.org/jdk/pull/14496/files/

Re: RFR: 8310157: Allow void-returning filters for MethodHandles::collectCoordinates

2023-06-15 Thread Jorn Vernee
On Thu, 15 Jun 2023 15:44:04 GMT, Jorn Vernee wrote: > This patch changes the implementation of `MethodHandles::collectCoordinates` > to allow using filters that return `void`. This brings the behavior in line > with the previously existing `MethodHandles::collectArgument` which opera

RFR: 8310157: Allow void-returning filters for MethodHandles::collectCoordinates

2023-06-15 Thread Jorn Vernee
This patch changes the implementation of `MethodHandles::collectCoordinates` to allow using filters that return `void`. This brings the behavior in line with the previously existing `MethodHandles::collectArgument` which operates on MethodHandles rather than VarHandles. Testing: jdk-tier1,2,3

Re: RFR: 8310053: VarHandle and slice handle derived from layout are lacking alignment check [v4]

2023-06-15 Thread Jorn Vernee
On Wed, 14 Jun 2023 23:38:01 GMT, Jorn Vernee wrote: >> Add missing alignment checks for the alignment constraint of the root layout >> of a VarHandle created through `MemoryLayout::varHandle` and a MethodHandle >> `MemoryLayout::sliceHandle`. >> >> Testing: `jd

Re: RFR: 8310053: VarHandle and slice handle derived from layout are lacking alignment check [v5]

2023-06-15 Thread Jorn Vernee
> Add missing alignment checks for the alignment constraint of the root layout > of a VarHandle created through `MemoryLayout::varHandle` and a MethodHandle > `MemoryLayout::sliceHandle`. > > Testing: `jdk_foreign` test suite Jorn Vernee has updated the pull request increme

Re: RFR: 8310053: VarHandle and slice handle derived from layout are lacking alignment check [v4]

2023-06-15 Thread Jorn Vernee
On Thu, 15 Jun 2023 00:22:09 GMT, Maurizio Cimadamore wrote: > only the first var handle in the dereference chain gets the proper alignment > adaptation on the input segment That would be easy enough to do, we just check for `derefAdapters.length == 0`. I'll add this too. - PR C

Re: RFR: 8310053: VarHandle and slice handle derived from layout are lacking alignment check [v3]

2023-06-14 Thread Jorn Vernee
On Wed, 14 Jun 2023 22:28:38 GMT, Jorn Vernee wrote: >> Add missing alignment checks for the alignment constraint of the root layout >> of a VarHandle created through `MemoryLayout::varHandle` and a MethodHandle >> `MemoryLayout::sliceHandle`. >> >> Testing: `jd

Re: RFR: 8310053: VarHandle and slice handle derived from layout are lacking alignment check [v4]

2023-06-14 Thread Jorn Vernee
> Add missing alignment checks for the alignment constraint of the root layout > of a VarHandle created through `MemoryLayout::varHandle` and a MethodHandle > `MemoryLayout::sliceHandle`. > > Testing: `jdk_foreign` test suite Jorn Vernee has updated the pull request increme

Re: RFR: 8310053: VarHandle and slice handle derived from layout are lacking alignment check [v3]

2023-06-14 Thread Jorn Vernee
On Wed, 14 Jun 2023 22:48:34 GMT, Maurizio Cimadamore wrote: >> Jorn Vernee has updated the pull request incrementally with one additional >> commit since the last revision: >> >> formatting > > test/jdk/java/foreign/TestLayoutPaths.java line 152:

Re: RFR: 8310053: VarHandle and slice handle derived from layout are lacking alignment check [v3]

2023-06-14 Thread Jorn Vernee
> Add missing alignment checks for the alignment constraint of the root layout > of a VarHandle created through `MemoryLayout::varHandle` and a MethodHandle > `MemoryLayout::sliceHandle`. > > Testing: `jdk_foreign` test suite Jorn Vernee has updated the pull request increme

Re: RFR: 8310053: VarHandle and slice handle derived from layout are lacking alignment check [v2]

2023-06-14 Thread Jorn Vernee
> Add missing alignment checks for the alignment constraint of the root layout > of a VarHandle created through `MemoryLayout::varHandle` and a MethodHandle > `MemoryLayout::sliceHandle`. > > Testing: `jdk_foreign` test suite Jorn Vernee has updated the pull request increme

RFR: 8310053: VarHandle and slice handle derived from layout are lacking alignment check

2023-06-14 Thread Jorn Vernee
Add missing alignment checks for the alignment constraint of the root layout of a VarHandle created through `MemoryLayout::varHandle` and a MethodHandle `MemoryLayout::sliceHandle`. Testing: `jdk_foreign` test suite - Commit messages: - Add root layout alignment check to varHandle

Integrated: 8309880: Add support for linking libffi on Windows and Mac

2023-06-14 Thread Jorn Vernee
On Tue, 13 Jun 2023 12:48:12 GMT, Jorn Vernee wrote: > Update the make/autoconf/lib-ffi.m4 script to support using libffi on Windows > and Mac. > > For Windows I had to tweak `fallbackLinker.c` to be able to build: there was > an import of `stdint.h` missing, and sin

Re: RFR: 8309880: Add support for linking libffi on Windows and Mac [v2]

2023-06-13 Thread Jorn Vernee
On Tue, 13 Jun 2023 17:09:30 GMT, Jorn Vernee wrote: >> Update the make/autoconf/lib-ffi.m4 script to support using libffi on >> Windows and Mac. >> >> For Windows I had to tweak `fallbackLinker.c` to be able to build: there was >> an import of `stdint.h` m

Re: RFR: 8309880: Add support for linking libffi on Windows and Mac

2023-06-13 Thread Jorn Vernee
On Tue, 13 Jun 2023 12:48:12 GMT, Jorn Vernee wrote: > Update the make/autoconf/lib-ffi.m4 script to support using libffi on Windows > and Mac. > > For Windows I had to tweak `fallbackLinker.c` to be able to build: there was > an import of `stdint.h` missing, and sin

Re: RFR: 8309880: Add support for linking libffi on Windows and Mac [v2]

2023-06-13 Thread Jorn Vernee
i.def /machine:x64 /out:libffi.lib` to create the > right `.lib` file (`lib` is a visual studio tool) > > --- > > Testing: > - manual testing on Windows/x64 and Mac/AArch64, by running the `jdk_foreign` > test suite with `-Djdk.internal.foreign.CABI=FALLBACK` (i.e. using

Re: RFR: 8309880: Add support for linking libffi on Windows and Mac

2023-06-13 Thread Jorn Vernee
On Tue, 13 Jun 2023 16:05:07 GMT, Erik Joelsson wrote: >> Update the make/autoconf/lib-ffi.m4 script to support using libffi on >> Windows and Mac. >> >> For Windows I had to tweak `fallbackLinker.c` to be able to build: there was >> an import of `stdint.h` missing, and since it was using `WSA

RFR: 8309880: Add support for linking libffi on Windows and Mac

2023-06-13 Thread Jorn Vernee
Update the make/autoconf/lib-ffi.m4 script to support using libffi on Windows and Mac. For Windows I had to tweak `fallbackLinker.c` to be able to build: there was an import of `stdint.h` missing, and since it was using `WSAGetLastError` it needed to link against `ws2_32.lib`. This PR also con

Re: RFR: 8308645: Javadoc of FFM API needs to be refreshed

2023-06-12 Thread Jorn Vernee
On Mon, 12 Jun 2023 11:01:08 GMT, Maurizio Cimadamore wrote: > This is the same PR as https://github.com/openjdk/jdk/pull/14098, but > backported to the JDK 21 repo fork. Btw, besides the other 2 issues this solves (from the other PR), I think this also solves: https://bugs.openjdk.org/browse

Re: RFR: 8308645: Javadoc of FFM API needs to be refreshed

2023-06-12 Thread Jorn Vernee
On Mon, 12 Jun 2023 11:01:08 GMT, Maurizio Cimadamore wrote: > This is the same PR as https://github.com/openjdk/jdk/pull/14098, but > backported to the JDK 21 repo fork. Already reviewed the other PR. - Marked as reviewed by jvernee (Reviewer). PR Review: https://git.openjdk.or

Re: RFR: 8308645: Javadoc of FFM API needs to be refreshed [v4]

2023-06-09 Thread Jorn Vernee
On Fri, 9 Jun 2023 18:20:51 GMT, Jorn Vernee wrote: >> Note that the javadoc has been rectified here (as part of the PR) as I think >> it has always been wrong in the past (probably cut and paste issue from the >> non-MH version?) > > But, the implementation of `byteOff

Re: RFR: 8308645: Javadoc of FFM API needs to be refreshed [v4]

2023-06-09 Thread Jorn Vernee
On Fri, 9 Jun 2023 13:42:17 GMT, Maurizio Cimadamore wrote: >> Note sure - javadoc says: >> >> * @throws IllegalArgumentException if the layout path is not > href="#well-formedness">well-formed for this layout. >> * @throws IllegalArgumentException if the layout path contains one or >> mo

Re: RFR: 8308645: Javadoc of FFM API needs to be refreshed [v4]

2023-06-08 Thread Jorn Vernee
On Thu, 1 Jun 2023 20:06:32 GMT, Jorn Vernee wrote: >> Maurizio Cimadamore has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Fix wrong link in layout well-formedness doc > > test/jdk/java/foreign/TestLayout

Integrated: 8308445: Linker should check that capture state segment is big enough

2023-06-07 Thread Jorn Vernee
On Tue, 6 Jun 2023 16:22:41 GMT, Jorn Vernee wrote: > Fix the bug mentioned in the JBS issue. > > The implementation is updated to slice the capture state segment using the > capture state layout. This checks both that the segment is big enough, and > that it is p

Integrated: 8308031: Linkers should reject unpromoted variadic parameters

2023-06-07 Thread Jorn Vernee
On Tue, 30 May 2023 17:25:35 GMT, Jorn Vernee wrote: > In C, arguments smaller than `int` are promoted to (`unsigned`) `int`, and > `float` is promoted to `double`, when being passed as variadic argument (see > e.g. > https://en.cppreference.com/w/c/languag

Re: RFR: 8308445: Linker should check that capture state segment is big enough [v2]

2023-06-06 Thread Jorn Vernee
::NULL` since this is also an illegal > value we can catch early. > > Test cases are added for all three invalid values. > > Testing: `jdk_foreign` test suite. Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision: rename MH fi

Re: RFR: 8308445: Linker should check that capture state segment is big enough

2023-06-06 Thread Jorn Vernee
On Tue, 6 Jun 2023 17:13:23 GMT, Maurizio Cimadamore wrote: >> Fix the bug mentioned in the JBS issue. >> >> The implementation is updated to slice the capture state segment using the >> capture state layout. This checks both that the segment is big enough, and >> that it is properly aligned.

RFR: 8308445: Linker should check that capture state segment is big enough

2023-06-06 Thread Jorn Vernee
Fix the bug mentioned in the JBS issue. The implementation is updated to slice the capture state segment using the capture state layout. This checks both that the segment is big enough, and that it is properly aligned. Additionally, I added a check for `MS::NULL` since this is also an illegal

Re: RFR: 8308031: Linkers should promote variadic arguments [v8]

2023-06-06 Thread Jorn Vernee
n mac/aarch64 with the fallback linker to verify the > correctness of the fallback linker changes. Jorn Vernee has updated the pull request incrementally with two additional commits since the last revision: - Improve javadoc, align implementation - Revert "automatically apply variad

Re: RFR: 8308031: Linkers should promote variadic arguments [v7]

2023-06-06 Thread Jorn Vernee
On Fri, 2 Jun 2023 16:22:43 GMT, Jorn Vernee wrote: >> In C, arguments smaller than `int` are promoted to (`unsigned`) `int`, and >> `float` is promoted to `double`, when being passed as variadic argument (see >> e.g. >> https://en.cppreference.com

Re: RFR: 8308645: Javadoc of FFM API needs to be refreshed [v5]

2023-06-02 Thread Jorn Vernee
On Fri, 2 Jun 2023 11:41:38 GMT, Maurizio Cimadamore wrote: >> As the FFM API evolved over time, some parts of the javadoc went out of >> sync. Now that most of the API is stable, it is a good time to look again at >> the javadoc as a whole, and bring some more consistency. >> >> While most o

<    1   2   3   4   5   6   7   8   9   10   >