Re: RFR: 8308293: A linker should expose the layouts it supports [v6]

2023-05-26 Thread Maurizio Cimadamore
On Wed, 24 May 2023 09:36:34 GMT, Maurizio Cimadamore wrote: >> This patch adds an instance method on `Linker`, namely >> `Linker::canonicalLayouts` which returns all the layouts known by the linker >> as implementing some ABI type. For instance, if I call this on my machine >> (Linux/x64) I

Re: RFR: 8308293: A linker should expose the layouts it supports [v6]

2023-05-25 Thread Paul Sandoz
On Wed, 24 May 2023 09:36:34 GMT, Maurizio Cimadamore wrote: >> This patch adds an instance method on `Linker`, namely >> `Linker::canonicalLayouts` which returns all the layouts known by the linker >> as implementing some ABI type. For instance, if I call this on my machine >> (Linux/x64) I

Re: RFR: 8308293: A linker should expose the layouts it supports [v5]

2023-05-24 Thread ExE Boss
On Wed, 24 May 2023 09:22:08 GMT, Maurizio Cimadamore wrote: >> This patch adds an instance method on `Linker`, namely >> `Linker::canonicalLayouts` which returns all the layouts known by the linker >> as implementing some ABI type. For instance, if I call this on my machine >> (Linux/x64) I

Re: RFR: 8308293: A linker should expose the layouts it supports [v6]

2023-05-24 Thread Maurizio Cimadamore
> This patch adds an instance method on `Linker`, namely > `Linker::canonicalLayouts` which returns all the layouts known by the linker > as implementing some ABI type. For instance, if I call this on my machine > (Linux/x64) I get this: > > > jshell> import java.lang.foreign.*; > > jshell> L

Re: RFR: 8308293: A linker should expose the layouts it supports [v4]

2023-05-24 Thread Maurizio Cimadamore
On Mon, 22 May 2023 09:34:53 GMT, Maurizio Cimadamore wrote: >> This patch adds an instance method on `Linker`, namely >> `Linker::canonicalLayouts` which returns all the layouts known by the linker >> as implementing some ABI type. For instance, if I call this on my machine >> (Linux/x64) I

Re: RFR: 8308293: A linker should expose the layouts it supports [v5]

2023-05-24 Thread Maurizio Cimadamore
> This patch adds an instance method on `Linker`, namely > `Linker::canonicalLayouts` which returns all the layouts known by the linker > as implementing some ABI type. For instance, if I call this on my machine > (Linux/x64) I get this: > > > jshell> import java.lang.foreign.*; > > jshell> L

Re: RFR: 8308293: A linker should expose the layouts it supports [v4]

2023-05-23 Thread Paul Sandoz
On Tue, 23 May 2023 20:32:10 GMT, Maurizio Cimadamore wrote: > Effectively, what you suggest amount at saying: we do have a JAVA_CHAR > layout, which is mostly there for Java interop. But a native linker (which > only cares about native interop) doesn't really care much about that. Does > tha

Re: RFR: 8308293: A linker should expose the layouts it supports [v4]

2023-05-23 Thread Maurizio Cimadamore
On Tue, 23 May 2023 20:32:10 GMT, Maurizio Cimadamore wrote: > Arguably C `unsigned short` could map to carriers Java `short` or Java > `char`, but i am inclined to say the user should cast between Java `short` to > `char` in such cases. (Another advantage of this is that, should we get prope

Re: RFR: 8308293: A linker should expose the layouts it supports [v4]

2023-05-23 Thread Maurizio Cimadamore
On Mon, 22 May 2023 09:34:53 GMT, Maurizio Cimadamore wrote: >> This patch adds an instance method on `Linker`, namely >> `Linker::canonicalLayouts` which returns all the layouts known by the linker >> as implementing some ABI type. For instance, if I call this on my machine >> (Linux/x64) I

Re: RFR: 8308293: A linker should expose the layouts it supports [v4]

2023-05-23 Thread Paul Sandoz
On Mon, 22 May 2023 09:34:53 GMT, Maurizio Cimadamore wrote: >> This patch adds an instance method on `Linker`, namely >> `Linker::canonicalLayouts` which returns all the layouts known by the linker >> as implementing some ABI type. For instance, if I call this on my machine >> (Linux/x64) I

Re: RFR: 8308293: A linker should expose the layouts it supports [v3]

2023-05-22 Thread Maurizio Cimadamore
On Fri, 19 May 2023 23:08:00 GMT, Paul Sandoz wrote: >>> This look much better. Can we strengthen the specification of >>> `canonicalLayouts` in accordance with the class specification >> >> We can't do more in that method javadoc, think, as that has to be general >> enough for all linkers. I

Re: RFR: 8308293: A linker should expose the layouts it supports [v4]

2023-05-22 Thread Maurizio Cimadamore
On Mon, 22 May 2023 14:34:32 GMT, Per Minborg wrote: > LGTM. Are there any additional types we might consider apart from the basic > ones and `size_t`? Maybe one for an address pointing at `errno`? I think there is a certain gravitational pull towards keeping the set of guaranteed canonical la

Re: RFR: 8308293: A linker should expose the layouts it supports [v4]

2023-05-22 Thread Per Minborg
On Mon, 22 May 2023 09:34:53 GMT, Maurizio Cimadamore wrote: >> This patch adds an instance method on `Linker`, namely >> `Linker::canonicalLayouts` which returns all the layouts known by the linker >> as implementing some ABI type. For instance, if I call this on my machine >> (Linux/x64) I

Re: RFR: 8308293: A linker should expose the layouts it supports [v4]

2023-05-22 Thread Maurizio Cimadamore
> This patch adds an instance method on `Linker`, namely > `Linker::canonicalLayouts` which returns all the layouts known by the linker > as implementing some ABI type. For instance, if I call this on my machine > (Linux/x64) I get this: > > > jshell> import java.lang.foreign.*; > > jshell> L

Re: RFR: 8308293: A linker should expose the layouts it supports [v3]

2023-05-21 Thread Per Minborg
On Fri, 19 May 2023 11:08:10 GMT, Maurizio Cimadamore wrote: >> This patch adds an instance method on `Linker`, namely >> `Linker::canonicalLayouts` which returns all the layouts known by the linker >> as implementing some ABI type. For instance, if I call this on my machine >> (Linux/x64) I

Re: RFR: 8308293: A linker should expose the layouts it supports [v3]

2023-05-19 Thread Paul Sandoz
On Fri, 19 May 2023 22:57:39 GMT, Maurizio Cimadamore wrote: > > This look much better. Can we strengthen the specification of > > `canonicalLayouts` in accordance with the class specification > > We can't do more in that method javadoc, think, as that has to be general > enough for all linke

Re: RFR: 8308293: A linker should expose the layouts it supports [v3]

2023-05-19 Thread Maurizio Cimadamore
On Fri, 19 May 2023 22:43:56 GMT, Paul Sandoz wrote: > This look much better. Can we strengthen the specification of > `canonicalLayouts` in accordance with the class specification We can't do more in that method javadoc, think, as that has to be general enough for all linkers. I think the ru

Re: RFR: 8308293: A linker should expose the layouts it supports [v3]

2023-05-19 Thread Maurizio Cimadamore
On Fri, 19 May 2023 22:20:32 GMT, Paul Sandoz wrote: >> Maurizio Cimadamore has updated the pull request incrementally with two >> additional commits since the last revision: >> >> - Address review comments >> - More javadoc tweaks > > src/java.base/share/classes/java/lang/foreign/Linker.java

Re: RFR: 8308293: A linker should expose the layouts it supports [v3]

2023-05-19 Thread Paul Sandoz
On Fri, 19 May 2023 11:08:10 GMT, Maurizio Cimadamore wrote: >> This patch adds an instance method on `Linker`, namely >> `Linker::canonicalLayouts` which returns all the layouts known by the linker >> as implementing some ABI type. For instance, if I call this on my machine >> (Linux/x64) I

Re: RFR: 8308293: A linker should expose the layouts it supports [v3]

2023-05-19 Thread Paul Sandoz
On Fri, 19 May 2023 11:08:10 GMT, Maurizio Cimadamore wrote: >> This patch adds an instance method on `Linker`, namely >> `Linker::canonicalLayouts` which returns all the layouts known by the linker >> as implementing some ABI type. For instance, if I call this on my machine >> (Linux/x64) I

Re: RFR: 8308293: A linker should expose the layouts it supports [v2]

2023-05-19 Thread Maurizio Cimadamore
On Wed, 17 May 2023 18:18:03 GMT, Maurizio Cimadamore wrote: >> This patch adds an instance method on `Linker`, namely >> `Linker::canonicalLayouts` which returns all the layouts known by the linker >> as implementing some ABI type. For instance, if I call this on my machine >> (Linux/x64) I

Re: RFR: 8308293: A linker should expose the layouts it supports [v3]

2023-05-19 Thread Maurizio Cimadamore
> This patch adds an instance method on `Linker`, namely > `Linker::canonicalLayouts` which returns all the layouts known by the linker > as implementing some ABI type. For instance, if I call this on my machine > (Linux/x64) I get this: > > > jshell> import java.lang.foreign.*; > > jshell> L

Re: RFR: 8308293: A linker should expose the layouts it supports [v2]

2023-05-19 Thread Maurizio Cimadamore
On Wed, 17 May 2023 18:18:03 GMT, Maurizio Cimadamore wrote: >> This patch adds an instance method on `Linker`, namely >> `Linker::canonicalLayouts` which returns all the layouts known by the linker >> as implementing some ABI type. For instance, if I call this on my machine >> (Linux/x64) I

Re: RFR: 8308293: A linker should expose the layouts it supports [v2]

2023-05-18 Thread Maurizio Cimadamore
On Wed, 17 May 2023 18:18:03 GMT, Maurizio Cimadamore wrote: >> This patch adds an instance method on `Linker`, namely >> `Linker::canonicalLayouts` which returns all the layouts known by the linker >> as implementing some ABI type. For instance, if I call this on my machine >> (Linux/x64) I

Re: RFR: 8308293: A linker should expose the layouts it supports [v2]

2023-05-18 Thread Paul Sandoz
On Wed, 17 May 2023 18:18:03 GMT, Maurizio Cimadamore wrote: >> This patch adds an instance method on `Linker`, namely >> `Linker::canonicalLayouts` which returns all the layouts known by the linker >> as implementing some ABI type. For instance, if I call this on my machine >> (Linux/x64) I

Re: RFR: 8308293: A linker should expose the layouts it supports [v2]

2023-05-18 Thread Maurizio Cimadamore
On Thu, 18 May 2023 16:52:15 GMT, Paul Sandoz wrote: > Here's the crux of what i am wondering about. Can we specify native linker > support for a subset of the System V Application Binary Interface (e.g., LP64 > and ILP32 programming models for all non-optional scalar types, sequences of, > an

Re: RFR: 8308293: A linker should expose the layouts it supports [v2]

2023-05-18 Thread Paul Sandoz
On Wed, 17 May 2023 18:18:03 GMT, Maurizio Cimadamore wrote: >> This patch adds an instance method on `Linker`, namely >> `Linker::canonicalLayouts` which returns all the layouts known by the linker >> as implementing some ABI type. For instance, if I call this on my machine >> (Linux/x64) I

Re: RFR: 8308293: A linker should expose the layouts it supports [v2]

2023-05-17 Thread Maurizio Cimadamore
On Wed, 17 May 2023 22:41:16 GMT, Paul Sandoz wrote: > So maybe this comes down to the linker supporting a subset ABI's data types, > and that subset might increase over time, but never decrease? In this respect > could we present a table for each supported linker ABI listing the ABI type > an

Re: RFR: 8308293: A linker should expose the layouts it supports [v2]

2023-05-17 Thread Paul Sandoz
On Wed, 17 May 2023 22:34:32 GMT, Maurizio Cimadamore wrote: >> src/java.base/share/classes/java/lang/foreign/Linker.java line 219: >> >>> 217: * >>> 218: * the alignment constraint of {@code G} is set to its >> href="MemoryLayout.html#layout-align">natural alignment; >>> 219: * the size of

Re: RFR: 8308293: A linker should expose the layouts it supports [v2]

2023-05-17 Thread Paul Sandoz
On Wed, 17 May 2023 18:18:03 GMT, Maurizio Cimadamore wrote: >> This patch adds an instance method on `Linker`, namely >> `Linker::canonicalLayouts` which returns all the layouts known by the linker >> as implementing some ABI type. For instance, if I call this on my machine >> (Linux/x64) I

Re: RFR: 8308293: A linker should expose the layouts it supports [v2]

2023-05-17 Thread Maurizio Cimadamore
On Wed, 17 May 2023 22:08:57 GMT, Paul Sandoz wrote: >> Maurizio Cimadamore has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Tweak javadoc > > src/java.base/share/classes/java/lang/foreign/Linker.java line 219: > >> 217: * >> 218: * t

Re: RFR: 8308293: A linker should expose the layouts it supports [v2]

2023-05-17 Thread Paul Sandoz
On Wed, 17 May 2023 18:18:03 GMT, Maurizio Cimadamore wrote: >> This patch adds an instance method on `Linker`, namely >> `Linker::canonicalLayouts` which returns all the layouts known by the linker >> as implementing some ABI type. For instance, if I call this on my machine >> (Linux/x64) I

Re: RFR: 8308293: A linker should expose the layouts it supports [v2]

2023-05-17 Thread Maurizio Cimadamore
> This patch adds an instance method on `Linker`, namely > `Linker::canonicalLayouts` which returns all the layouts known by the linker > as implementing some ABI type. For instance, if I call this on my machine > (Linux/x64) I get this: > > > jshell> import java.lang.foreign.*; > > jshell> L

Re: RFR: 8308293: A linker should expose the layouts it supports

2023-05-17 Thread Maurizio Cimadamore
On Wed, 17 May 2023 17:15:06 GMT, Maurizio Cimadamore wrote: > This patch adds an instance method on `Linker`, namely > `Linker::canonicalLayouts` which returns all the layouts known by the linker > as implementing some ABI type. For instance, if I call this on my machine > (Linux/x64) I get

RFR: 8308293: A linker should expose the layouts it supports

2023-05-17 Thread Maurizio Cimadamore
This patch adds an instance method on `Linker`, namely `Linker::canonicalLayouts` which returns all the layouts known by the linker as implementing some ABI type. For instance, if I call this on my machine (Linux/x64) I get this: jshell> import java.lang.foreign.*; jshell> Linker.nativeLinker