Re: RFR: 8331865: Consolidate size and alignment checks in LayoutPath

2024-05-29 Thread Maurizio Cimadamore
On Thu, 16 May 2024 14:11:47 GMT, Maurizio Cimadamore wrote: > > > Do we have any performance tests available to see if there are any > > > potential impacts? > > > > > > I've run all micro benchmarks whose name match `LoopOver*`. No regression > > was found. Few benchmarks seems a tad

Re: RFR: 8331865: Consolidate size and alignment checks in LayoutPath [v3]

2024-05-29 Thread Maurizio Cimadamore
On Wed, 22 May 2024 21:03:57 GMT, Jorn Vernee wrote: >> Maurizio Cimadamore has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Fix typo in javadoc > > src/java.base/share/classes/java/lang/invoke/X-VarHandleSegmentView.java.template >

Re: RFR: 8331865: Consolidate size and alignment checks in LayoutPath [v3]

2024-05-22 Thread Jorn Vernee
On Tue, 21 May 2024 10:20:27 GMT, Maurizio Cimadamore wrote: >> When creating a nested memory access var handle, we ensure that the segment >> is accessed at the correct alignment for the root layout being accessed. But >> we do not ensure that the segment has at least the size of the

Re: RFR: 8331865: Consolidate size and alignment checks in LayoutPath [v3]

2024-05-21 Thread Paul Sandoz
On Tue, 21 May 2024 10:20:27 GMT, Maurizio Cimadamore wrote: >> When creating a nested memory access var handle, we ensure that the segment >> is accessed at the correct alignment for the root layout being accessed. But >> we do not ensure that the segment has at least the size of the

Re: RFR: 8331865: Consolidate size and alignment checks in LayoutPath [v3]

2024-05-21 Thread Maurizio Cimadamore
> When creating a nested memory access var handle, we ensure that the segment > is accessed at the correct alignment for the root layout being accessed. But > we do not ensure that the segment has at least the size of the accessed root > layout. Example: > > > MemoryLayout LAYOUT =

Re: RFR: 8331865: Consolidate size and alignment checks in LayoutPath [v2]

2024-05-20 Thread Maurizio Cimadamore
On Mon, 20 May 2024 16:42:19 GMT, Paul Sandoz wrote: > some additional overhead e.g., > > ``` > if (derefAdapters.length == 0) { > // insert align check for the root layout on the initial MS + > offset > List> coordinateTypes = handle.coordinateTypes(); >

Re: RFR: 8331865: Consolidate size and alignment checks in LayoutPath [v2]

2024-05-20 Thread Paul Sandoz
On Mon, 20 May 2024 16:31:18 GMT, Maurizio Cimadamore wrote: > > Ah, got it. You mean more support in VarHandleGuards. Yes, I have a separate > patch for that (actually had that for quite a while), but we're not super > sure how to evaluate what impact it has :-) Ah, i did not realize that.

Re: RFR: 8331865: Consolidate size and alignment checks in LayoutPath [v2]

2024-05-20 Thread Maurizio Cimadamore
On Mon, 20 May 2024 09:45:31 GMT, Maurizio Cimadamore wrote: > > Separately, we might be missing a few long argument accepting guard methods > > for simpler cases as I suspect they are still focused more on int index > > types. > > Not sure I understand what guard methods you are referring

Re: RFR: 8331865: Consolidate size and alignment checks in LayoutPath [v2]

2024-05-20 Thread Maurizio Cimadamore
On Fri, 17 May 2024 23:42:17 GMT, Paul Sandoz wrote: > Separately, we might be missing a few long argument accepting guard methods > for simpler cases as I suspect they are still focused more on int index types. Not sure I understand what guard methods you are referring to here? -

Re: RFR: 8331865: Consolidate size and alignment checks in LayoutPath [v2]

2024-05-17 Thread Paul Sandoz
On Thu, 16 May 2024 14:37:15 GMT, Maurizio Cimadamore wrote: >> When creating a nested memory access var handle, we ensure that the segment >> is accessed at the correct alignment for the root layout being accessed. But >> we do not ensure that the segment has at least the size of the

Re: RFR: 8331865: Consolidate size and alignment checks in LayoutPath [v2]

2024-05-17 Thread Maurizio Cimadamore
On Fri, 17 May 2024 15:54:04 GMT, Paul Sandoz wrote: >> Maurizio Cimadamore has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Fix copyrights > > src/java.base/share/classes/java/lang/foreign/MemoryLayout.java line 630: > >> 628: *

Re: RFR: 8331865: Consolidate size and alignment checks in LayoutPath [v2]

2024-05-17 Thread Paul Sandoz
On Thu, 16 May 2024 14:37:15 GMT, Maurizio Cimadamore wrote: >> When creating a nested memory access var handle, we ensure that the segment >> is accessed at the correct alignment for the root layout being accessed. But >> we do not ensure that the segment has at least the size of the

Re: RFR: 8331865: Consolidate size and alignment checks in LayoutPath [v2]

2024-05-16 Thread Maurizio Cimadamore
> When creating a nested memory access var handle, we ensure that the segment > is accessed at the correct alignment for the root layout being accessed. But > we do not ensure that the segment has at least the size of the accessed root > layout. Example: > > > MemoryLayout LAYOUT =

Re: RFR: 8331865: Consolidate size and alignment checks in LayoutPath [v2]

2024-05-16 Thread Maurizio Cimadamore
On Thu, 16 May 2024 14:34:41 GMT, Maurizio Cimadamore wrote: >> When creating a nested memory access var handle, we ensure that the segment >> is accessed at the correct alignment for the root layout being accessed. But >> we do not ensure that the segment has at least the size of the

Re: RFR: 8331865: Consolidate size and alignment checks in LayoutPath

2024-05-16 Thread Maurizio Cimadamore
On Thu, 16 May 2024 13:55:15 GMT, Maurizio Cimadamore wrote: > > Do we have any performance tests available to see if there are any > > potential impacts? > > I've run all micro benchmarks whose name match `LoopOver*`. No regression was > found. Few benchmarks seems a tad faster, but the

Re: RFR: 8331865: Consolidate size and alignment checks in LayoutPath

2024-05-16 Thread Maurizio Cimadamore
On Thu, 16 May 2024 11:18:18 GMT, Per Minborg wrote: > Do we have any performance tests available to see if there are any potential > impacts? I've run all micro benchmarks whose name match `LoopOver*`. No regression was found. Few benchmarks seems a tad faster, but the percentages are so

Re: RFR: 8331865: Consolidate size and alignment checks in LayoutPath

2024-05-16 Thread Per Minborg
On Wed, 15 May 2024 15:43:45 GMT, Maurizio Cimadamore wrote: > When creating a nested memory access var handle, we ensure that the segment > is accessed at the correct alignment for the root layout being accessed. But > we do not ensure that the segment has at least the size of the accessed

Re: RFR: 8331865: Consolidate size and alignment checks in LayoutPath

2024-05-16 Thread Maurizio Cimadamore
On Thu, 16 May 2024 10:54:15 GMT, Maurizio Cimadamore wrote: >> When creating a nested memory access var handle, we ensure that the segment >> is accessed at the correct alignment for the root layout being accessed. But >> we do not ensure that the segment has at least the size of the

Re: RFR: 8331865: Consolidate size and alignment checks in LayoutPath

2024-05-16 Thread Maurizio Cimadamore
On Wed, 15 May 2024 15:43:45 GMT, Maurizio Cimadamore wrote: > When creating a nested memory access var handle, we ensure that the segment > is accessed at the correct alignment for the root layout being accessed. But > we do not ensure that the segment has at least the size of the accessed

RFR: 8331865: Consolidate size and alignment checks in LayoutPath

2024-05-16 Thread Maurizio Cimadamore
When creating a nested memory access var handle, we ensure that the segment is accessed at the correct alignment for the root layout being accessed. But we do not ensure that the segment has at least the size of the accessed root layout. Example: MemoryLayout LAYOUT = sequenceLayout(2,