Re: RFR: 8303524: Check FunctionDescriptor byte order when linking

2023-03-27 Thread Jorn Vernee
On Fri, 24 Mar 2023 08:02:05 GMT, ExE Boss wrote: >> Linkers are strongly tied to a particular byte order, because they are tied >> to a particular platform. So, the linker should reject layouts that have >> another byte order. This patch implements that check. > > src/java.base/share/classes/j

RFR: 8303524: Check FunctionDescriptor byte order when linking

2023-03-27 Thread Jorn Vernee
Linkers are strongly tied to a particular byte order, because they are tied to a particular platform. So, the linker should reject layouts that have another byte order. This patch implements that check. - Depends on: https://git.openjdk.org/jdk/pull/13079 Commit messages: - Check

Re: RFR: 8304265: Implementation of Foreign Function and Memory API (Third Preview) [v8]

2023-03-23 Thread Jorn Vernee
On Thu, 23 Mar 2023 10:31:27 GMT, Maurizio Cimadamore wrote: >> Just did a test with jshell: >> >> >> jshell> Linker linker = Linker.nativeLinker(); >> >> jshell> MethodHandle handleValue = >> linker.downcallHandle(FunctionDescriptor.ofVoid(MemoryLayout.structLayout(ValueLayout.JAVA_INT)));

Re: RFR: 8304265: Implementation of Foreign Function and Memory API (Third Preview) [v8]

2023-03-22 Thread Jorn Vernee
On Wed, 22 Mar 2023 19:02:52 GMT, Maurizio Cimadamore wrote: >> src/java.base/share/classes/java/lang/foreign/Linker.java line 492: >> >>> 490: * Finally, the returned method handle will throw an {@link >>> IllegalArgumentException} if the {@link MemorySegment} >>> 491: * parameter p

Re: RFR: 8304265: Implementation of Foreign Function and Memory API (Third Preview) [v8]

2023-03-22 Thread Jorn Vernee
On Wed, 22 Mar 2023 14:09:07 GMT, Per Minborg wrote: >> API changes for the FFM API (third preview) >> >> Specdiff: >> https://cr.openjdk.org/~pminborg/panama/21/v1/specdiff/overview-summary.html >> >> Javadoc: >> https://cr.openjdk.org/~pminborg/panama/21/v1/javadoc/java.base/module-summary.ht

Re: RFR: 8304265: Implementation of Foreign Function and Memory API (Third Preview) [v5]

2023-03-22 Thread Jorn Vernee
On Tue, 21 Mar 2023 09:02:29 GMT, Per Minborg wrote: >> API changes for the FFM API (third preview) >> >> Specdiff: >> https://cr.openjdk.org/~pminborg/panama/21/v1/specdiff/overview-summary.html >> >> Javadoc: >> https://cr.openjdk.org/~pminborg/panama/21/v1/javadoc/java.base/module-summary.ht

Re: RFR: 8303040: linux PPC64le: Implementation of Foreign Function & Memory API (Preview) [v21]

2023-03-16 Thread Jorn Vernee
On Thu, 16 Mar 2023 14:42:10 GMT, Martin Doerr wrote: >> Implementation of "Foreign Function & Memory API" for linux on Power (Little >> Endian) according to "Power Architecture 64-Bit ELF V2 ABI Specification". >> >> This PR does not include code for VaList support because it's supposed to >>

Re: RFR: 8304320: java.base does not export jdk.internal.org.objectweb.asm to module jdk.jshell

2023-03-16 Thread Jorn Vernee
On Thu, 16 Mar 2023 08:14:25 GMT, Varada M wrote: > jdk/test/jdk/tools/jimage/VerifyJimage.java is failing because the module > java.base is not exporting jdk.internal.org.objectweb.asm to module > jdk.jshell. > > Reported Issue : [JDK-8304320](https://bugs.openjdk.org/browse/JDK-8304320) I

Re: RFR: 8304360: Test to ensure ConstantDescs fields work [v2]

2023-03-16 Thread Jorn Vernee
On Thu, 16 Mar 2023 18:40:12 GMT, Chen Liang wrote: >> https://github.com/openjdk/jdk/pull/13033#issuecomment-1470857327 >> >> Add a test to validate that all constants in ConstantDescs can be resolved >> with a minimally-trusted lookup, and select constants represent the objects >> they claim

Re: RFR: 8304360: Test to ensure ConstantDescs fields work

2023-03-16 Thread Jorn Vernee
On Thu, 16 Mar 2023 16:58:53 GMT, Chen Liang wrote: > https://github.com/openjdk/jdk/pull/13033#issuecomment-1470857327 > > Add a test to validate that all constants in ConstantDescs can be resolved > with a minimally-trusted lookup, and select constants represent the objects > they claim to b

Re: RFR: 8303040: linux PPC64le: Implementation of Foreign Function & Memory API (Preview) [v17]

2023-03-16 Thread Jorn Vernee
On Wed, 15 Mar 2023 18:53:08 GMT, Martin Doerr wrote: >> Implementation of "Foreign Function & Memory API" for linux on Power (Little >> Endian) according to "Power Architecture 64-Bit ELF V2 ABI Specification". >> >> This PR does not include code for VaList support because it's supposed to >>

Integrated: 8303684: Lift upcall sharing mechanism to AbstractLinker (mainline)

2023-03-16 Thread Jorn Vernee
On Mon, 6 Mar 2023 18:40:47 GMT, Jorn Vernee wrote: > Port of: https://github.com/openjdk/panama-foreign/pull/791 which lifts the > sharing mechanism for upcall stubs to AbstractLinker. This pull request has now been integrated. Changeset: d4eb3953 Author: Jorn Vernee URL:

Re: RFR: 8303684: Lift upcall sharing mechanism to AbstractLinker (mainline) [v3]

2023-03-16 Thread Jorn Vernee
> Port of: https://github.com/openjdk/panama-foreign/pull/791 which lifts the > sharing mechanism for upcall stubs to AbstractLinker. Jorn Vernee has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains five commits: - Merge branch &

Integrated: 8303022: "assert(allocates2(pc)) failed: not in CodeBuffer memory" When linking downcall handle

2023-03-15 Thread Jorn Vernee
On Tue, 7 Mar 2023 18:02:41 GMT, Jorn Vernee wrote: > The issue is that the size of the code buffer is not large enough to hold the > whole stub. > > Proposed solution is to scale the size of the stub with the number of > arguments. I've adjusted sizes for both downcall an

Re: RFR: 8304161: Add TypeKind.from to derive from TypeDescriptor.OfField

2023-03-15 Thread Jorn Vernee
On Tue, 14 Mar 2023 17:12:50 GMT, Chen Liang wrote: > Such an API allows creating TypeKind from both Class and ClassDesc than > having to call descriptorString() explicitly at every use site. > > See > https://mail.openjdk.org/pipermail/classfile-api-dev/2023-March/000240.html > for context.

Re: RFR: 8304180: Constant Descriptors for MethodHandles::classData and classDataAt

2023-03-15 Thread Jorn Vernee
On Wed, 15 Mar 2023 02:18:37 GMT, Chen Liang wrote: > Add Constant Descriptors for DirectMethodHandleDesc of > MethodHandles::classData and classDataAt in ConstantDescs. This facilitates > easier access of class data via condy in Classfile API-generated bytecode. > Most other constant bootstra

Re: RFR: 8304180: Constant Descriptors for MethodHandles::classData and classDataAt

2023-03-15 Thread Jorn Vernee
On Wed, 15 Mar 2023 02:18:37 GMT, Chen Liang wrote: > Add Constant Descriptors for DirectMethodHandleDesc of > MethodHandles::classData and classDataAt in ConstantDescs. This facilitates > easier access of class data via condy in Classfile API-generated bytecode. > Most other constant bootstra

Re: RFR: 8303040: linux PPC64le: Implementation of Foreign Function & Memory API (Preview) [v16]

2023-03-15 Thread Jorn Vernee
On Tue, 14 Mar 2023 22:52:44 GMT, Martin Doerr wrote: >> Martin Doerr has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Fix storing 32 bit integers into Java frames. Enable TestArrayStructs. > > Btw. the new cases in which we use int and s

Re: RFR: 8303022: "assert(allocates2(pc)) failed: not in CodeBuffer memory" When linking downcall handle [v3]

2023-03-15 Thread Jorn Vernee
On Fri, 10 Mar 2023 14:14:55 GMT, Jorn Vernee wrote: >> The issue is that the size of the code buffer is not large enough to hold >> the whole stub. >> >> Proposed solution is to scale the size of the stub with the number of >> arguments. I've adjusted sizes

Re: RFR: 8304283: Modernize the switch statements in jdk.internal.foreign

2023-03-15 Thread Jorn Vernee
On Wed, 15 Mar 2023 18:10:29 GMT, Per Minborg wrote: > This PR proposes changing old-type switch statements to newer forms of switch. src/java.base/share/classes/jdk/internal/foreign/abi/CallingSequenceBuilder.java line 219: > 217: case Binding.Cast unused-> true; > 218: };

Re: RFR: 8304283: Modernize the switch statements in jdk.internal.foreign

2023-03-15 Thread Jorn Vernee
On Wed, 15 Mar 2023 19:33:19 GMT, Jorn Vernee wrote: >> src/java.base/share/classes/jdk/internal/foreign/abi/CallingSequenceBuilder.java >> line 208: >> >>> 206: static boolean isUnbox(Binding binding) { >>> 207: return switch (binding) { >&

Re: RFR: 8304283: Modernize the switch statements in jdk.internal.foreign

2023-03-15 Thread Jorn Vernee
On Wed, 15 Mar 2023 18:33:34 GMT, Maurizio Cimadamore wrote: >> This PR proposes changing old-type switch statements to newer forms of >> switch. > > src/java.base/share/classes/jdk/internal/foreign/abi/CallingSequenceBuilder.java > line 208: > >> 206: static boolean isUnbox(Binding bindi

Re: RFR: 8303040: linux PPC64le: Implementation of Foreign Function & Memory API (Preview) [v17]

2023-03-15 Thread Jorn Vernee
On Wed, 15 Mar 2023 18:53:08 GMT, Martin Doerr wrote: >> Implementation of "Foreign Function & Memory API" for linux on Power (Little >> Endian) according to "Power Architecture 64-Bit ELF V2 ABI Specification". >> >> This PR does not include code for VaList support because it's supposed to >>

Re: RFR: 8303040: linux PPC64le: Implementation of Foreign Function & Memory API (Preview) [v16]

2023-03-15 Thread Jorn Vernee
On Tue, 14 Mar 2023 22:52:44 GMT, Martin Doerr wrote: > Btw. the new cases in which we use int and short accesses when byteWidth is > not a power of 2 are never unaligned AFAICS. I guess _UNALIGNED is > unnecessary in the JAVA_INT_UNALIGNED and JAVA_SHORT_UNALIGNED. They are > always aligned w

Re: RFR: 8303040: linux PPC64le: Implementation of Foreign Function & Memory API (Preview) [v16]

2023-03-15 Thread Jorn Vernee
On Tue, 14 Mar 2023 22:30:22 GMT, Martin Doerr wrote: >> Implementation of "Foreign Function & Memory API" for linux on Power (Little >> Endian) according to "Power Architecture 64-Bit ELF V2 ABI Specification". >> >> This PR does not include code for VaList support because it's supposed to >>

Re: RFR: 8303040: linux PPC64le: Implementation of Foreign Function & Memory API (Preview) [v3]

2023-03-13 Thread Jorn Vernee
On Mon, 13 Mar 2023 20:57:22 GMT, Martin Doerr wrote: > Note that argument and return value passing works. I'm getting all values > back. So, the native side seems to be ok. Only (one or two) values in > `returnBox` are broken. You mean you tested by returning each element of the array one by

Re: RFR: 8303022: "assert(allocates2(pc)) failed: not in CodeBuffer memory" When linking downcall handle [v3]

2023-03-13 Thread Jorn Vernee
On Sat, 11 Mar 2023 00:15:10 GMT, Vladimir Kozlov wrote: >> Jorn Vernee has updated the pull request incrementally with one additional >> commit since the last revision: >> >> RISCV changes > > Good. @vnkozlov Does this need another reviewer? - P

Re: RFR: 8303040: linux PPC64le: Implementation of Foreign Function & Memory API (Preview) [v14]

2023-03-13 Thread Jorn Vernee
On Thu, 9 Mar 2023 17:29:37 GMT, Martin Doerr wrote: >> Implementation of "Foreign Function & Memory API" for linux on Power (Little >> Endian) according to "Power Architecture 64-Bit ELF V2 ABI Specification". >> >> This PR does not include code for VaList support because it's supposed to >>

Re: RFR: 8303040: linux PPC64le: Implementation of Foreign Function & Memory API (Preview) [v3]

2023-03-13 Thread Jorn Vernee
On Mon, 13 Mar 2023 16:20:22 GMT, Martin Doerr wrote: > I guess I should add a couple of Upcalls to my new test. Otherwise, I have > only planned to fix TestArrayStructs. Further changes (and maybe new tests) > can still get done when working on Big Endian / AIX or when there is a demand. Okay

Re: RFR: 8303684: Lift upcall sharing mechanism to AbstractLinker (mainline) [v2]

2023-03-11 Thread Jorn Vernee
> Port of: https://github.com/openjdk/panama-foreign/pull/791 which lifts the > sharing mechanism for upcall stubs to AbstractLinker. > > This also speeds up upcall stub linking: Jorn Vernee has updated the pull request incrementally with one additional commit since the l

Re: RFR: 8303040: linux PPC64le: Implementation of Foreign Function & Memory API (Preview) [v3]

2023-03-10 Thread Jorn Vernee
On Thu, 9 Mar 2023 17:40:02 GMT, Martin Doerr wrote: >> @TheRealMDoerr I've moved the support for structs/unions that are not a >> power of 2 in size to this repo, so you should be able to merge the master >> branch to get it now. > > @JornVernee: Thanks! I've merged in your changes. TestArrayS

Re: RFR: 8303040: linux PPC64le: Implementation of Foreign Function & Memory API (Preview) [v3]

2023-03-10 Thread Jorn Vernee
On Fri, 3 Mar 2023 10:59:32 GMT, Martin Doerr wrote: >> Thanks! I need to find extra time for this. Sounds like a good idea and I >> may be able to get rid of some nasty code. > > Done by > https://github.com/openjdk/jdk/pull/12708/commits/98e242c24c07ea977b7709b9f8d0c10ce87e84c0 > (using a re

Integrated: 8303001: Add test for re-entrant upcalls

2023-03-10 Thread Jorn Vernee
On Wed, 8 Mar 2023 15:51:05 GMT, Jorn Vernee wrote: > Add a test that tests re-entrant upcalls, which is a use-case that is > uncovered by testing until now. This pull request has now been integrated. Changeset: 6d30bbe6 Author: Jorn Vernee URL: https://git.openjdk.org/jdk/

Re: RFR: 8303022: "assert(allocates2(pc)) failed: not in CodeBuffer memory" When linking downcall handle [v2]

2023-03-10 Thread Jorn Vernee
On Thu, 9 Mar 2023 06:39:47 GMT, Feilong Jiang wrote: >> @vnkozlov Yes, this is true. The only other existing port of this code is >> RISCV. However, to fix that port properly, someone needs to repeat the >> experiment on RISCV in order to figure out what the base size and the size >> per argu

Re: RFR: 8303684: Lift upcall sharing mechanism to AbstractLinker (mainline)

2023-03-10 Thread Jorn Vernee
On Mon, 6 Mar 2023 18:40:47 GMT, Jorn Vernee wrote: > Port of: https://github.com/openjdk/panama-foreign/pull/791 which lifts the > sharing mechanism for upcall stubs to AbstractLinker. > > This also speeds up upcall stub linking: @feilongjiang since this contains changes to th

Re: RFR: 8303022: "assert(allocates2(pc)) failed: not in CodeBuffer memory" When linking downcall handle [v3]

2023-03-10 Thread Jorn Vernee
3ccef632c016/src/hotspot/share/asm/codeBuffer.cpp#L119-L121 > [2]: > https://github.com/openjdk/jdk/blob/56512cfe1f0682c98ba3488af3d03ccef632c016/src/hotspot/share/asm/codeBuffer.cpp#L675 Jorn Vernee has updated the pull request incrementally with one additional commit since the last revisio

RFR: 8303001: Add test for re-entrant upcalls

2023-03-09 Thread Jorn Vernee
Add a test that tests re-entrant upcalls, which is a use-case that is uncovered by testing until now. - Commit messages: - add reentrant upcalls test Changes: https://git.openjdk.org/jdk/pull/12927/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=12927&range=00 Issue: http

Re: RFR: 8303863: RISC-V: TestArrayStructs.java fails after JDK-8303604

2023-03-09 Thread Jorn Vernee
On Thu, 9 Mar 2023 14:39:55 GMT, Feilong Jiang wrote: > [JDK-8303604](https://bugs.openjdk.org/browse/JDK-8303604) fixes an issue > with passing structs whose size is not a power of two on SysV and AArch64 > platforms. The same issue happens on RISC-V. > > Modifications are unnecessary for `ST

Re: RFR: 8303022: "assert(allocates2(pc)) failed: not in CodeBuffer memory" When linking downcall handle [v2]

2023-03-08 Thread Jorn Vernee
On Wed, 8 Mar 2023 18:40:05 GMT, Vladimir Kozlov wrote: >> Jorn Vernee has updated the pull request incrementally with one additional >> commit since the last revision: >> >> update copyright years > > I think you need to add these changes to other ports too

RFR: 8303684: Lift upcall sharing mechanism to AbstractLinker (mainline)

2023-03-08 Thread Jorn Vernee
Port of: https://github.com/openjdk/panama-foreign/pull/791 which lifts the sharing mechanism for upcall stubs to AbstractLinker. This also speeds up upcall stub linking: - Commit messages: - update benchmark - update copyright years - 8302346: Lift upcall sharing mechanism to A

Re: RFR: 8303022: "assert(allocates2(pc)) failed: not in CodeBuffer memory" When linking downcall handle [v2]

2023-03-08 Thread Jorn Vernee
3ccef632c016/src/hotspot/share/asm/codeBuffer.cpp#L119-L121 > [2]: > https://github.com/openjdk/jdk/blob/56512cfe1f0682c98ba3488af3d03ccef632c016/src/hotspot/share/asm/codeBuffer.cpp#L675 Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision

RFR: 8303022: "assert(allocates2(pc)) failed: not in CodeBuffer memory" When linking downcall handle

2023-03-08 Thread Jorn Vernee
The issue is that the size of the code buffer is not large enough to hold the whole stub. Proposed solution is to scale the size of the stub with the number of arguments. I've adjusted sizes for both downcall and upcall stubs. I've also dropped the number of relocations, since we're not really

Re: RFR: 8303040: linux PPC64le: Implementation of Foreign Function & Memory API (Preview) [v3]

2023-03-06 Thread Jorn Vernee
On Wed, 1 Mar 2023 06:37:45 GMT, Martin Doerr wrote: >>> * Uploaded my simple reproducer to >>> [JDK-8303017](https://bugs.openjdk.org/browse/JDK-8303017) >> >> Thanks! >> >>> * Using oversized load / stores is problematic. Don't forget that >>> OpenJDK still supports Big Endian platf

Integrated: 8303604: Passing by-value structs whose size is not power of 2 doesn't work on all platforms (mainline)

2023-03-06 Thread Jorn Vernee
The message from this sender included one or more files which could not be scanned for virus detection; do not open these files unless you are certain of the sender's intent. -- On Fri, 3 Mar 2023 19:27:24 GMT, Jorn Vernee

Re: RFR: 8303604: Passing by-value structs whose size is not power of 2 doesn't work on all platforms (mainline) [v2]

2023-03-06 Thread Jorn Vernee
k/panama-foreign/pull/806 which fixes an > issue with passing structs whose size is not a power of two on SysV and > AArch64 platforms. Jorn Vernee has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains four commits: - Merge branch &#x

Integrated: 8303582: Reduce duplication in jdk/java/foreign tests

2023-03-06 Thread Jorn Vernee
On Fri, 3 Mar 2023 15:08:01 GMT, Jorn Vernee wrote: > Port of: https://github.com/openjdk/panama-foreign/pull/804 which reduces > duplication in the test code by switching test value generation over to a > common method in `NativeTestHelper`. This pull request has now been i

RFR: 8303604: Passing by-value structs whose size is not power of 2 doesn't work on all platforms (mainline)

2023-03-03 Thread Jorn Vernee
Port of: https://github.com/openjdk/panama-foreign/pull/806 which fixes an issue with passing structs whose size is not a power of two on SysV and AArch64 platforms. - Depends on: https://git.openjdk.org/jdk/pull/12856 Commit messages: - 8303017: Passing by-value structs whose siz

Re: RFR: 8303582: Reduce duplication in test code (mainline)

2023-03-03 Thread Jorn Vernee
On Fri, 3 Mar 2023 15:08:01 GMT, Jorn Vernee wrote: > Port of: https://github.com/openjdk/panama-foreign/pull/804 which reduces > duplication in the test code by switching test value generation over to a > common method in `NativeTestHelper`. src/java.base/share/classes/jdk/interna

RFR: 8303582: Reduce duplication in test code (mainline)

2023-03-03 Thread Jorn Vernee
Port of: https://github.com/openjdk/panama-foreign/pull/804 which reduces duplication in the test code by switching test value generation over to a common method in `NativeTestHelper`. - Commit messages: - remove byteWidthOfPrimitive for now - 8302990: Reduce duplication in test c

Integrated: 8303516: HFAs with nested structs/unions/arrays not handled correctly on AArch64

2023-03-03 Thread Jorn Vernee
On Thu, 2 Mar 2023 13:48:26 GMT, Jorn Vernee wrote: > Port of: https://github.com/openjdk/panama-foreign/pull/780 Which adds tests > for nested structs/unions/arrays, and fixes an issue with nested HFAs on > AArch64. > > This PR also includes https://github.com/openjdk/panama-f

RFR: 8303516: HFAs with nested structs/unions/arrays not handled correctly on AArch64

2023-03-02 Thread Jorn Vernee
Port of: https://github.com/openjdk/panama-foreign/pull/780 Which adds tests for nested structs/unions/arrays, and fixes an issue with nested HFAs on AArch64. This PR also includes https://github.com/openjdk/panama-foreign/pull/765 which is required for the fix to apply cleanly. Moving these c

Re: RFR: 8303516: HFAs with nested structs/unions/arrays not handled correctly on AArch64

2023-03-02 Thread Jorn Vernee
On Thu, 2 Mar 2023 13:48:26 GMT, Jorn Vernee wrote: > Port of: https://github.com/openjdk/panama-foreign/pull/780 Which adds tests > for nested structs/unions/arrays, and fixes an issue with nested HFAs on > AArch64. > > This PR also includes https://github.com/openjdk/panama-f

Re: RFR: 8303409: Add Windows AArch64 ABI support to the Foreign Function & Memory API

2023-03-01 Thread Jorn Vernee
On Mon, 27 Feb 2023 17:04:28 GMT, Saint Wesonga wrote: > There are 2 primary differences between the Windows ARM64 ABI and the > macOS/Linux ARM64 ABI: variadic floating point arguments are passed in > general purpose registers on Windows (instead of the vector registers). In > addition to thi

Re: RFR: 8303040: linux PPC64le: Implementation of Foreign Function & Memory API (Preview) [v3]

2023-03-01 Thread Jorn Vernee
On Wed, 1 Mar 2023 06:37:45 GMT, Martin Doerr wrote: > There will surely be more when looking into Big Endian support after merging > with your recent work on > https://github.com/openjdk/panama-foreign/compare/foreign-memaccess+abi...JornVernee:panama-foreign:OOB I will try to move this into

Re: RFR: 8303040: linux PPC64le: Implementation of Foreign Function & Memory API (Preview) [v3]

2023-02-28 Thread Jorn Vernee
On Thu, 23 Feb 2023 06:18:49 GMT, Martin Doerr wrote: >> Implementation of "Foreign Function & Memory API" for linux on Power (Little >> Endian) according to "Power Architecture 64-Bit ELF V2 ABI Specification". >> >> This PR does not include code for VaList support because it's supposed to >>

Re: RFR: 8303040: linux PPC64le: Implementation of Foreign Function & Memory API (Preview) [v3]

2023-02-23 Thread Jorn Vernee
On Fri, 24 Feb 2023 04:03:53 GMT, Martin Doerr wrote: > * Uploaded my simple reproducer to > [JDK-8303017](https://bugs.openjdk.org/browse/JDK-8303017) Thanks! > * Using oversized load / stores is problematic. Don't forget that OpenJDK > still supports Big Endian platforms (AIX, s390x

Re: RFR: 8303040: linux PPC64le: Implementation of Foreign Function & Memory API (Preview) [v2]

2023-02-23 Thread Jorn Vernee
On Thu, 23 Feb 2023 16:48:30 GMT, Maurizio Cimadamore wrote: > I meant generating extsw when emitting the stub (since when we emit the stub > we can see the bindings). But I suppose the problem there is that the VM only > sees low level bindings such as moves, it doesn't see bindings such as c

Re: RFR: 8303040: linux PPC64le: Implementation of Foreign Function & Memory API (Preview) [v2]

2023-02-23 Thread Jorn Vernee
On Thu, 23 Feb 2023 10:20:31 GMT, Maurizio Cimadamore wrote: > > Correct, `extsw` performs a `I2L` conversion. I had thought about this > > already, but I think my current implementation is more efficient as it > > combines register moves with the 64 bit extend. Your proposal would > > genera

Re: RFR: 8303040: linux PPC64le: Implementation of Foreign Function & Memory API (Preview) [v3]

2023-02-23 Thread Jorn Vernee
On Thu, 23 Feb 2023 06:21:05 GMT, Martin Doerr wrote: > I have removed the size restriction for structs. Passing a struct consisting > of 1 char works (on Little Endian). However, passing a struct consisting of 3 > chars doesn't (getting IndexOutOfBoundsException: Out of bound access on > segm

Re: RFR: 8303040: linux PPC64le: Implementation of Foreign Function & Memory API (Preview)

2023-02-23 Thread Jorn Vernee
On Thu, 23 Feb 2023 04:53:34 GMT, Martin Doerr wrote: > > I will do a more thorough review soon. > > Thanks a lot! > > > > The ABI has some tricky corner cases related to HFA (Homogeneous Float > > > Aggregate). The same argument may need to get passed in both, a FP reg > > > and a GP reg or

Re: RFR: 8303040: linux PPC64le: Implementation of Foreign Function & Memory API (Preview) [v2]

2023-02-23 Thread Jorn Vernee
On Thu, 23 Feb 2023 04:44:18 GMT, Martin Doerr wrote: > > > (I'd be happy to implement the needed changes in shared code if you want, > > > since it touches `BindingSpecializer` which is pretty dense) > > > > > > FYI: > > [master...JornVernee:jdk:I2L](https://github.com/openjdk/jdk/compare/ma

Re: RFR: 8303040: linux PPC64le: Implementation of Foreign Function & Memory API (Preview)

2023-02-22 Thread Jorn Vernee
On Wed, 22 Feb 2023 05:31:46 GMT, Martin Doerr wrote: > Implementation of "Foreign Function & Memory API" for linux on Power (Little > Endian) according to "Power Architecture 64-Bit ELF V2 ABI Specification". > > This PR does not include code for VaList support because it's supposed to get >

Re: RFR: 8303040: linux PPC64le: Implementation of Foreign Function & Memory API (Preview)

2023-02-22 Thread Jorn Vernee
On Wed, 22 Feb 2023 17:03:16 GMT, Jorn Vernee wrote: > (I'd be happy to implement the needed changes in shared code if you want, > since it touches `BindingSpecializer` which is pretty dense) FYI: https://github.com/openjdk/jdk/compare/master...JornVernee:jdk:I2L (assuming `I2L` h

Re: RFR: 8303040: linux PPC64le: Implementation of Foreign Function & Memory API (Preview)

2023-02-22 Thread Jorn Vernee
On Wed, 22 Feb 2023 05:31:46 GMT, Martin Doerr wrote: > Implementation of "Foreign Function & Memory API" for linux on Power (Little > Endian) according to "Power Architecture 64-Bit ELF V2 ABI Specification". > > This PR does not include code for VaList support because it's supposed to get >

Re: RFR: 8302154: Hidden classes created by LambdaMetaFactory can't be unloaded [v2]

2023-02-22 Thread Jorn Vernee
On Thu, 9 Feb 2023 18:11:18 GMT, Volker Simonis wrote: >> Prior to >> [JDK-8239384](https://bugs.openjdk.org/browse/JDK-8239384)/[JDK-8238358](https://bugs.openjdk.org/browse/JDK-8238358) >> LambdaMetaFactory has created VM-anonymous classes which could easily be >> unloaded once they were not

Re: RFR: 8302154: Hidden classes created by LambdaMetaFactory can't be unloaded [v2]

2023-02-17 Thread Jorn Vernee
On Fri, 17 Feb 2023 20:01:08 GMT, Volker Simonis wrote: > (because they are all not referenced from the program any more). So, it sounds like this is testing a case where `LambdaMetafactory.metafactory` is being called directly? I'd like to point out that, while I buy that people are doing thi

Re: RFR: JDK-8301460: Clean up LambdaForm to reference BasicType enums directly [v2]

2023-02-14 Thread Jorn Vernee
On Tue, 14 Feb 2023 19:30:27 GMT, Mandy Chung wrote: >> `LambdaForm` declares int constants for `BasicType::ordinal` to workaround >> JDK-8161245. Now these int constants are no longer needed.This removes >> these int constants and reference `BasicType` enums directly. > > Mandy Chung has

Re: RFR: JDK-8301460: Clean up LambdaForm to reference BasicType enums directly

2023-02-14 Thread Jorn Vernee
On Mon, 13 Feb 2023 22:05:15 GMT, Mandy Chung wrote: > `LambdaForm` declares int constants for `BasicType::ordinal` to workaround > JDK-8161245. Now these int constants are no longer needed.This removes > these int constants and reference `BasicType` enums directly. src/java.base/share/c

Re: RFR: 8302154: Hidden classes created by LambdaMetaFactory can't be unloaded

2023-02-09 Thread Jorn Vernee
On Thu, 9 Feb 2023 15:20:23 GMT, Volker Simonis wrote: > Prior to > [JDK-8239384](https://bugs.openjdk.org/browse/JDK-8239384)/[JDK-8238358](https://bugs.openjdk.org/browse/JDK-8238358) > LambdaMetaFactory has created VM-anonymous classes which could easily be > unloaded once they were not ref

Re: RFR: 8300693: Lower the compile threshold and reduce the iterations of warmup loop in VarHandles tests

2023-01-20 Thread Jorn Vernee
On Thu, 19 Jan 2023 20:43:11 GMT, Mandy Chung wrote: > `java/lang/invoke/VarHandles` tests run with C1, C2 and tiered compilations > and the test cases are executed in the warm up loop with 2 iterations to > verify C1, C2 intrinsics. Default Tier4CompileThreshold is 15000. > > This PR pro

Re: [jdk20] RFR: 8300275: SegmentScope.isAccessibleBy returning incorrect values

2023-01-18 Thread Jorn Vernee
On Tue, 17 Jan 2023 18:30:16 GMT, Maurizio Cimadamore wrote: > The implementation of MemorySessionImpl::isAccessibleBy is incorrect, and > ends up always returning `false` for scopes associated with shared arenas. > This patch rectifies that, and adds some tests. Marked as reviewed by jvernee

Re: RFR: 8293841: RISC-V: Implementation of Foreign Function & Memory API (Preview) [v5]

2023-01-14 Thread Jorn Vernee
On Tue, 10 Jan 2023 15:15:23 GMT, Feilong Jiang wrote: >> Add experimental Foreign Function & Memory API support for RISC-V. >> >> For details of the FFM API RISC-V port please refer to [JBS >> issue](https://bugs.openjdk.org/browse/JDK-8293841) >> >> Testing: >> >> - [x] jdk_foreign with rel

Re: RFR: 8293841: RISC-V: Implementation of Foreign Function & Memory API (Preview) [v5]

2023-01-13 Thread Jorn Vernee
On Tue, 10 Jan 2023 15:15:23 GMT, Feilong Jiang wrote: >> Add experimental Foreign Function & Memory API support for RISC-V. >> >> For details of the FFM API RISC-V port please refer to [JBS >> issue](https://bugs.openjdk.org/browse/JDK-8293841) >> >> Testing: >> >> - [x] jdk_foreign with rel

[jdk20] Integrated: 8299090: Specify coordinate order for additional CaptureCallState parameters on class as well

2023-01-11 Thread Jorn Vernee
On Wed, 11 Jan 2023 02:19:26 GMT, Jorn Vernee wrote: > A small doc clarification that also specifies where the additional > MemorySegment parameter of a downcall method handle linked with the > captureCallState option appears in the parameter list, on the > CaptureCallState class

Re: RFR: 8299978: Remove MethodHandleNatives.getMembers

2023-01-11 Thread Jorn Vernee
On Wed, 11 Jan 2023 15:13:14 GMT, Claes Redestad wrote: > This removes `MethodHandleNatives.getMembers`, which has fallen into disuse. Marked as reviewed by jvernee (Reviewer). - PR: https://git.openjdk.org/jdk/pull/11949

Re: [jdk20] RFR: 8299090: Specify coordinate order for additional CaptureCallState parameters on class as well [v3]

2023-01-11 Thread Jorn Vernee
On Wed, 11 Jan 2023 13:52:07 GMT, Jorn Vernee wrote: >> A small doc clarification that also specifies where the additional >> MemorySegment parameter of a downcall method handle linked with the >> captureCallState option appears in the parameter list, on the >>

Re: [jdk20] RFR: 8299090: Specify coordinate order for additional CaptureCallState parameters on class as well [v2]

2023-01-11 Thread Jorn Vernee
On Wed, 11 Jan 2023 13:33:30 GMT, Maurizio Cimadamore wrote: >> Jorn Vernee has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Mention SegmentAllocator parameter as well > > src/java.base/share/classes/java

Re: [jdk20] RFR: 8299090: Specify coordinate order for additional CaptureCallState parameters on class as well [v3]

2023-01-11 Thread Jorn Vernee
> A small doc clarification that also specifies where the additional > MemorySegment parameter of a downcall method handle linked with the > captureCallState option appears in the parameter list, on the > CaptureCallState class. Jorn Vernee has updated the pull request incrementa

Re: [jdk20] RFR: 8299090: Specify coordinate order for additional CaptureCallState parameters on class as well [v2]

2023-01-11 Thread Jorn Vernee
On Wed, 11 Jan 2023 12:53:04 GMT, Jorn Vernee wrote: >> src/java.base/share/classes/java/lang/foreign/Linker.java line 328: >> >>> 326: * For this purpose, a downcall method handle linked with the >>> {@link #captureCallState(String[])} >>>

Re: [jdk20] RFR: 8299090: Specify coordinate order for additional CaptureCallState parameters on class as well [v2]

2023-01-11 Thread Jorn Vernee
> A small doc clarification that also specifies where the additional > MemorySegment parameter of a downcall method handle linked with the > captureCallState option appears in the parameter list, on the > CaptureCallState class. Jorn Vernee has updated the pull request incrementa

Re: [jdk20] RFR: 8299090: Specify coordinate order for additional CaptureCallState parameters on class as well

2023-01-11 Thread Jorn Vernee
On Wed, 11 Jan 2023 12:33:37 GMT, Maurizio Cimadamore wrote: >> A small doc clarification that also specifies where the additional >> MemorySegment parameter of a downcall method handle linked with the >> captureCallState option appears in the parameter list, on the >> CaptureCallState class.

[jdk20] RFR: 8299090: Specify coordinate order for additional CaptureCallState parameters on class as well

2023-01-10 Thread Jorn Vernee
A small doc clarification that also specifies where the additional MemorySegment parameter of a downcall method handle linked with the captureCallState option appears in the parameter list, on the CaptureCallState class. - Commit messages: - add parameter order clarification Chan

Re: [jdk20] RFR: 8299862: OfAddress setter should disallow heap segments

2023-01-10 Thread Jorn Vernee
On Tue, 10 Jan 2023 14:04:38 GMT, Maurizio Cimadamore wrote: > When unifying memory address with memory segments, we missed the case where a > heap memory segment is passed as a value to a var handle address setters. > > The solution is to reuse the same check we use when validating segment >

Re: [jdk20] RFR: 8299561: VaList.empty() doesn't return a list associated with the global scope

2023-01-04 Thread Jorn Vernee
On Wed, 4 Jan 2023 10:49:09 GMT, Maurizio Cimadamore wrote: > This patch fixes a long-standing conformance issue: `VaList.empty` is > specified to return a `VaList` associated with the global scope, but in some > platforms (Aarch64/Linux and x64/Linux) the empty list is associated with an > i

Integrated: 8298590: Refactor LambdaForm constructors

2023-01-02 Thread Jorn Vernee
On Fri, 9 Dec 2022 18:02:53 GMT, Jorn Vernee wrote: > Refactor LambdaForm constructors into static factories. > > In the new code, there's only 1 constructor, which simply initializes all > fields. Multiple factory methods are built on top of this, which add various > arg

Re: [jdk20] RFR: 8298797: Specification of some restricted methods is incorrect

2022-12-15 Thread Jorn Vernee
On Thu, 15 Dec 2022 10:43:35 GMT, Maurizio Cimadamore wrote: > This patch fixes some inconsistencies in the javadoc for restricted methods: > > * ModuleLayer.Controller::addEnableNativeAccess has a shorted text in its > `@throws` clause. This shorted text is now used everywhere. > * One overlo

RFR: 8298590: Refactor LambdaForm constructors

2022-12-12 Thread Jorn Vernee
Refactor LambdaForm constructors into static factories. In the new code, there's only 1 constructor, which simply initializes all fields. Multiple factory methods are built on top of this, which add various argument validation/pre-processing and post processing of the constructed lambda forms.

Re: RFR: 8298532: Declare private constructors for FFM internal Architecture implementations

2022-12-12 Thread Jorn Vernee
On Mon, 12 Dec 2022 08:37:02 GMT, Per Minborg wrote: > This PR proposes declaring `AArch64Architecture` and `X86_64Architecture` > `final` and creating a `private` constructor so that this redundant byte code > can be eliminated: > > > public jdk.internal.foreign.abi.x64.X86_64Architecture()

Re: RFR: 8298277: Replace "session" with "scope" for FFM access

2022-12-07 Thread Jorn Vernee
On Wed, 7 Dec 2022 21:55:43 GMT, Per Minborg wrote: > This PR suggests renaming various names from "session" to "scope" in > accordance with https://openjdk.org/jeps/434 > > The PRs contains changes for several sub-components. src/java.base/share/classes/jdk/internal/foreign/MemoryScopeImpl.ja

Re: RFR: 8298177: Various java.lang.invoke cleanups [v4]

2022-12-07 Thread Jorn Vernee
On Wed, 7 Dec 2022 14:08:28 GMT, Claes Redestad wrote: >> Various code cleanups around java.lang.invoke code. Started out with dead >> code removal in `jli.MemberName`, then piled on to fix a set of minor >> inefficiencies (excessive vararg array allocations, unnecessary defensive >> cloning o

Re: RFR: 8298177: Various java.lang.invoke cleanups [v3]

2022-12-06 Thread Jorn Vernee
On Tue, 6 Dec 2022 16:25:12 GMT, Claes Redestad wrote: >> src/java.base/share/classes/java/lang/invoke/MemberName.java line 578: >> >>> 576: throw new LinkageError(m.toString()); >>> 577: } >>> 578: assert(isResolved()); >> >> I don't see why this can be removed. Can

Re: RFR: 8298177: Various java.lang.invoke cleanups [v3]

2022-12-06 Thread Jorn Vernee
On Tue, 6 Dec 2022 18:06:36 GMT, Claes Redestad wrote: >> Various code cleanups around java.lang.invoke code. Started out with dead >> code removal in `jli.MemberName`, then piled on to fix a set of minor >> inefficiencies (excessive vararg array allocations, unnecessary defensive >> cloning o

Re: RFR: 8298177: Various java.lang.invoke cleanups

2022-12-06 Thread Jorn Vernee
On Tue, 6 Dec 2022 15:22:27 GMT, Claes Redestad wrote: > Various code cleanups around java.lang.invoke code. Started out with dead > code removal in `jli.MemberName`, then piled on to fix a set of minor > inefficiencies (excessive vararg array allocations, unnecessary defensive > cloning of pa

Integrated: 8297733: Refactor Cast binding to enum

2022-12-05 Thread Jorn Vernee
On Mon, 28 Nov 2022 20:13:35 GMT, Jorn Vernee wrote: > Refactor the cast binding to an enum, which clearly enumerates all supported > conversions. > > This also fixes a bug where `java/foreign/normalize/TestNormalize` was > failing when running in i

Re: RFR: 8297733: Refactor Cast binding to enum [v2]

2022-12-05 Thread Jorn Vernee
ng > forward to support multiple conversions with the same from and to types, but > requiring different semantics. > > Testing: jdk_foreign test suite. Jorn Vernee has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains two commits:

Integrated: 8296477: Foreign linker implementation update following JEP 434

2022-12-05 Thread Jorn Vernee
On Mon, 7 Nov 2022 14:34:45 GMT, Jorn Vernee wrote: > Pull in linker implementation changes, that include non-trivial changes to VM > code, from the panama-foreign repo into the main JDK. > > This is split off from the main JEP integration to make reviewing easier. > >

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

2022-12-05 Thread Jorn Vernee
a record. > > Please refer to the PR of each individual patch for a more detailed > description. Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision: Remove spurious imports - Changes: - all: https://git.ope

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

2022-12-05 Thread Jorn Vernee
a record. > > Please refer to the PR of each individual patch for a more detailed > description. 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 master - Merge branch 'PR_20'

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

2022-12-05 Thread Jorn Vernee
a record. > > Please refer to the PR of each individual patch for a more detailed > description. Jorn Vernee has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pul

Integrated: 8291359: Specification of method j.l.foreign.VaList::skip still deserves clarification

2022-12-02 Thread Jorn Vernee
On Wed, 30 Nov 2022 18:35:47 GMT, Jorn Vernee wrote: > A small clarification of the VaList spec to say that attempts to access > elements through an incorrect memory layout result in undefined behavior. This pull request has now been integrated. Changeset: 562bc171 Author: Jorn Verne

<    3   4   5   6   7   8   9   10   >