Re: RFR: 8288425: Footprint regression due MH creation when initializing StringConcatFactory

2022-06-14 Thread Jorn Vernee
On Tue, 14 Jun 2022 15:16:27 GMT, Claes Redestad wrote: > Avoid doing MH creation when initializing `StringConcatFactory` by lazily > initializing to a `@Stable` field instead. Marked as reviewed by jvernee (Reviewer). - PR: https://git.openjdk.org/jdk/pull/9154

Re: RFR: 8288011: StringConcatFactory: Split application of stringifiers

2022-06-08 Thread Jorn Vernee
On Wed, 8 Jun 2022 10:20:37 GMT, Claes Redestad wrote: > To take optimal advantage of the pre-existing optimization for repeated > filters we could split the application of different types of stringifiers. > > The resulting difference in order of evaluation is not observable by > conventional

Re: RFR: 8287442: Reduce list to array conversions in java.lang.invoke.MethodHandles [v3]

2022-06-03 Thread Jorn Vernee
On Fri, 3 Jun 2022 17:05:19 GMT, Claes Redestad wrote: >> In preparation of #8855 this PR refactors the conversions from `List` to >> array and array to `List`, reducing the number of conversions when calling >> `MethodHandles.dropArguments` in particular. This remove about ~5% of >>

Re: RFR: 8287442: Reduce list to array conversions in java.lang.invoke.MethodHandles [v2]

2022-06-03 Thread Jorn Vernee
On Fri, 3 Jun 2022 16:43:37 GMT, Claes Redestad wrote: >> The same could be done for the public `dropArgumentsToMatch` I think. > > I'm not so sure. > > First of all we're no worse than before with the defensive copying here. > Second of an optimizing compiler might theoretically be able to

Re: RFR: 8287442: Reduce list to array conversions in java.lang.invoke.MethodHandles [v2]

2022-06-03 Thread Jorn Vernee
On Fri, 3 Jun 2022 15:09:24 GMT, Jorn Vernee wrote: >> Claes Redestad has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Review comments, eagerly convert sooner in tryFinally > > src/java.base/

Re: RFR: 8287442: Reduce list to array conversions in java.lang.invoke.MethodHandles [v2]

2022-06-03 Thread Jorn Vernee
On Fri, 27 May 2022 19:52:30 GMT, Claes Redestad wrote: >> In preparation of #8855 this PR refactors the conversions from `List` to >> array and array to `List`, reducing the number of conversions when calling >> `MethodHandles.dropArguments` in particular. This remove about ~5% of >>

Re: RFR: 8287798: Reduce runtime in java.lang.reflect/runtime microbenchmarks

2022-06-03 Thread Jorn Vernee
On Fri, 3 Jun 2022 12:46:31 GMT, Claes Redestad wrote: > Add explicit run configurations to java.lang.reflect and .runtime micros, > aiming to reduce runtime while maintaining a decently high confidence that > there's enough warmup to produce good enough data. > > Roughly halves runtime of

Re: RFR: 8287748: Fix issues in java.lang.foreign package javadoc

2022-06-02 Thread Jorn Vernee
On Thu, 2 Jun 2022 20:41:39 GMT, Maurizio Cimadamore wrote: > This patch fixes a couple of issues in the package-level javadoc of the > foreign API. > I've also dropped uses of `var`, which I think are confusing so early in the > game. Marked as reviewed by jvernee (Reviewer). -

Re: RFR: 8287430 MemorySessionImpl::addOrCleanupIfFail does not rethrow exceptions

2022-05-27 Thread Jorn Vernee
On Fri, 27 May 2022 10:29:14 GMT, Maurizio Cimadamore wrote: > This patch fix a missing rethrow in `MemorySessionImpl::addOrCleanupIfFail`. > As noted in the JBS issue, this bug does not affect correctness, but it > delays error reporting. > > Writing a test for this is nearly impossible,

Re: RFR: 8287292: Improve TransformKey to pack more kinds of transforms efficiently [v2]

2022-05-25 Thread Jorn Vernee
On Wed, 25 May 2022 14:03:41 GMT, Claes Redestad wrote: >> The bespoke caching scheme in `jl.invoke.LambdaFormEditor.TransformKey` >> allows keys to be compacted when all byte values of the key fit in 4 bits, >> otherwise a byte array is allocated and used. This means that all transforms >>

Re: RFR: 8287244: Add bound check in indexed memory access var handle [v3]

2022-05-25 Thread Jorn Vernee
On Tue, 24 May 2022 18:15:45 GMT, Maurizio Cimadamore wrote: >> Constructing indexed var handles using the `MemoryLayout` API produces >> `VarHandle` which do not check the input indices for out-of-bounds >> conditions. >> While this can never result in a VM crash (after all the memory

Re: RFR: 8287292: Improve TransformKey to pack more kinds of transforms efficiently

2022-05-25 Thread Jorn Vernee
On Wed, 25 May 2022 13:37:14 GMT, Claes Redestad wrote: >> Maybe an `assert b == b23456[i]` would be nice here. > > All usage implies the int is an argument position, which by spec is > constrained to be in the 0-255 range. But surely checking or asserting > shouldn't hurt. Yes, please. IMHO

Re: RFR: 8287292: Improve TransformKey to pack more kinds of transforms efficiently

2022-05-25 Thread Jorn Vernee
On Wed, 25 May 2022 13:27:17 GMT, Jorn Vernee wrote: >> The bespoke caching scheme in `jl.invoke.LambdaFormEditor.TransformKey` >> allows keys to be compacted when all byte values of the key fit in 4 bits, >> otherwise a byte array is allocated and used. This means t

Re: RFR: 8287292: Improve TransformKey to pack more kinds of transforms efficiently

2022-05-25 Thread Jorn Vernee
On Wed, 25 May 2022 13:28:52 GMT, Jorn Vernee wrote: >> src/java.base/share/classes/java/lang/invoke/LambdaFormEditor.java line 239: >> >>> 237: for (int i = 0; i < b23456.length; i++) { >>> 238: int b = b23456[i] & 0xFF;

Re: RFR: 8287292: Improve TransformKey to pack more kinds of transforms efficiently

2022-05-25 Thread Jorn Vernee
On Wed, 25 May 2022 09:38:08 GMT, Claes Redestad wrote: > The bespoke caching scheme in `jl.invoke.LambdaFormEditor.TransformKey` > allows keys to be compacted when all byte values of the key fit in 4 bits, > otherwise a byte array is allocated and used. This means that all transforms > with

Integrated: 8287158: Explicitly reject unsupported call shapes on macos-aarch64 in mainline

2022-05-24 Thread Jorn Vernee
On Mon, 23 May 2022 12:27:40 GMT, Jorn Vernee wrote: > Bring in changes from the panama-foreign repo > > These changes pertain to explicitly rejecting unsupported call shapes on > macos-aarch64. > > Original PRs: > 1. https://github.com/openjdk/panama-foreign/pull/676 &g

RFR: 8287158: Explicitly reject unsupported call shapes on macos-aarch64 in mainline

2022-05-23 Thread Jorn Vernee
Bring in changes from the panama-foreign repo These changes pertain to explicitly rejecting unsupported call shapes on macos-aarch64. Testing: `jdk_foreign` on linux-aarch64-debug, macosx-aarch64-debug, linux-x64-debug, macosx-x64-debug, and windows-x64-debug - Commit messages:

Re: RFR: 8287158: Explicitly reject unsupported call shapes on macos-aarch64 in mainline

2022-05-23 Thread Jorn Vernee
On Mon, 23 May 2022 12:27:40 GMT, Jorn Vernee wrote: > Bring in changes from the panama-foreign repo > > These changes pertain to explicitly rejecting unsupported call shapes on > macos-aarch64. > > Testing: `jdk_foreign` on linux-aarch64-debug, macosx-aarch64-debug,

Integrated: 8286825: Linker naming cleanup

2022-05-23 Thread Jorn Vernee
On Wed, 18 May 2022 16:54:06 GMT, Jorn Vernee wrote: > This patch is a batch naming cleanup for the foreign linker implementation. > > The naming changes are as follows: > > - ProgrammableInvoker -> DowncallLinker > - ProgrammableUpcallHandler -> UpcallLink

Re: RFR: 8286825: Linker naming cleanup [v2]

2022-05-23 Thread Jorn Vernee
On Fri, 20 May 2022 10:57:44 GMT, Jorn Vernee wrote: >> This patch is a batch naming cleanup for the foreign linker implementation. >> >> The naming changes are as follows: >> >> - ProgrammableInvoker -> DowncallLinker >> - ProgrammableUpcallHandler

Re: RFR: 8286825: Linker naming cleanup

2022-05-20 Thread Jorn Vernee
On Wed, 18 May 2022 16:54:06 GMT, Jorn Vernee wrote: > This patch is a batch naming cleanup for the foreign linker implementation. > > The naming changes are as follows: > > - ProgrammableInvoker -> DowncallLinker > - ProgrammableUpcallHandler -> UpcallLink

Re: RFR: 8286825: Linker naming cleanup [v2]

2022-05-20 Thread Jorn Vernee
lLinker* > - foreign_globals* -> foreignGlobals* (to match existing convention) > > Method, field, and other variable names are also adjusted accordingly. Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision: Comments + cleanup

Re: RFR: 8286825: Linker naming cleanup

2022-05-20 Thread Jorn Vernee
On Fri, 20 May 2022 10:36:17 GMT, Maurizio Cimadamore wrote: >> This patch is a batch naming cleanup for the foreign linker implementation. >> >> The naming changes are as follows: >> >> - ProgrammableInvoker -> DowncallLinker >> - ProgrammableUpcallHandler -> UpcallLinker >> - 'native

RFR: 8286825: Linker naming cleanup

2022-05-18 Thread Jorn Vernee
This patch is a batch naming cleanup for the foreign linker implementation. The naming changes are as follows: - ProgrammableInvoker -> DowncallLinker - ProgrammableUpcallHandler -> UpcallLinker - 'native invoker' -> 'downcall stub' - 'optimzed entry blob' -> 'upcall stub' -

Integrated: 8286669: Replace MethodHandle specialization with ASM in mainline

2022-05-18 Thread Jorn Vernee
On Thu, 12 May 2022 17:17:37 GMT, Jorn Vernee wrote: > Hi, > > This PR brings over commits from the panama-foreign repo. These commits > mostly pertain to the switch to ASM and away from MethodHandle combinators > for the binding recipe specialization. But, there is one mo

Re: RFR: 8286669: Replace MethodHandle specialization with ASM in mainline [v3]

2022-05-18 Thread Jorn Vernee
On Wed, 18 May 2022 14:51:02 GMT, Jorn Vernee wrote: >> I wasn't suggesting to add more bindings. I was more suggesting to filter >> out the load/store from the set of bindings (since these are virtualized >> anyways) that are passed to `doBindings`. Then, befo

Re: RFR: 8286669: Replace MethodHandle specialization with ASM in mainline [v3]

2022-05-18 Thread Jorn Vernee
On Wed, 18 May 2022 14:21:55 GMT, Maurizio Cimadamore wrote: >> I'm not sure if there is anything actionable here? >> >> I've thought in the past that it might be nice to have >> `GetArgument`/`SetArgument` and `GetReturnValue`/`SetReturnValue` binding >> operators as well, to make the

Re: RFR: 8286669: Replace MethodHandle specialization with ASM in mainline [v5]

2022-05-18 Thread Jorn Vernee
On Wed, 18 May 2022 11:27:24 GMT, Jorn Vernee wrote: >> Hi, >> >> This PR brings over commits from the panama-foreign repo. These commits >> mostly pertain to the switch to ASM and away from MethodHandle combinators >> for the binding recipe specialization. But,

Re: RFR: 8286669: Replace MethodHandle specialization with ASM in mainline [v2]

2022-05-18 Thread Jorn Vernee
On Tue, 17 May 2022 10:19:04 GMT, Jorn Vernee wrote: >> src/java.base/share/classes/jdk/internal/foreign/abi/CallingSequence.java >> line 109: >> >>> 107: * @return the caller method type. >>> 108: */ >>> 109: public MethodType ca

Re: RFR: 8286669: Replace MethodHandle specialization with ASM in mainline [v3]

2022-05-18 Thread Jorn Vernee
On Tue, 17 May 2022 08:41:59 GMT, Maurizio Cimadamore wrote: >> Jorn Vernee has updated the pull request incrementally with one additional >> commit since the last revision: >> >> BootstrapMethodError -> ExceptionInInitializerError > > src/java.base/share

Re: RFR: 8286669: Replace MethodHandle specialization with ASM in mainline [v3]

2022-05-18 Thread Jorn Vernee
On Tue, 17 May 2022 11:18:20 GMT, Jorn Vernee wrote: >> src/java.base/share/classes/jdk/internal/foreign/abi/BindingSpecializer.java >> line 943: >> >>> 941: Z, B, S, C, I, J, F, D, L; >>> 942: >>> 943: static BasicType of(Class

Re: RFR: 8286669: Replace MethodHandle specialization with ASM in mainline [v3]

2022-05-18 Thread Jorn Vernee
On Tue, 17 May 2022 06:00:37 GMT, Rémi Forax wrote: >> Jorn Vernee has updated the pull request incrementally with one additional >> commit since the last revision: >> >> BootstrapMethodError -> ExceptionInInitializerError > > src/java.base/share

Re: RFR: 8286669: Replace MethodHandle specialization with ASM in mainline [v3]

2022-05-18 Thread Jorn Vernee
On Tue, 17 May 2022 10:08:00 GMT, Jorn Vernee wrote: >> src/java.base/share/classes/jdk/internal/foreign/abi/BindingSpecializer.java >> line 131: >> >>> 129: private int[] scopeSlots; >>> 130: private int curScopeLocalIdx = -1; >>> 1

Re: RFR: 8286669: Replace MethodHandle specialization with ASM in mainline [v5]

2022-05-18 Thread Jorn Vernee
those changes were mostly Java as well. > > Thanks, > Jorn > > Testing: `run-test-jdk_foreign` with `-Dgenerator.sample.factor=-1` on > Windows and Linux. Jorn Vernee has updated the pull request with a new target base due to a merge or a rebase. The pull request now contain

Integrated: 8283689: Update the foreign linker VM implementation

2022-05-18 Thread Jorn Vernee
On Fri, 25 Mar 2022 13:48:20 GMT, Jorn Vernee wrote: > Hi, > > This PR updates the VM implementation of the foreign linker, by bringing over > commits from the panama-foreign repo. > > This is split off from the main JEP integration for 19, since we have limited >

Re: RFR: 8286669: Replace MethodHandle specialization with ASM in mainline [v4]

2022-05-17 Thread Jorn Vernee
those changes were mostly Java as well. > > Thanks, > Jorn > > Testing: `run-test-jdk_foreign` with `-Dgenerator.sample.factor=-1` on > Windows and Linux. Jorn Vernee has updated the pull request with a new target base due to a merge or a rebase. The pull request now conta

Re: RFR: 8283689: Update the foreign linker VM implementation [v23]

2022-05-17 Thread Jorn Vernee
e22920300c5ffa16fed805b62ed9092120 > [6]: > https://github.com/openjdk/jdk/pull/7959/commits/08e22e1b468c5c8f0cfd7135c72849944068aa7a > [7]: > https://github.com/openjdk/jdk/pull/7959/commits/451cd9edf54016c182dab21a8b26bd8b609fc062 > [8]: > https://github.com/openjdk/jdk/pull/79

Re: RFR: 8286669: Replace MethodHandle specialization with ASM in mainline [v3]

2022-05-17 Thread Jorn Vernee
On Tue, 17 May 2022 14:28:11 GMT, Rémi Forax wrote: >> What about using MethodTypeDesc/ClassDesc as building block? > > yes, it should be less expensive, the ClassDesc still need to be constructed > from Class to allow refactoring. Can't wait for constant folding :) I'll pull the

Re: RFR: 8286669: Replace MethodHandle specialization with ASM in mainline [v3]

2022-05-17 Thread Jorn Vernee
On Tue, 17 May 2022 05:51:58 GMT, Rémi Forax wrote: >> Jorn Vernee has updated the pull request incrementally with one additional >> commit since the last revision: >> >> BootstrapMethodError -> ExceptionInInitializerError > > src/java.base/share

Re: RFR: 8286669: Replace MethodHandle specialization with ASM in mainline [v3]

2022-05-17 Thread Jorn Vernee
On Tue, 17 May 2022 06:13:04 GMT, Rémi Forax wrote: >> Jorn Vernee has updated the pull request incrementally with one additional >> commit since the last revision: >> >> BootstrapMethodError -> ExceptionInInitializerError > > src/java.base/share

Re: RFR: 8283689: Update the foreign linker VM implementation [v22]

2022-05-17 Thread Jorn Vernee
e22920300c5ffa16fed805b62ed9092120 > [6]: > https://github.com/openjdk/jdk/pull/7959/commits/08e22e1b468c5c8f0cfd7135c72849944068aa7a > [7]: > https://github.com/openjdk/jdk/pull/7959/commits/451cd9edf54016c182dab21a8b26bd8b609fc062 > [8]: > https://github.com/openjdk/jdk/pull/79

Re: RFR: 8286669: Replace MethodHandle specialization with ASM in mainline [v2]

2022-05-17 Thread Jorn Vernee
On Mon, 16 May 2022 12:58:51 GMT, Maurizio Cimadamore wrote: >> Jorn Vernee has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Use unaligned layout constants when filling in reconstituted structs (was >&g

Re: RFR: 8286669: Replace MethodHandle specialization with ASM in mainline [v3]

2022-05-17 Thread Jorn Vernee
On Tue, 17 May 2022 08:32:54 GMT, Maurizio Cimadamore wrote: >> Jorn Vernee has updated the pull request incrementally with one additional >> commit since the last revision: >> >> BootstrapMethodError -> ExceptionInInitializerError > > src/java.base/share

Re: RFR: 8283689: Update the foreign linker VM implementation [v21]

2022-05-17 Thread Jorn Vernee
On Tue, 17 May 2022 08:27:41 GMT, Maurizio Cimadamore wrote: >> Jorn Vernee has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Missing ASSERT -> NOT_PRODUCT > > src/java.base/share/classes/jdk/internal/for

Re: RFR: 8286669: Replace MethodHandle specialization with ASM in mainline [v3]

2022-05-16 Thread Jorn Vernee
On Thu, 12 May 2022 18:15:54 GMT, liach wrote: >> Jorn Vernee has updated the pull request incrementally with one additional >> commit since the last revision: >> >> BootstrapMethodError -> ExceptionInInitializerError > > test/micro/org/openjdk/bench/java/lan

Re: RFR: 8286669: Replace MethodHandle specialization with ASM in mainline [v3]

2022-05-16 Thread Jorn Vernee
those changes were mostly Java as well. > > Thanks, > Jorn > > Testing: `run-test-jdk_foreign` with `-Dgenerator.sample.factor=-1` on > Windows and Linux. Jorn Vernee has updated the pull request incrementally with one additional commit since the la

Re: RFR: 8286756: Cleanup foreign API benchmarks

2022-05-16 Thread Jorn Vernee
On Fri, 13 May 2022 15:48:29 GMT, Maurizio Cimadamore wrote: > This simple patch regularizes some of the foreign API benchmarks. Some of the > changes are: > > * use of capital names for var handle and layout constants > * move shared layout and var handle constants in a new superclass, >

Re: RFR: 8286715: Generalize MemorySegment::ofBuffer

2022-05-16 Thread Jorn Vernee
On Fri, 13 May 2022 12:33:10 GMT, Maurizio Cimadamore wrote: > This patch makes MemorySegment::ofBuffer more general, by allowing clients to > pass *any* `Buffer` instance, not just `ByteBuffer`. > This allows us to match expressiveness of JNI API, where JNI clients can > obtain the address

Re: RFR: 8283689: Update the foreign linker VM implementation [v21]

2022-05-16 Thread Jorn Vernee
e22920300c5ffa16fed805b62ed9092120 > [6]: > https://github.com/openjdk/jdk/pull/7959/commits/08e22e1b468c5c8f0cfd7135c72849944068aa7a > [7]: > https://github.com/openjdk/jdk/pull/7959/commits/451cd9edf54016c182dab21a8b26bd8b609fc062 > [8]: > https://github.com/openjdk/jdk/pull/79

Re: RFR: 8283689: Update the foreign linker VM implementation [v19]

2022-05-16 Thread Jorn Vernee
On Mon, 16 May 2022 14:52:04 GMT, Jorn Vernee wrote: >> Hi, >> >> This PR updates the VM implementation of the foreign linker, by bringing >> over commits from the panama-foreign repo. >> >> This is split off from the main JEP integration for 19, since we

Re: RFR: 8283689: Update the foreign linker VM implementation [v20]

2022-05-16 Thread Jorn Vernee
e22920300c5ffa16fed805b62ed9092120 > [6]: > https://github.com/openjdk/jdk/pull/7959/commits/08e22e1b468c5c8f0cfd7135c72849944068aa7a > [7]: > https://github.com/openjdk/jdk/pull/7959/commits/451cd9edf54016c182dab21a8b26bd8b609fc062 > [8]: > https://github.com/openjdk/jdk/pull/79

Re: RFR: 8283689: Update the foreign linker VM implementation [v19]

2022-05-16 Thread Jorn Vernee
e22920300c5ffa16fed805b62ed9092120 > [6]: > https://github.com/openjdk/jdk/pull/7959/commits/08e22e1b468c5c8f0cfd7135c72849944068aa7a > [7]: > https://github.com/openjdk/jdk/pull/7959/commits/451cd9edf54016c182dab21a8b26bd8b609fc062 > [8]: > https://github.com/openjdk/jdk/pull/79

Integrated: 8286390: Address possibly lossy conversions in jdk.incubator.foreign moved to java.base

2022-05-16 Thread Jorn Vernee
On Fri, 13 May 2022 10:04:36 GMT, Jorn Vernee wrote: > Address possible lossy conversion warning in `ProgrammableInvoker`. > > Testing: `run-test-jdk_foreign`, testing with patch from > https://github.com/openjdk/jdk/pull/8599 to see if the warning is gone. This pull request

Re: RFR: 8283689: Update the foreign linker VM implementation [v18]

2022-05-13 Thread Jorn Vernee
e22920300c5ffa16fed805b62ed9092120 > [6]: > https://github.com/openjdk/jdk/pull/7959/commits/08e22e1b468c5c8f0cfd7135c72849944068aa7a > [7]: > https://github.com/openjdk/jdk/pull/7959/commits/451cd9edf54016c182dab21a8b26bd8b609fc062 > [8]: > https://github.com/openjdk/jdk/pull/79

Re: RFR: 8283689: Update the foreign linker VM implementation [v18]

2022-05-13 Thread Jorn Vernee
On Fri, 13 May 2022 20:47:22 GMT, Vladimir Ivanov wrote: >> It's preferred to indent multi-line argument lists on the column where >> argument list starts. > > assert(dst.is_single_reg(), "not a stack pair: (%s, %s), (%s, %s)", >src.first()->name(), src.second()->name(),

Re: RFR: 8283689: Update the foreign linker VM implementation [v7]

2022-05-13 Thread Jorn Vernee
On Fri, 13 May 2022 19:13:46 GMT, Vladimir Ivanov wrote: >> Ok. Then, if no one objects, I will leave this area as-is for now. (and >> perhaps come back to this issue in the future, if it becomes more pressing). >> >> (I'll also note that this issue already exists in the current code that's in

Re: RFR: 8283689: Update the foreign linker VM implementation [v17]

2022-05-13 Thread Jorn Vernee
On Fri, 13 May 2022 19:16:36 GMT, Vladimir Ivanov wrote: >> Jorn Vernee has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 98 commits: >> >> - Merge branch 'master' into JEP-19-VM-IMPL2 >> - Undo

Re: RFR: 8286669: Replace MethodHandle specialization with ASM in mainline [v2]

2022-05-13 Thread Jorn Vernee
On Fri, 13 May 2022 13:23:41 GMT, Jorn Vernee wrote: >> Hi, >> >> This PR brings over commits from the panama-foreign repo. These commits >> mostly pertain to the switch to ASM and away from MethodHandle combinators >> for the binding recipe specialization. But,

Re: RFR: 8286669: Replace MethodHandle specialization with ASM in mainline [v2]

2022-05-13 Thread Jorn Vernee
those changes were mostly Java as well. > > Thanks, > Jorn Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision: Use unaligned layout constants when filling in reconstituted structs (was accidentally dropped change) ---

Re: RFR: 8286390: Address possibly lossy conversions in jdk.incubator.foreign moved to java.base [v2]

2022-05-13 Thread Jorn Vernee
On Fri, 13 May 2022 11:17:20 GMT, Jorn Vernee wrote: >> src/java.base/share/classes/jdk/internal/foreign/abi/ProgrammableInvoker.java >> line 215: >> >>> 213: for (int i = 0; i < highLevelType.parameterCount(); i++) { >

Re: RFR: 8286390: Address possibly lossy conversions in jdk.incubator.foreign moved to java.base [v2]

2022-05-13 Thread Jorn Vernee
> Address possible lossy conversion warning in `ProgrammableInvoker`. > > Testing: `run-test-jdk_foreign`, testing with patch from > https://github.com/openjdk/jdk/pull/8599 to see if the warning is gone. Jorn Vernee has updated the pull request incrementally with one additional

Re: RFR: 8286390: Address possibly lossy conversions in jdk.incubator.foreign moved to java.base

2022-05-13 Thread Jorn Vernee
On Fri, 13 May 2022 10:59:19 GMT, Daniel Fuchs wrote: >> Address possible lossy conversion warning in `ProgrammableInvoker`. >> >> Testing: `run-test-jdk_foreign`, testing with patch from >> https://github.com/openjdk/jdk/pull/8599 to see if the warning is gone. > >

RFR: 8286390: Address possibly lossy conversions in jdk.incubator.foreign moved to java.base

2022-05-13 Thread Jorn Vernee
Address possible lossy conversion warning in `ProgrammableInvoker`. Testing: `run-test-jdk_foreign`, testing with patch from https://github.com/openjdk/jdk/pull/8599 to see if the warning is gone. - Commit messages: - Address possible lossy conversion warning in

Re: RFR: 8286669: Replace MethodHandle specialization with ASM in mainline

2022-05-12 Thread Jorn Vernee
On Thu, 12 May 2022 17:17:37 GMT, Jorn Vernee wrote: > Hi, > > This PR brings over commits from the panama-foreign repo. These commits > mostly pertain to the switch to ASM and away from MethodHandle combinators > for the binding recipe specialization. But, there is one mo

RFR: 8286669: Replace MethodHandle specialization with ASM in mainline

2022-05-12 Thread Jorn Vernee
Hi, This PR brings over commits from the panama-foreign repo. These commits mostly pertain to the switch to ASM and away from MethodHandle combinators for the binding recipe specialization. But, there is one more commit which adds freeing of downcall stubs, since those changes were mostly Java

Re: RFR: 8283689: Update the foreign linker VM implementation [v7]

2022-05-12 Thread Jorn Vernee
On Thu, 12 May 2022 12:10:53 GMT, Maurizio Cimadamore wrote: >> Okay, I see. I think I acted a little too hastily on this yesterday. I'll >> revert the change that uses this blocking mechanism. >> >> The stack more or less looks like this during an upcall: >> >> >> | --- >> | | >> | ---

Re: RFR: 8283689: Update the foreign linker VM implementation [v17]

2022-05-12 Thread Jorn Vernee
e22920300c5ffa16fed805b62ed9092120 > [6]: > https://github.com/openjdk/jdk/pull/7959/commits/08e22e1b468c5c8f0cfd7135c72849944068aa7a > [7]: > https://github.com/openjdk/jdk/pull/7959/commits/451cd9edf54016c182dab21a8b26bd8b609fc062 > [8]: > https://github.com/openjdk/jdk/pull/79

Re: RFR: 8283689: Update the foreign linker VM implementation [v16]

2022-05-12 Thread Jorn Vernee
e22920300c5ffa16fed805b62ed9092120 > [6]: > https://github.com/openjdk/jdk/pull/7959/commits/08e22e1b468c5c8f0cfd7135c72849944068aa7a > [7]: > https://github.com/openjdk/jdk/pull/7959/commits/451cd9edf54016c182dab21a8b26bd8b609fc062 > [8]: > https://github.com/openjdk/jdk/pull/79

Re: RFR: 8283689: Update the foreign linker VM implementation [v15]

2022-05-12 Thread Jorn Vernee
e22920300c5ffa16fed805b62ed9092120 > [6]: > https://github.com/openjdk/jdk/pull/7959/commits/08e22e1b468c5c8f0cfd7135c72849944068aa7a > [7]: > https://github.com/openjdk/jdk/pull/7959/commits/451cd9edf54016c182dab21a8b26bd8b609fc062 > [8]: > https://github.com/openjdk/jdk/pull/79

Re: RFR: 8283689: Update the foreign linker VM implementation [v10]

2022-05-12 Thread Jorn Vernee
On Thu, 12 May 2022 13:55:20 GMT, Nick Gasson wrote: >> That's fine, just needed to check. But as these are now being committed to >> mainline the year does need to change to 2022 - at least in Oracle >> copyright. @nick-arm will have to advise what he thinks should be done with >> the ARM

Re: RFR: 8283689: Update the foreign linker VM implementation [v14]

2022-05-12 Thread Jorn Vernee
e22920300c5ffa16fed805b62ed9092120 > [6]: > https://github.com/openjdk/jdk/pull/7959/commits/08e22e1b468c5c8f0cfd7135c72849944068aa7a > [7]: > https://github.com/openjdk/jdk/pull/7959/commits/451cd9edf54016c182dab21a8b26bd8b609fc062 > [8]: > https://github.com/openjdk/jdk/pull/79

Re: RFR: 8283689: Update the foreign linker VM implementation [v13]

2022-05-12 Thread Jorn Vernee
e22920300c5ffa16fed805b62ed9092120 > [6]: > https://github.com/openjdk/jdk/pull/7959/commits/08e22e1b468c5c8f0cfd7135c72849944068aa7a > [7]: > https://github.com/openjdk/jdk/pull/7959/commits/451cd9edf54016c182dab21a8b26bd8b609fc062 > [8]: > https://github.com/openjdk/jdk/pull/79

Re: RFR: 8283689: Update the foreign linker VM implementation [v10]

2022-05-12 Thread Jorn Vernee
On Thu, 12 May 2022 13:55:20 GMT, Nick Gasson wrote: >> That's fine, just needed to check. But as these are now being committed to >> mainline the year does need to change to 2022 - at least in Oracle >> copyright. @nick-arm will have to advise what he thinks should be done with >> the ARM

Re: RFR: 8283689: Update the foreign linker VM implementation [v12]

2022-05-12 Thread Jorn Vernee
e22920300c5ffa16fed805b62ed9092120 > [6]: > https://github.com/openjdk/jdk/pull/7959/commits/08e22e1b468c5c8f0cfd7135c72849944068aa7a > [7]: > https://github.com/openjdk/jdk/pull/7959/commits/451cd9edf54016c182dab21a8b26bd8b609fc062 > [8]: > https://github.com/openjdk/jdk/pull/79

Re: RFR: 8283689: Update the foreign linker VM implementation [v10]

2022-05-12 Thread Jorn Vernee
On Thu, 12 May 2022 08:23:11 GMT, Nick Gasson wrote: >> src/hotspot/cpu/aarch64/foreign_globals_aarch64.cpp line 3: >> >>> 1: /* >>> 2: * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights >>> reserved. >>> 3: * Copyright (c) 2019, 2021, Arm Limited. All rights reserved. >>

Re: RFR: 8283689: Update the foreign linker VM implementation [v7]

2022-05-12 Thread Jorn Vernee
On Thu, 12 May 2022 03:32:15 GMT, David Holmes wrote: >> Is it possible for these upcalls to be nested? If yes, we could add a >> boolean to context to avoid unsetting the flag in those nested cases. And >> now that I think we should probably add that check in >> NoAsyncExceptionDeliveryMark

Re: RFR: 8283689: Update the foreign linker VM implementation [v11]

2022-05-12 Thread Jorn Vernee
e22920300c5ffa16fed805b62ed9092120 > [6]: > https://github.com/openjdk/jdk/pull/7959/commits/08e22e1b468c5c8f0cfd7135c72849944068aa7a > [7]: > https://github.com/openjdk/jdk/pull/7959/commits/451cd9edf54016c182dab21a8b26bd8b609fc062 > [8]: > https://github.com/openjdk/jdk/pull/79

Re: RFR: 8283689: Update the foreign linker VM implementation [v7]

2022-05-11 Thread Jorn Vernee
On Wed, 11 May 2022 16:38:54 GMT, Jorn Vernee wrote: >> If you want to avoid processing asynchronous exceptions during this upcall >> you could block them (check NoAsyncExceptionDeliveryMark in >> JavaThread::exit()). Seems you could set the flag in >> Programmabl

Re: RFR: 8283689: Update the foreign linker VM implementation [v10]

2022-05-11 Thread Jorn Vernee
e22920300c5ffa16fed805b62ed9092120 > [6]: > https://github.com/openjdk/jdk/pull/7959/commits/08e22e1b468c5c8f0cfd7135c72849944068aa7a > [7]: > https://github.com/openjdk/jdk/pull/7959/commits/451cd9edf54016c182dab21a8b26bd8b609fc062 > [8]: > https://github.com/openjdk/jdk/pull/79

Re: RFR: 8283689: Update the foreign linker VM implementation [v7]

2022-05-11 Thread Jorn Vernee
On Wed, 11 May 2022 16:20:32 GMT, Patricio Chilano Mateo wrote: >> Discussed this with Maurizio as well. >> >> My understanding is as follows: >> 1. Async exceptions are installed into a thread's `pending_exception` field >> by handshake at a safepoint >> 2. From there they are "thrown" (I

Re: RFR: 8283689: Update the foreign linker VM implementation [v9]

2022-05-11 Thread Jorn Vernee
On Wed, 11 May 2022 12:20:43 GMT, Jorn Vernee wrote: >> Any problems with migrating `CallConv` and `RegSpiller`away from ` VMReg* + >> int` to `GrowableArray`? > > I'll try migrating to `GrowableArray` Done. I've removed these accessors as well. - PR: https://gi

Re: RFR: 8283689: Update the foreign linker VM implementation [v7]

2022-05-11 Thread Jorn Vernee
On Wed, 11 May 2022 12:05:29 GMT, Jorn Vernee wrote: >> src/hotspot/cpu/aarch64/universalUpcallHandler_aarch64.cpp line 306: >> >>> 304: intptr_t exception_handler_offset = __ pc() - start; >>> 305: >>> 306: // Native caller has no idea how to hand

Re: RFR: 8283689: Update the foreign linker VM implementation [v9]

2022-05-11 Thread Jorn Vernee
5b62ed9092120 > [6]: > https://github.com/openjdk/jdk/pull/7959/commits/08e22e1b468c5c8f0cfd7135c72849944068aa7a > [7]: > https://github.com/openjdk/jdk/pull/7959/commits/451cd9edf54016c182dab21a8b26bd8b609fc062 > [8]: > https://github.com/openjdk/jdk/pull/7959/commits/4c851d2795afafec3a3ab17f4142ee098692068f

Re: RFR: 8283689: Update the foreign linker VM implementation [v7]

2022-05-11 Thread Jorn Vernee
On Tue, 10 May 2022 20:38:05 GMT, Vladimir Ivanov wrote: >> Jorn Vernee has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 21 commits: >> >> - Merge branch 'foreign-preview-m' into JEP-19-VM-IMP

Re: RFR: 8283689: Update the foreign linker VM implementation [v7]

2022-05-11 Thread Jorn Vernee
On Wed, 11 May 2022 11:06:51 GMT, Jorn Vernee wrote: >> src/hotspot/share/opto/callGenerator.cpp line 1131: >> >>> 1129: >>> 1130: case vmIntrinsics::_linkToNative: >>> 1131: print_inlining_failure(C, callee, jvms->depth() - 1, jvms->bci

Re: RFR: 8283689: Update the foreign linker VM implementation [v7]

2022-05-11 Thread Jorn Vernee
On Tue, 10 May 2022 21:02:39 GMT, Vladimir Ivanov wrote: >> Jorn Vernee has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 21 commits: >> >> - Merge branch 'foreign-preview-m' into JEP-19-VM-IMP

Re: RFR: 8283689: Update the foreign linker VM implementation [v8]

2022-05-11 Thread Jorn Vernee
5b62ed9092120 > [6]: > https://github.com/openjdk/jdk/pull/7959/commits/08e22e1b468c5c8f0cfd7135c72849944068aa7a > [7]: > https://github.com/openjdk/jdk/pull/7959/commits/451cd9edf54016c182dab21a8b26bd8b609fc062 > [8]: > https://github.com/openjdk/jdk/pull/7959/commits/4c851d2795afafec3a3ab17f4142ee098692068f

Re: RFR: 8283689: Update the foreign linker VM implementation [v7]

2022-05-11 Thread Jorn Vernee
On Tue, 10 May 2022 20:53:37 GMT, Vladimir Ivanov wrote: >> src/hotspot/share/utilities/growableArray.hpp line 151: >> >>> 149: return _data; >>> 150: } >>> 151: >> >> This accessor is added to be able to temporarily view a stable GrowableArray >> instance as a C-style array. It is

Re: RFR: 8283689: Update the foreign linker VM implementation [v7]

2022-05-11 Thread Jorn Vernee
On Tue, 10 May 2022 20:45:02 GMT, Vladimir Ivanov wrote: >> Jorn Vernee has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 21 commits: >> >> - Merge branch 'foreign-preview-m' into JEP-19-VM-IMP

Re: RFR: 8283689: Update the foreign linker VM implementation [v7]

2022-05-11 Thread Jorn Vernee
On Wed, 11 May 2022 10:51:10 GMT, Jorn Vernee wrote: >> src/hotspot/cpu/x86/foreign_globals_x86.hpp line 30: >> >>> 28: #include "utilities/growableArray.hpp" >>> 29: >>> 30: class outputStream; >> >> Redundant dec

Re: RFR: 8283689: Update the foreign linker VM implementation [v7]

2022-05-11 Thread Jorn Vernee
On Tue, 10 May 2022 21:01:48 GMT, Vladimir Ivanov wrote: >> Jorn Vernee has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 21 commits: >> >> - Merge branch 'foreign-preview-m' into JEP-19-VM-IMP

Re: RFR: 8283689: Update the foreign linker VM implementation [v7]

2022-05-11 Thread Jorn Vernee
On Tue, 10 May 2022 20:48:47 GMT, Vladimir Ivanov wrote: >> Jorn Vernee has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 21 commits: >> >> - Merge branch 'foreign-preview-m' into JEP-19-VM-IMP

Re: RFR: 8283689: Update the foreign linker VM implementation [v7]

2022-05-11 Thread Jorn Vernee
On Tue, 10 May 2022 20:30:09 GMT, Vladimir Ivanov wrote: >> Jorn Vernee has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 21 commits: >> >> - Merge branch 'foreign-preview-m' into JEP-19-VM-IMP

Re: RFR: 8283689: Update the foreign linker VM implementation [v7]

2022-05-11 Thread Jorn Vernee
On Tue, 10 May 2022 19:21:58 GMT, Vladimir Ivanov wrote: >> Jorn Vernee has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 21 commits: >> >> - Merge branch 'foreign-preview-m' into JEP-19-VM-IMP

Re: RFR: 8283689: Update the foreign linker VM implementation [v7]

2022-05-11 Thread Jorn Vernee
On Tue, 10 May 2022 19:16:35 GMT, Vladimir Ivanov wrote: >> Jorn Vernee has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 21 commits: >> >> - Merge branch 'foreign-preview-m' into JEP-19-VM-IMP

Re: RFR: 8283689: Update the foreign linker VM implementation [v7]

2022-05-11 Thread Jorn Vernee
On Tue, 10 May 2022 18:55:03 GMT, Vladimir Ivanov wrote: >> Jorn Vernee has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 21 commits: >> >> - Merge branch 'foreign-preview-m' into JEP-19-VM-IMP

Re: RFR: 8283689: Update the foreign linker VM implementation [v7]

2022-05-11 Thread Jorn Vernee
On Tue, 10 May 2022 18:48:08 GMT, Vladimir Ivanov wrote: >> Jorn Vernee has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 21 commits: >> >> - Merge branch 'foreign-preview-m' into JEP-19-VM-IMP

Re: RFR: 8283689: Update the foreign linker VM implementation [v7]

2022-05-11 Thread Jorn Vernee
On Tue, 10 May 2022 18:44:01 GMT, Vladimir Ivanov wrote: >> Jorn Vernee has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 21 commits: >> >> - Merge branch 'foreign-preview-m' into JEP-19-VM-IMP

Re: RFR: 8283689: Update the foreign linker VM implementation [v7]

2022-05-09 Thread Jorn Vernee
5b62ed9092120 > [6]: > https://github.com/openjdk/jdk/pull/7959/commits/08e22e1b468c5c8f0cfd7135c72849944068aa7a > [7]: > https://github.com/openjdk/jdk/pull/7959/commits/451cd9edf54016c182dab21a8b26bd8b609fc062 > [8]: > https://github.com/openjdk/jdk/pull/7959/commits/4c851d2795afafec3a3ab17f4142ee098692068f &g

Re: RFR: 8283689: Update the foreign linker VM implementation [v4]

2022-05-07 Thread Jorn Vernee
On Sat, 7 May 2022 12:51:12 GMT, Jorn Vernee wrote: >> Hi, >> >> This PR updates the VM implementation of the foreign linker, by bringing >> over commits from the panama-foreign repo. >> >> This is split off from the main JEP integration for 19, since we

  1   2   3   4   >