Integrated: 8333886: Explicitly specify that asSlice and reinterpret return a memory segment backed by the same region of memory.

2024-06-12 Thread Per Minborg
On Mon, 10 Jun 2024 15:45:07 GMT, Per Minborg wrote: > This PR proposes to explicitly state that returned segments form the > `asSlice` and `reinterpret` method share memory regions with `this` memory > segment. > > Note: The term "subset" means a true subset or

Re: RFR: 8333886: Explicitly specify that asSlice and reinterpret return a memory segment backed by the same region of memory. [v2]

2024-06-11 Thread Per Minborg
> This PR proposes to explicitly state that returned segments form the > `asSlice` and `reinterpret` method share memory regions with `this` memory > segment. > > Note: The term "subset" means a true subset or the same set. Per Minborg has updated the pull reque

Re: RFR: 8333886: Explicitly specify that asSlice and reinterpret return a memory segment backed by the same region of memory.

2024-06-11 Thread Per Minborg
On Mon, 10 Jun 2024 15:45:07 GMT, Per Minborg wrote: > This PR proposes to explicitly state that returned segments form the > `asSlice` and `reinterpret` method share memory regions with `this` memory > segment. > > Note: The term "subset" means a true subset

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

2024-06-10 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

RFR: 8333886: Explicitly specify that asSlice and reinterpret return a memory segment backed by the same region of memory.

2024-06-10 Thread Per Minborg
This PR proposes to explicitly state that returned segments form the `asSlice` and `reinterpret` method share memory regions with `this` memory segment. Note: The term "subset" means a true subset or the same set. - Commit messages: - Add segments share the same backing store in

Re: RFR: 8333884: MemorySegment::reinterpret removes read-only property [v3]

2024-06-10 Thread Per Minborg
> This PR proposes to retain the read-only state when any of the > `MemorySegment::reinterpret` methods is called. > > Previously, the read-only state was lost and the returned `MemorySegment` was > always writable regardless of the original segment's read-only state. Per Minb

Re: RFR: 8333884: MemorySegment::reinterpret removes read-only property [v2]

2024-06-10 Thread Per Minborg
On Mon, 10 Jun 2024 13:45:16 GMT, Maurizio Cimadamore wrote: > Note that `asSlice` methods also lacks a similar guarantee on read-only (but > the impl works fine there) Even though not mentioned in the original issue, we could add documentation for this here as well. Or maybe via

Re: RFR: 8333884: MemorySegment::reinterpret removes read-only property [v2]

2024-06-10 Thread Per Minborg
> This PR proposes to retain the read-only state when any of the > `MemorySegment::reinterpret` methods is called. > > Previously, the read-only state was lost and the returned `MemorySegment` was > always writable regardless of the original segment's read-only state. Per Minb

RFR: 8333884: MemorySegment::reinterpret removes read-only property

2024-06-10 Thread Per Minborg
This PR proposes to retain the read-only state when any of the `MemorySegment::reinterpret` methods is called. Previously, the read-only state was lost and the returned `MemorySegment` was always writable regardless of the original segment's read-only state. - Commit messages: -

Withdrawn: 8330465: Stable Values and Collections (Internal)

2024-06-10 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 >

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

2024-06-10 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: 8310843: Reimplement ByteArray and ByteArrayLittleEndian with Unsafe [v2]

2024-06-10 Thread Per Minborg
On Mon, 10 Jun 2024 03:51:40 GMT, Glavo wrote: >> Things have changed since https://github.com/openjdk/jdk/pull/14636 was >> closed, so let me reopen it. >> >> https://github.com/openjdk/jdk/pull/15386 confirmed that `VarHandle` in BALE >> caused a startup regression. In order to not have any

Re: RFR: 8333774: Avoid eagerly loading various EmptySpliterator classes [v3]

2024-06-07 Thread Per Minborg
On Fri, 7 Jun 2024 13:08:24 GMT, Claes Redestad wrote: >> Trivially move a few private static finals to their respective source type >> to avoid eagerly loading a few small classes. > > Claes Redestad has updated the pull request incrementally with one additional > commit since the last

Re: RFR: 8332249: Micro-optimize Method.hashCode [v2]

2024-06-05 Thread Per Minborg
On Wed, 5 Jun 2024 13:41:10 GMT, Per Minborg wrote: >> In order to be eligible for constant folding, the benchmark must declare the >> `Method hashCodeMethod;` as `static final`. >> >> It is hard for me to understand why a `@Stable` annotation should have a >>

Re: RFR: 8332249: Micro-optimize Method.hashCode [v2]

2024-06-05 Thread Per Minborg
On Wed, 5 Jun 2024 13:37:15 GMT, Per Minborg wrote: >> Interesting, don't know about hotspot internals so I can't diagnose the >> exact cause of this regression. > > In order to be eligible for constant folding, the benchmark must declare the > `Method hashCodeMeth

Re: RFR: 8332249: Micro-optimize Method.hashCode [v2]

2024-06-05 Thread Per Minborg
On Wed, 29 May 2024 15:20:15 GMT, Chen Liang wrote: >> This was something that I tried and I observed a performance regression on >> the ARM platform that I was testing. From my understanding, `@Stable` tells >> the compiler to trust the contents of this field which is only given when >> the

Re: RFR: 8333236: Test java/foreign/TestAccessModes.java is timing out after passing [v2]

2024-05-31 Thread Per Minborg
On Fri, 31 May 2024 16:18:33 GMT, Maurizio Cimadamore wrote: >> This PR restores a var handle cache in `Utils::makeSegmentViewVarHandle`. >> The cache was moved to `ValueLayouts::varHandle` as part of >> [pull/19251](https://git.openjdk.org/jdk/pull/19251), on the basis that we >> want to

Re: RFR: 8292955: Collections.checkedMap Map.merge does not properly check key and value [v3]

2024-05-28 Thread Per Minborg
On Thu, 7 Mar 2024 05:33:16 GMT, Lei Zhu wrote: >> When the specified key did not associated with a value, should check the >> `key` and `value` type. > > Lei Zhu has updated the pull request incrementally with one additional commit > since the last revision: > > Use testNG builtin

Re: RFR: 8292955: Collections.checkedMap Map.merge does not properly check key and value [v3]

2024-05-28 Thread Per Minborg
On Mon, 27 May 2024 12:40:07 GMT, Chen Liang wrote: > @minborg Is it possible for you to review this collection bugfix? Will do! Thanks for the heads up. - PR Comment: https://git.openjdk.org/jdk/pull/18141#issuecomment-2134446236

Re: RFR: 8328821: Map.of().entrySet() mutators should throw UnsupportedOperationException

2024-05-27 Thread Per Minborg
On Wed, 27 Mar 2024 17:36:28 GMT, Liam Miller-Cushon wrote: > This change overrides mutator methods in the implementation returned by > `Map.of().entrySet()` to throw `UnsupportedOperationException`. src/java.base/share/classes/java/util/ImmutableCollections.java line 1323: > 1321:

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

  1   2   3   4   5   6   7   >