Integrated: 8332749: Broken link in MemorySegment.Scope.html

2024-05-23 Thread Per Minborg
On Thu, 23 May 2024 11:39:11 GMT, Per Minborg wrote: > This PR proposes to fix a broken link in the `MemorySegment.Scope` class. This pull request has now been integrated. Changeset: 0a9d1f8c Author: Per Minborg URL: https://git.openjdk.org/jdk/com

Re: RFR: 8332749: Broken link in MemorySegment.Scope.html

2024-05-23 Thread Per Minborg
On Thu, 23 May 2024 11:39:11 GMT, Per Minborg wrote: > This PR proposes to fix a broken link in the `MemorySegment.Scope` class. Seams to work after the patch: ![image](https://github.com/openjdk/jdk/assets/7457876/6a48599b-0e08-40b0-938e-f7cb13b74ae6) .../api/java.base/java/lang/fore

RFR: 8332749: Broken link in MemorySegment.Scope.html

2024-05-23 Thread Per Minborg
This PR proposes to fix a broken link in the `MemorySegment.Scope` class. - Commit messages: - Fix link to section Changes: https://git.openjdk.org/jdk/pull/19366/files Webrev: https://webrevs.openjdk.org/?repo=jdk=19366=00 Issue: https://bugs.openjdk.org/browse/JDK-8332749

Re: RFR: 8330465: Stable Values and Collections (Internal) [v20]

2024-05-21 Thread Per Minborg
On Fri, 17 May 2024 09:31:33 GMT, Per Minborg wrote: >> # Stable Values & Collections (Internal) >> >> ## Summary >> This PR proposes to introduce an internal _Stable Values & Collections_ API, >> which provides immutable value holders where elements are

Re: RFR: 8330465: Stable Values and Collections (Internal) [v20]

2024-05-17 Thread Per Minborg
On Fri, 17 May 2024 09:31:33 GMT, Per Minborg wrote: >> # Stable Values & Collections (Internal) >> >> ## Summary >> This PR proposes to introduce an internal _Stable Values & Collections_ API, >> which provides immutable value holders where elements are

Re: RFR: 8330465: Stable Values and Collections (Internal) [v20]

2024-05-17 Thread Per Minborg
pared to `ArrayList` instances > (which are not thread-safe) (all threads): > > > Benchmark Mode Cnt Score > Error Units > StableListElementBenchmark.instanceArrayList thrpt 10 5812.992 ? > 1169.730 ops/us > StableListElementBenchmark.instanceList

Re: RFR: 8330465: Stable Values and Collections (Internal) [v19]

2024-05-17 Thread Per Minborg
pared to `ArrayList` instances > (which are not thread-safe) (all threads): > > > Benchmark Mode Cnt Score > Error Units > StableListElementBenchmark.instanceArrayList thrpt 10 5812.992 ? > 1169.730 ops/us > StableListElementBenchmark.instanceList

Re: RFR: 8330465: Stable Values and Collections (Internal) [v18]

2024-05-17 Thread Per Minborg
pared to `ArrayList` instances > (which are not thread-safe) (all threads): > > > Benchmark Mode Cnt Score > Error Units > StableListElementBenchmark.instanceArrayList thrpt 10 5812.992 ? > 1169.730 ops/us > StableListElementBenchmark.instanceList

Re: RFR: 8330465: Stable Values and Collections (Internal) [v17]

2024-05-17 Thread Per Minborg
pared to `ArrayList` instances > (which are not thread-safe) (all threads): > > > Benchmark Mode Cnt Score > Error Units > StableListElementBenchmark.instanceArrayList thrpt 10 5812.992 ? > 1169.730 ops/us > StableListElementBenchmark.instanceList

Re: RFR: 8330465: Stable Values and Collections (Internal) [v16]

2024-05-17 Thread Per Minborg
On Thu, 16 May 2024 12:48:24 GMT, Per Minborg wrote: >> # Stable Values & Collections (Internal) >> >> ## Summary >> This PR proposes to introduce an internal _Stable Values & Collections_ API, >> which provides immutable value holders where elements are

Re: RFR: 8330465: Stable Values and Collections (Internal) [v16]

2024-05-16 Thread Per Minborg
On Thu, 16 May 2024 12:48:24 GMT, Per Minborg wrote: >> # Stable Values & Collections (Internal) >> >> ## Summary >> This PR proposes to introduce an internal _Stable Values & Collections_ API, >> which provides immutable value holders where elements are

Re: RFR: 8331670: Deprecate the Memory-Access Methods in sun.misc.Unsafe for Removal [v2]

2024-05-16 Thread Per Minborg
On Thu, 16 May 2024 07:14:53 GMT, Alan Bateman wrote: >> This is the implementation changes for JEP 471. >> >> The methods in sun.misc.Unsafe for on-heap and off-heap access are >> deprecated for removal. This means a removal warning at compile time. No >> methods have been removed. A

Re: RFR: 8330465: Stable Values and Collections (Internal) [v16]

2024-05-16 Thread Per Minborg
pared to `ArrayList` instances > (which are not thread-safe) (all threads): > > > Benchmark Mode Cnt Score > Error Units > StableListElementBenchmark.instanceArrayList thrpt 10 5812.992 ? > 1169.730 ops/us > StableListElementBenchmark.instanceList

Re: RFR: 8330465: Stable Values and Collections (Internal) [v15]

2024-05-16 Thread Per Minborg
pared to `ArrayList` instances > (which are not thread-safe) (all threads): > > > Benchmark Mode Cnt Score > Error Units > StableListElementBenchmark.instanceArrayList thrpt 10 5812.992 ? > 1169.730 ops/us > StableListElementBenchmark.instanceList

Re: RFR: 8330465: Stable Values and Collections (Internal) [v14]

2024-05-16 Thread Per Minborg
pared to `ArrayList` instances > (which are not thread-safe) (all threads): > > > Benchmark Mode Cnt Score > Error Units > StableListElementBenchmark.instanceArrayList thrpt 10 5812.992 ? > 1169.730 ops/us > StableListElementBenchmark.instanceList

Re: RFR: 8330465: Stable Values and Collections (Internal) [v13]

2024-05-16 Thread Per Minborg
pared to `ArrayList` instances > (which are not thread-safe) (all threads): > > > Benchmark Mode Cnt Score > Error Units > StableListElementBenchmark.instanceArrayList thrpt 10 5812.992 ? > 1169.730 ops/us > StableListElementBenchmark.instanceList

Re: RFR: 8330465: Stable Values and Collections (Internal) [v5]

2024-05-16 Thread Per Minborg
On Thu, 16 May 2024 11:14:16 GMT, Chen Liang wrote: >> The idea here is to have the most likely value in the middle... Not sure if >> that motivates the added complexity though. > > Is there any refernce on how/why the middle entry in a tableswitch > instruction is the fastest? It is only in

Re: RFR: 8330465: Stable Values and Collections (Internal) [v5]

2024-05-16 Thread Per Minborg
On Thu, 16 May 2024 11:13:24 GMT, Chen Liang wrote: >> It seems reasonable to assume `null` values are not constant-folded. For >> straight-out-of-the-box usage, there is no apparent significant difference >> as indicated by a new benchmark I just added: >> >> >> Benchmark

Re: RFR: 8330465: Stable Values and Collections (Internal) [v12]

2024-05-16 Thread Per Minborg
pared to `ArrayList` instances > (which are not thread-safe) (all threads): > > > Benchmark Mode Cnt Score > Error Units > StableListElementBenchmark.instanceArrayList thrpt 10 5812.992 ? > 1169.730 ops/us > StableListElementBenchmark.instanceList

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: 8330465: Stable Values and Collections (Internal) [v11]

2024-05-16 Thread Per Minborg
pared to `ArrayList` instances > (which are not thread-safe) (all threads): > > > Benchmark Mode Cnt Score > Error Units > StableListElementBenchmark.instanceArrayList thrpt 10 5812.992 ? > 1169.730 ops/us > StableListElementBenchmark.instanceList

Re: RFR: 8330465: Stable Values and Collections (Internal) [v10]

2024-05-16 Thread Per Minborg
pared to `ArrayList` instances > (which are not thread-safe) (all threads): > > > Benchmark Mode Cnt Score > Error Units > StableListElementBenchmark.instanceArrayList thrpt 10 5812.992 ? > 1169.730 ops/us > StableListElementBenchmark.instanceList

Re: RFR: 8330465: Stable Values and Collections (Internal) [v5]

2024-05-16 Thread Per Minborg
On Wed, 15 May 2024 16:26:57 GMT, Chen Liang wrote: >> Per Minborg has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Switch to monomorphic StableValue and use lazy arrays > > src/java.base/share/cl

Re: RFR: 8330465: Stable Values and Collections (Internal) [v4]

2024-05-16 Thread Per Minborg
On Wed, 15 May 2024 15:49:22 GMT, Chen Liang wrote: >> Maybe there is a better home for this? > > I don't think we should publish this API; this will soon be phased out by > strict final fields (written only before super constructor calls) introduced > by Valhalla, as strict final fields are

Re: RFR: 8330465: Stable Values and Collections (Internal) [v5]

2024-05-16 Thread Per Minborg
On Wed, 15 May 2024 16:29:08 GMT, Chen Liang wrote: >> Per Minborg has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Switch to monomorphic StableValue and use lazy arrays > > src/java.base/share/cl

Re: RFR: 8330465: Stable Values and Collections (Internal) [v9]

2024-05-16 Thread Per Minborg
pared to `ArrayList` instances > (which are not thread-safe) (all threads): > > > Benchmark Mode Cnt Score > Error Units > StableListElementBenchmark.instanceArrayList thrpt 10 5812.992 ? > 1169.730 ops/us > StableListElementBenchmark.instanceList

Re: RFR: 8330465: Stable Values and Collections (Internal) [v5]

2024-05-16 Thread Per Minborg
On Wed, 15 May 2024 16:31:15 GMT, Chen Liang wrote: >> Per Minborg has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Switch to monomorphic StableValue and use lazy arrays > > src/java.base/share/cl

Re: RFR: 8330465: Stable Values and Collections (Internal) [v8]

2024-05-16 Thread Per Minborg
pared to `ArrayList` instances > (which are not thread-safe) (all threads): > > > Benchmark Mode Cnt Score > Error Units > StableListElementBenchmark.instanceArrayList thrpt 10 5812.992 ? > 1169.730 ops/us > StableListElementBenchmark.instanceList

Re: RFR: 8330465: Stable Values and Collections (Internal) [v5]

2024-05-16 Thread Per Minborg
On Wed, 15 May 2024 19:07:26 GMT, Chen Liang wrote: >> Yes, according to the `@Stable` annotation’s JavaDoc, this is UB: >> https://github.com/openjdk/jdk/blob/8a4315f833f3700075d65fae6bc566011c837c07/src/java.base/share/classes/jdk/internal/vm/annotation/Stable.java#L74-L80 > > Fyi what usually

Re: RFR: 8330465: Stable Values and Collections (Internal) [v7]

2024-05-16 Thread Per Minborg
pared to `ArrayList` instances > (which are not thread-safe) (all threads): > > > Benchmark Mode Cnt Score > Error Units > StableListElementBenchmark.instanceArrayList thrpt 10 5812.992 ? > 1169.730 ops/us > StableListElementBenchmark.instanceList

Re: RFR: 8330465: Stable Values and Collections (Internal) [v6]

2024-05-16 Thread Per Minborg
pared to `ArrayList` instances > (which are not thread-safe) (all threads): > > > Benchmark Mode Cnt Score > Error Units > StableListElementBenchmark.instanceArrayList thrpt 10 5812.992 ? > 1169.730 ops/us > StableListElementBenchmark.instanceList

Re: RFR: 8330465: Stable Values and Collections (Internal) [v5]

2024-05-16 Thread Per Minborg
On Thu, 16 May 2024 07:19:54 GMT, Per Minborg wrote: >> src/java.base/share/classes/jdk/internal/lang/StableValue.java line 384: >> >>> 382: * @param the memoized type >>> 383: */ >>> 384: static Supplier ofSupplier(Supplier orig

Re: RFR: 8330465: Stable Values and Collections (Internal) [v5]

2024-05-16 Thread Per Minborg
On Wed, 15 May 2024 16:25:04 GMT, Chen Liang wrote: >> Per Minborg has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Switch to monomorphic StableValue and use lazy arrays > > src/java.base/share/classes/jdk/

Re: RFR: 8330465: Stable Values and Collections (Internal) [v5]

2024-05-16 Thread Per Minborg
On Wed, 15 May 2024 16:19:05 GMT, Chen Liang wrote: >> Per Minborg has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Switch to monomorphic StableValue and use lazy arrays > > src/java.base/share/cl

Re: RFR: 8330465: Stable Values and Collections (Internal) [v5]

2024-05-16 Thread Per Minborg
On Wed, 15 May 2024 16:11:56 GMT, Chen Liang wrote: >> Per Minborg has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Switch to monomorphic StableValue and use lazy arrays > > src/java.base/share/cl

Re: RFR: 8330465: Stable Values and Collections (Internal) [v5]

2024-05-16 Thread Per Minborg
On Wed, 15 May 2024 18:45:16 GMT, ExE Boss wrote: >> src/java.base/share/classes/jdk/internal/lang/stable/StableValueImpl.java >> line 104: >> >>> 102: // Optimistically try plain semantics first >>> 103: final V v = value; >>> 104: if (v != null) { >> >> If `value ==

Re: RFR: 8330465: Stable Values and Collections (Internal) [v5]

2024-05-15 Thread Per Minborg
On Wed, 15 May 2024 15:27:34 GMT, Per Minborg wrote: >> # Stable Values & Collections (Internal) >> >> ## Summary >> This PR proposes to introduce an internal _Stable Values & Collections_ API, >> which provides immutable value holders where elements are

Re: RFR: 8330465: Stable Values and Collections (Internal) [v4]

2024-05-15 Thread Per Minborg
On Wed, 15 May 2024 08:53:32 GMT, ExE Boss wrote: >> Per Minborg has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Revise docs for ofBackground() > > src/java.base/share/classes/jdk/internal/lang/St

Re: RFR: 8330465: Stable Values and Collections (Internal) [v5]

2024-05-15 Thread Per Minborg
> > > Benchmark Mode Cnt Score Error Units > StableListSumBenchmark.instanceArrayList avgt 10 0.356 ? 0.005 ns/op > StableListSumBenchmark.instanceList avgt 10 0.373 ? 0.017 ns/op > <- Stable list > StableListSumBenchmark.stati

Re: RFR: 8330465: Stable Values and Collections (Internal) [v4]

2024-05-15 Thread Per Minborg
On Wed, 15 May 2024 12:26:34 GMT, Rémi Forax wrote: >> Given that `TrustedFieldType` is more generic than stable values, it could >> be moved to `jdk.internal.misc` or `jdk.internal.reflect`, then  >> `jdk.unsupported` could use it without exporting new packages to  >> `jdk.unsupported`. > > At

Re: RFR: 8330465: Stable Values and Collections (Internal) [v4]

2024-05-15 Thread Per Minborg
> > > Benchmark Mode Cnt Score Error Units > StableListSumBenchmark.instanceArrayList avgt 10 0.356 ? 0.005 ns/op > StableListSumBenchmark.instanceList avgt 10 0.373 ? 0.017 ns/op > <- Stable list > StableListSumBenchmark.stati

Re: RFR: 8330465: Stable Values and Collections (Internal) [v3]

2024-05-15 Thread Per Minborg
> > > Benchmark Mode Cnt Score Error Units > StableListSumBenchmark.instanceArrayList avgt 10 0.356 ? 0.005 ns/op > StableListSumBenchmark.instanceList avgt 10 0.373 ? 0.017 ns/op > <- Stable list > StableListSumBenchmark.stati

Re: RFR: 8330465: Stable Values and Collections (Internal) [v2]

2024-05-15 Thread Per Minborg
On Tue, 14 May 2024 16:02:41 GMT, Viktor Klang wrote: >> Per Minborg has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Remove text in public class that references an internal class > > src/java.base/s

Re: RFR: 8330465: Stable Values and Collections (Internal) [v2]

2024-05-14 Thread Per Minborg
On Tue, 14 May 2024 14:19:44 GMT, Alan Bateman wrote: >> Per Minborg has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Remove text in public class that references an internal class > > src/java.base/s

Re: RFR: 8330465: Stable Values and Collections (Internal) [v2]

2024-05-14 Thread Per Minborg
> > > Benchmark Mode Cnt Score Error Units > StableListSumBenchmark.instanceArrayList avgt 10 0.356 ? 0.005 ns/op > StableListSumBenchmark.instanceList avgt 10 0.373 ? 0.017 ns/op > <- Stable list > StableListSumBenchmark.stati

Re: RFR: 8305457: Implement java.io.IO [v9]

2024-05-14 Thread Per Minborg
On Mon, 13 May 2024 09:56:35 GMT, Pavel Rappo wrote: >> Please review this PR which introduces the `java.io.IO` top-level class and >> three methods to `java.io.Console` for [Implicitly Declared Classes and >> Instance Main Methods (Third Preview)]. >> >> This PR has been obtained as `git

Re: RFR: 8330465: Stable Values and Collections (Internal)

2024-05-14 Thread Per Minborg
On Mon, 22 Apr 2024 09:34:39 GMT, Per Minborg wrote: >> src/java.base/share/classes/jdk/internal/lang/stable/StableValueElement.java >> line 116: >> >>> 114: public V computeIfUnset(Supplier supplier) { >>> 115: // Todo: This crea

Re: RFR: 8330465: Stable Values and Collections (Internal)

2024-05-14 Thread Per Minborg
On Fri, 19 Apr 2024 09:32:56 GMT, ExE Boss wrote: >> # Stable Values & Collections (Internal) >> >> ## Summary >> This PR proposes to introduce an internal _Stable Values & Collections_ API, >> which provides immutable value holders where elements are initialized _at >> most once_. Stable

Re: RFR: 8330465: Stable Values and Collections (Internal)

2024-05-14 Thread Per Minborg
On Mon, 22 Apr 2024 17:09:39 GMT, Chen Liang wrote: >> src/java.base/share/classes/jdk/internal/lang/StableValue.java line 130: >> >>> 128: * } else { >>> 129: * V newValue = supplier.get(); >>> 130: * stable.setOrThrow(newValue); >> >> If ::computeIfUnset allows racy

Re: RFR: 8330465: Stable Values and Collections (Internal)

2024-05-14 Thread Per Minborg
On Wed, 17 Apr 2024 14:24:59 GMT, Maurizio Cimadamore wrote: >> # Stable Values & Collections (Internal) >> >> ## Summary >> This PR proposes to introduce an internal _Stable Values & Collections_ API, >> which provides immutable value holders where elements are initialized _at >> most

Re: RFR: 8330465: Stable Values and Collections (Internal)

2024-05-14 Thread Per Minborg
On Mon, 13 May 2024 12:18:28 GMT, Chen Liang wrote: >> As we need the array in both cases, how would such a solution look like >> without duplicating code? > > I was thinking about changing the StableEnumMap factory to directly take an > EnumSet/BitSet indicating the indices without

Re: RFR: 8330465: Stable Values and Collections (Internal)

2024-05-14 Thread Per Minborg
On Tue, 23 Apr 2024 09:17:29 GMT, Per Minborg wrote: >> src/java.base/share/classes/java/util/ImmutableCollections.java line 183: >> >>> 181:K key, >>> 182:Function&

Re: RFR: 8330465: Stable Values and Collections (Internal)

2024-05-14 Thread Per Minborg
On Tue, 14 May 2024 11:07:00 GMT, Per Minborg wrote: >> # Stable Values & Collections (Internal) >> >> ## Summary >> This PR proposes to introduce an internal _Stable Values & Collections_ API, >> which provides immutable value holders where elements are

Re: RFR: 8330465: Stable Values and Collections (Internal)

2024-05-14 Thread Per Minborg
On Mon, 22 Apr 2024 16:31:15 GMT, Dan Heidinga wrote: >> # Stable Values & Collections (Internal) >> >> ## Summary >> This PR proposes to introduce an internal _Stable Values & Collections_ API, >> which provides immutable value holders where elements are initialized _at >> most once_. Stable

Re: RFR: 8330465: Stable Values and Collections (Internal)

2024-05-14 Thread Per Minborg
On Tue, 16 Apr 2024 11:47:23 GMT, Per Minborg wrote: > # Stable Values & Collections (Internal) > > ## Summary > This PR proposes to introduce an internal _Stable Values & Collections_ API, > which provides immutable value holders where elements are initialized _at >

RFR: 8330465: Stable Values and Collections (Internal)

2024-05-14 Thread Per Minborg
# Stable Values & Collections (Internal) ## Summary This PR proposes to introduce an internal _Stable Values & Collections_ API, which provides immutable value holders where elements are initialized _at most once_. Stable Values & Collections offer the performance and safety benefits of final

Re: RFR: 8330465: Stable Values and Collections (Internal)

2024-05-14 Thread Per Minborg
On Wed, 17 Apr 2024 15:17:52 GMT, Per Minborg wrote: >> Also, I want to mention a few important differences between `@Stable` and >> Stable Values: >> >> Patterns: >> 1. Benign race (does not exist in StableValue API): multiple threads can >> create

Re: RFR: 8330465: Stable Values and Collections (Internal)

2024-05-14 Thread Per Minborg
On Wed, 17 Apr 2024 14:07:05 GMT, Chen Liang wrote: > Question: > > 1. Will we ever try to expose the stable benign race model to users? > 2. Will we ever try to inline the stable values in object layout like a > stable field? 1. I think there is little or no upside in exposing the benign

Re: RFR: 8331670: Deprecate the Memory-Access Methods in sun.misc.Unsafe for Removal

2024-05-13 Thread Per Minborg
On Fri, 10 May 2024 10:06:55 GMT, Alan Bateman wrote: > This is the implementation changes for JEP 471. > > The methods in sun.misc.Unsafe for on-heap and off-heap access are deprecated > for removal. This means a removal warning at compile time. No methods have > been removed. A deprecated

Re: RFR: 8331670: Deprecate the Memory-Access Methods in sun.misc.Unsafe for Removal

2024-05-13 Thread Per Minborg
On Fri, 10 May 2024 10:06:55 GMT, Alan Bateman wrote: > This is the implementation changes for JEP 471. > > The methods in sun.misc.Unsafe for on-heap and off-heap access are deprecated > for removal. This means a removal warning at compile time. No methods have > been removed. A deprecated

Re: RFR: 8305457: Implement java.io.IO [v7]

2024-05-10 Thread Per Minborg
On Tue, 7 May 2024 20:23:11 GMT, Pavel Rappo wrote: >>> Should this be final? >> >> With only the private constructor, it doesn't matter too much in practice, >> but an explicit `final` would be good documentation if that is the intent. > > If the sole constructor of a class is private, not

Re: RFR: 8305457: Implement java.io.IO [v7]

2024-05-10 Thread Per Minborg
On Thu, 9 May 2024 18:27:08 GMT, Pavel Rappo wrote: >> Please review this PR which introduces the `java.io.IO` top-level class and >> three methods to `java.io.Console` for [Implicitly Declared Classes and >> Instance Main Methods (Third Preview)]. >> >> This PR has been obtained as `git

Re: RFR: 8332003: Clarify javadoc for MemoryLayout::offsetHandle

2024-05-09 Thread Per Minborg
On Thu, 9 May 2024 15:00:35 GMT, Maurizio Cimadamore wrote: > Consider this layout: > > > MemoryLayout SEQ = MemoryLayout.sequenceLayout(5, > MemoryLayout.sequenceLayout(10, JAVA_INT)); > > > And the corresponding offset handle: > > > MethodHandle offsetHandle =

Re: RFR: 8331734: Atomic MemorySegment VarHandle operations fails for element layouts

2024-05-07 Thread Per Minborg
On Tue, 7 May 2024 15:42:23 GMT, Maurizio Cimadamore wrote: > This PR fixes an issue that has crept into the FFM API implementation. > > From very early stages, the FFM API used to disable the alignment check on > nested layout elements, in favor of an alignment check against the memory >

Re: RFR: 8316493: Remove the caching fields in AbstractMap [v11]

2024-05-06 Thread Per Minborg
On Fri, 10 Nov 2023 08:17:22 GMT, Per Minborg wrote: >> This PR outlines a solution for making immutable maps `@ValueBased` by >> removing cacheing of certain values in `AbstractMap`. >> >> By removing these caching fields in `AbstractMap`, we can make the immutab

Re: RFR: 8331346: Update PreviewFeature of STREAM_GATHERERS to JEP-473

2024-04-30 Thread Per Minborg
On Mon, 29 Apr 2024 16:42:05 GMT, Viktor Klang wrote: > This PR finalizes JEP 473 by modifying the PreviewFeature JEP number and > status for Stream Gatherers. LGTM - Marked as reviewed by pminborg (Reviewer). PR Review:

Re: RFR: 8331264: Reduce java.lang.constant initialization overhead [v3]

2024-04-29 Thread Per Minborg
On Mon, 29 Apr 2024 12:39:17 GMT, Claes Redestad wrote: >> I'm looking at ways at reducing/eliminating startup overheads the classfile >> API in preparation of #17108, and have pushed a series of enhancements to >> that effect already. This PR is a collection of minor improvements which add

Integrated: 8314592: Add shortcut to SymbolLookup::find

2024-04-24 Thread Per Minborg
On Mon, 25 Mar 2024 14:56:23 GMT, Per Minborg wrote: > While `SymbolLookup` correctly uses an `Optional` return to denote whether a > symbol has been found by the lookup or not (which enables composition of > symbol lookups), many clients end up just calling `Optional::get`, or &g

Re: RFR: 8314592: Add shortcut to SymbolLookup::find [v7]

2024-04-24 Thread Per Minborg
On Mon, 22 Apr 2024 13:46:59 GMT, Maurizio Cimadamore wrote: >> Per Minborg 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 pull request cont

Re: RFR: 8314592: Add shortcut to SymbolLookup::find [v8]

2024-04-24 Thread Per Minborg
; This PR proposes to add a convenience method `SymbolLookup::findOrThrow` that > will do a lookup and, if no symbol can be found, throws an > `IllegalArgumentException` with a relevant exception message. Per Minborg has updated the pull request incrementally with one additional commit

Re: RFR: 8327858: Improve spliterator and forEach for single-element immutable collections [v2]

2024-04-23 Thread Per Minborg
On Thu, 21 Mar 2024 18:01:38 GMT, Chen Liang wrote: >> Please review this patch that: >> 1. Implemented `forEach` to optimize for 1 or 2 element collections. >> 2. Implemented `spliterator` to optimize for a single element. >> >> The default implementations for multiple-element immutable

Re: RFR: 8314592: Add shortcut to SymbolLookup::find [v7]

2024-04-22 Thread Per Minborg
; This PR proposes to add a convenience method `SymbolLookup::findOrThrow` that > will do a lookup and, if no symbol can be found, throws an > `IllegalArgumentException` with a relevant exception message. Per Minborg has updated the pull request with a new target base due to a merge or a rebase

Re: RFR: 8329760: Add indexOf(Predicate filter) to java..util.List interface [v2]

2024-04-19 Thread Per Minborg
On Thu, 18 Apr 2024 22:21:11 GMT, Evemose wrote: >> **Subject** >> Addition of Predicate-based `indexOf` and `lastIndexOf` methods to >> `java.util.List` >> >> **Motivation** >> The motivation behind this proposal is to enhance the functionality of the >> `List` interface by providing a more

Re: RFR: 8314592: Add shortcut to SymbolLookup::find [v6]

2024-04-18 Thread Per Minborg
; This PR proposes to add a convenience method `SymbolLookup::findOrThrow` that > will do a lookup and, if no symbol can be found, throws an > `IllegalArgumentException` with a relevant exception message. Per Minborg has updated the pull request incrementally with one additional commit

Integrated: 8329997: Add provisions for checking memory segment alignment constraints

2024-04-18 Thread Per Minborg
On Mon, 15 Apr 2024 07:50:24 GMT, Per Minborg wrote: > This PR proposes to add a new method `MemorySegment::maxByteAlignment` that > returns the maximum byte alignment of a segment (both heap and native > segments). > > Clients can then use this method to determine if a segm

Re: RFR: 8329997: Add provisions for checking memory segment alignment constraints [v6]

2024-04-17 Thread Per Minborg
ut (e.g. following a `MemorySegment::reinterpret` > operation). Per Minborg has updated the pull request incrementally with one additional commit since the last revision: Update docs for maxByteAlignment - Changes: - all: https://git.openjdk.org/jdk/pull/18779/files - new: https:

Re: RFR: 8314592: Add shortcut to SymbolLookup::find [v5]

2024-04-17 Thread Per Minborg
; This PR proposes to add a convenience method `SymbolLookup::findOrThrow` that > will do a lookup and, if no symbol can be found, throws an > `IllegalArgumentException` with a relevant exception message. Per Minborg has updated the pull request incrementally with one additional commit

Integrated: 8330272: Wrong javadoc for ValueLayout.JAVA_LONG/JAVA_DOUBLE on x86 32bit

2024-04-17 Thread Per Minborg
On Tue, 16 Apr 2024 07:09:55 GMT, Per Minborg wrote: > This PR proposes to update the javadocs for `ValueLayout.JAVA_LONG` and > `ValueLayout.JAVA_DOUBLE` to reflect the changes made in > https://bugs.openjdk.org/browse/JDK-8326172 (we forgot to update the docs > when that iss

RFR: 8329532: Add an internal MemoryLayout transformer

2024-04-16 Thread Per Minborg
This PR proposes to add an internal layout transformer that could be used to transform MemoryLayout entities. For example, it would be possible to convert a struct layout to use network order ((big-endian) instead of native byte order (often little-endian). Another application is to remove

Re: RFR: 8329997: Add provisions for checking memory segment alignment constraints [v5]

2024-04-16 Thread Per Minborg
ut (e.g. following a `MemorySegment::reinterpret` > operation). Per Minborg has updated the pull request incrementally with one additional commit since the last revision: Update JavaDoc - Changes: - all: https://git.openjdk.org/jdk/pull/18779/files - new: https://git.openjdk.org

Re: RFR: 8329997: Add provisions for checking memory segment alignment constraints [v4]

2024-04-16 Thread Per Minborg
ut (e.g. following a `MemorySegment::reinterpret` > operation). Per Minborg has updated the pull request incrementally with three additional commits since the last revision: - Update src/java.base/share/classes/java/lang/foreign/MemorySegment.java Co-authored-by: Maurizio Cimadamor

RFR: 8330272: Fix javadocs for ValueLayout.(JAVA_LONG|JAVA_DOUBLE)

2024-04-16 Thread Per Minborg
This PR proposes to update the javadocs for `ValueLayout.JAVA_LONG` and `ValueLayout.JAVA_DOUBLE` to reflect the changes made in https://bugs.openjdk.org/browse/JDK-8326172 (we forgot to update the docs when that issue was fixed) - Commit messages: - Update copyright year - Fix

Re: RFR: 8329997: Add provisions for checking memory segment alignment constraints [v3]

2024-04-15 Thread Per Minborg
ut (e.g. following a `MemorySegment::reinterpret` > operation). Per Minborg 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 pull request contains ten additional commits sin

Re: RFR: 8314592: Add shortcut to SymbolLookup::find [v4]

2024-04-15 Thread Per Minborg
; This PR proposes to add a convenience method `SymbolLookup::findOrThrow` that > will do a lookup and, if no symbol can be found, throws an > `IllegalArgumentException` with a relevant exception message. Per Minborg has updated the pull request incrementally with one additional commit

Re: RFR: 8314592: Add shortcut to SymbolLookup::find [v3]

2024-04-15 Thread Per Minborg
; This PR proposes to add a convenience method `SymbolLookup::findOrThrow` that > will do a lookup and, if no symbol can be found, throws an > `IllegalArgumentException` with a relevant exception message. Per Minborg has updated the pull request incrementally with one additional commit

Re: RFR: 8329997: Add provisions for checking memory segment alignment constraints [v2]

2024-04-15 Thread Per Minborg
On Mon, 15 Apr 2024 10:16:30 GMT, Maurizio Cimadamore wrote: >> Per Minborg has updated the pull request incrementally with three additional >> commits since the last revision: >> >> - Update >> src/java.base/share/classes/jdk/internal/foreign/HeapMemorySe

Re: RFR: 8329997: Add provisions for checking memory segment alignment constraints [v2]

2024-04-15 Thread Per Minborg
On Mon, 15 Apr 2024 10:07:31 GMT, Maurizio Cimadamore wrote: >> Per Minborg has updated the pull request incrementally with three additional >> commits since the last revision: >> >> - Update >> src/java.base/share/classes/jdk/internal/foreign/HeapMemorySe

Re: RFR: 8329997: Add provisions for checking memory segment alignment constraints [v2]

2024-04-15 Thread Per Minborg
On Mon, 15 Apr 2024 10:05:44 GMT, Maurizio Cimadamore wrote: >> Per Minborg has updated the pull request incrementally with three additional >> commits since the last revision: >> >> - Update >> src/java.base/share/classes/jdk/internal/foreign/HeapMemorySe

Re: RFR: 8329997: Add provisions for checking memory segment alignment constraints [v2]

2024-04-15 Thread Per Minborg
ut (e.g. following a `MemorySegment::reinterpret` > operation). Per Minborg has updated the pull request incrementally with three additional commits since the last revision: - Update src/java.base/share/classes/jdk/internal/foreign/HeapMemorySegmentImpl.java Co-authored-by: Jorn Vernee -

Integrated: 8330176: Typo in Linker javadoc

2024-04-15 Thread Per Minborg
On Mon, 15 Apr 2024 08:21:41 GMT, Per Minborg wrote: > This PR fixes a typo in the `Linker` documentation. This pull request has now been integrated. Changeset: 60d88b7a Author: Per Minborg URL: https://git.openjdk.org/jdk/commit/60d88b7ae2945724ab4db44207e3390bcff172c0 Stats:

Re: RFR: 8314592: Add shortcut to SymbolLookup::find [v2]

2024-04-15 Thread Per Minborg
; This PR proposes to add a convenience method `SymbolLookup::findOrThrow` that > will do a lookup and, if no symbol can be found, throws an > `IllegalArgumentException` with a relevant exception message. Per Minborg has updated the pull request incrementally with two additional commits

RFR: 8330176: Typo in Linker javadoc

2024-04-15 Thread Per Minborg
This PR fixes a typo in the `Linker` documentation. - Commit messages: - Fix typo in Linker javadoc Changes: https://git.openjdk.org/jdk/pull/18781/files Webrev: https://webrevs.openjdk.org/?repo=jdk=18781=00 Issue: https://bugs.openjdk.org/browse/JDK-8330176 Stats: 2 lines

RFR: 8329997: Add provisions for checking memory segment alignment constraints

2024-04-15 Thread Per Minborg
This PR proposes to add a new method `MemorySegment::maxByteAlignment` that returns the maximum byte alignment of a segment (both heap and native segments). Clients can then use this method to determine if a segment is properly aligned for any given layout (e.g. following a

RFR: 8314592: Add shortcut to SymbolLookup::find

2024-04-11 Thread Per Minborg
While `SymbolLookup` correctly uses an `Optional` return to denote whether a symbol has been found by the lookup or not (which enables composition of symbol lookups), many clients end up just calling `Optional::get`, or `Optional::orElseThrow()` on the result. This PR proposes to add a

Withdrawn: 8329997: Add MemorySegment::reinterpretate overloads for alignment constraints

2024-04-11 Thread Per Minborg
On Wed, 10 Apr 2024 12:49:11 GMT, Per Minborg wrote: > This PR proposes to add two overloads `MemorySegment::reinterpretate` to > allow aligned reinterpretation. This pull request has been closed without being integrated. - PR: https://git.openjdk.org/jdk/pull/18717

RFR: 8329997: Add MemorySegment::reinterpretate overloads for alignment constraints

2024-04-10 Thread Per Minborg
This PR proposes to add two overloads `MemorySegment::reinterpretate` to allow aligned reinterpretation. - Commit messages: - Update copyright year - Add MemorySegment::reinterpretate overloads for alignment constraints Changes: https://git.openjdk.org/jdk/pull/18717/files

Integrated: JDK-8329089: Empty immutable list throws the wrong exception type for remove(first | last) operations

2024-04-05 Thread Per Minborg
On Tue, 2 Apr 2024 10:37:02 GMT, Per Minborg wrote: > This PR proposes to make empty immutable lists always throw UOE on > `removeFirst` and `removeLast`. This pull request has now been integrated. Changeset: b71acc70 Author: Per Minborg URL: https://git.openjdk.org/jdk/

Re: RFR: JDK-8329089: Empty immutable list throws the wrong exception type for remove(first | last) operations

2024-04-04 Thread Per Minborg
On Wed, 3 Apr 2024 15:09:15 GMT, Roger Riggs wrote: >> This PR proposes to make empty immutable lists always throw UOE on >> `removeFirst` and `removeLast`. > > test/jdk/java/util/Collection/MOAT.java line 573: > >> 571: c::removeLast); >> 572: } >> 573: > > Would this

RFR: JDK-8329089: Empty immutable list throws the wrong exception type for remove(first | last) operations

2024-04-02 Thread Per Minborg
This PR proposes to make empty immutable lists always throw UOE on `removeFirst` and `removeLast`. - Commit messages: - Make empty immutable lists always throw UOE on remove(F|L) Changes: https://git.openjdk.org/jdk/pull/18581/files Webrev:

Re: RFR: 8323552: AbstractMemorySegmentImpl#mismatch returns -1 when comparing distinct areas of the same instance of MemorySegment [v3]

2024-03-25 Thread Per Minborg
On Thu, 11 Jan 2024 16:21:38 GMT, Peter Levart wrote: >> I belive there is a bug in `AbstractMemorySegmentImpl#mismatch` method. It >> returns `-1` (meaning that regions are equal) when passing the same instance >> of MemorySegment as both `srcSegment` and `dstSegment` parameters regardless

  1   2   3   4   5   6   7   >