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

2022-05-18 Thread Maurizio Cimadamore
On Wed, 18 May 2022 15:05:26 GMT, Jorn Vernee wrote: >> It's not quite that simple since a binding recipe for a single parameter can >> have multiple VMStores for instance if a struct is decomposed into multiple >> values. >> >> It can be done by pulling the binding loops up to the `specialize

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

2022-05-18 Thread Maurizio Cimadamore
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, there is one more commit which

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, before executing a set of >> bindings

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 inputs

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

2022-05-18 Thread Maurizio Cimadamore
On Wed, 18 May 2022 11:23:07 GMT, Jorn Vernee wrote: >> src/java.base/share/classes/jdk/internal/foreign/abi/BindingSpecializer.java >> line 336: >> >>> 334: >>> 335: if (callingSequence.forUpcall()) { >>> 336: // for upcalls, recipes have a result, which we handle

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

2022-05-18 Thread Rémi Forax
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, there is one more commit which

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, there is one more commit which

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 callerMethodType() { >> >> Would it make sense to ei

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/classes/jdk/internal/foreign/abi/Bin

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 cls) { >> >> This seems a duplication of ASM Typ

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/classes/jdk/internal/foreign/abi/BindingSpecia

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; >>> 131: private int RETURN_ALLOCATOR_IDX = -1; >> >>

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

2022-05-18 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

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

2022-05-18 Thread openjdk-notifier[bot]
On Tue, 17 May 2022 16:22:15 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 more commit which

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

2022-05-17 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

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 `methodType(v

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

2022-05-17 Thread Rémi Forax
On Tue, 17 May 2022 11:57:01 GMT, Jorn Vernee wrote: >> src/java.base/share/classes/jdk/internal/foreign/abi/SoftReferenceCache.java >> line 42: >> >>> 40: >>> 41: private class Node { >>> 42: private SoftReference ref; >> >> this code looks like a double check locking so ref shou

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

2022-05-17 Thread Rémi Forax
On Tue, 17 May 2022 08:16:32 GMT, Maurizio Cimadamore wrote: >> src/java.base/share/classes/jdk/internal/foreign/abi/BindingSpecializer.java >> line 98: >> >>> 96: private static final String CLASS_DATA_DESC = >>> methodType(Object.class, MethodHandles.Lookup.class, String.class, >>> Cla

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/classes/jdk/internal/foreign/abi/SoftReference

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/classes/jdk/internal/foreign/abi/BindingSpecia

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 >> accidentally dropped change) > > s

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/classes/jdk/internal/foreign/abi/Bin

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

2022-05-17 Thread Maurizio Cimadamore
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, there is one more commit which

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

2022-05-17 Thread Maurizio Cimadamore
On Tue, 17 May 2022 05:54:39 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/classes/jdk/internal/foreign/abi/BindingSpecia

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

2022-05-17 Thread Maurizio Cimadamore
On Mon, 16 May 2022 17:40: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, there is one more commit which

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

2022-05-16 Thread Rémi Forax
On Mon, 16 May 2022 17:40: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, there is one more commit which

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

2022-05-16 Thread Rémi Forax
On Mon, 16 May 2022 17:40: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, there is one more commit which

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

2022-05-16 Thread Rémi Forax
On Mon, 16 May 2022 17:40: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, there is one more commit which

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

2022-05-16 Thread Rémi Forax
On Mon, 16 May 2022 17:40: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, there is one more commit which

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/lang/foreign/LinkUpcall.java line 61:

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

2022-05-16 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

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, there is one more commit which

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

2022-05-13 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

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

2022-05-12 Thread Remi Forax
PM > Subject: Re: RFR: 8286669: Replace MethodHandle specialization with ASM in > mainline > 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 >>

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 more commit which > ad

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

2022-05-12 Thread liach
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 more commit which > ad

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