Re: RFR: 8325448: Hybrid Public Key Encryption [v11]

2025-03-13 Thread Weijun Wang
> Implement HPKE as defined in https://datatracker.ietf.org/doc/rfc9180/. > ![HPKEParameterSpec](https://github.com/user-attachments/assets/8cc7101b-92d1-43be-b7b4-24a7ba449231) Weijun Wang has updated the pull request incrementally with one additional commit since the last revision: getParame

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v4]

2025-03-13 Thread Per Minborg
> Implement JEP 502. > > The PR passes tier1-tier3 tests. Per Minborg has updated the pull request incrementally with one additional commit since the last revision: Rename field - Changes: - all: https://git.openjdk.org/jdk/pull/23972/files - new: https://git.openjdk.org/jdk

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview)

2025-03-13 Thread Per Minborg
On Tue, 11 Mar 2025 07:50:38 GMT, Quan Anh Mai wrote: >> Implement JEP 502. >> >> The PR passes tier1-tier3 tests. > > src/java.base/share/classes/java/util/ImmutableCollections.java line 777: > >> 775: private final IntFunction mapper; >> 776: @Stable >> 777: private fi

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview)

2025-03-13 Thread Johannes Graham
On Mon, 10 Mar 2025 18:11:23 GMT, Per Minborg wrote: > Implement JEP 502. > > The PR passes tier1-tier3 tests. src/java.base/share/classes/java/util/ImmutableCollections.java line 772: > 770: > 771: @jdk.internal.ValueBased > 772: static final class StableList extends AbstractImmutabl

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v2]

2025-03-13 Thread Per Minborg
> Implement JEP 502. > > The PR passes tier1-tier3 tests. Per Minborg has updated the pull request incrementally with one additional commit since the last revision: Rework reenterant logic - Changes: - all: https://git.openjdk.org/jdk/pull/23972/files - new: https://git.open

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v6]

2025-03-13 Thread Per Minborg
> Implement JEP 502. > > The PR passes tier1-tier3 tests. Per Minborg has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 246 commits: - Merge branch 'master' into implement-jep502 - Clean up exception messages and fix comments - Rena

Integrated: 8351349: GSSUtil.createSubject has outdated access control context and policy related text

2025-03-13 Thread Sean Mullan
On Mon, 10 Mar 2025 17:15:00 GMT, Sean Mullan wrote: > Please review this change to remove outdated access control context and > policy related text from the `com.sun.security.jgss.GSSUtil` class which no > longer applies now that JEP 486 disabled the Security Manager. > > I also made a few o

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview)

2025-03-13 Thread Chen Liang
On Tue, 11 Mar 2025 18:08:47 GMT, Johannes Graham wrote: >> This allows reuse of `AbstractImmutableList` with list iterators, sub lists >> and more. > > Using the regular AbstractList as a base would also get you implementations > of those. `AbstractList` has non-final fields, which makes it n

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview)

2025-03-13 Thread Luca Kellermann
On Thu, 13 Mar 2025 09:45:22 GMT, Per Minborg wrote: >> src/java.base/share/classes/jdk/internal/lang/stable/StableValueImpl.java >> line 128: >> >>> 126: final T newValue = supplier.get(); >>> 127: // The mutex is reentrant so we need to check if the value >>> was actu

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v6]

2025-03-13 Thread Maurizio Cimadamore
On Thu, 13 Mar 2025 15:22:43 GMT, Per Minborg wrote: >> Implement JEP 502. >> >> The PR passes tier1-tier3 tests. > > Per Minborg has updated the pull request with a new target base due to a > merge or a rebase. The pull request now contains 246 commits: > > - Merge branch 'master' into imple

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v6]

2025-03-13 Thread Maurizio Cimadamore
On Thu, 13 Mar 2025 15:22:43 GMT, Per Minborg wrote: >> Implement JEP 502. >> >> The PR passes tier1-tier3 tests. > > Per Minborg has updated the pull request with a new target base due to a > merge or a rebase. The pull request now contains 246 commits: > > - Merge branch 'master' into imple

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v6]

2025-03-13 Thread Maurizio Cimadamore
On Thu, 13 Mar 2025 15:22:43 GMT, Per Minborg wrote: >> Implement JEP 502. >> >> The PR passes tier1-tier3 tests. > > Per Minborg has updated the pull request with a new target base due to a > merge or a rebase. The pull request now contains 246 commits: > > - Merge branch 'master' into imple

Re: RFR: 8325448: Hybrid Public Key Encryption [v3]

2025-03-13 Thread Weijun Wang
On Fri, 28 Feb 2025 19:32:52 GMT, Weijun Wang wrote: >> src/java.base/share/classes/com/sun/crypto/provider/HPKE.java line 101: >> >>> 99: @Override >>> 100: protected AlgorithmParameters engineGetParameters() { >>> 101: return null; >> >> In traditional JCE, wouldn't we return

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview)

2025-03-13 Thread Quan Anh Mai
On Wed, 12 Mar 2025 08:09:04 GMT, Per Minborg wrote: >> If you have an `@Stable Object[]`, then the elements are also considered >> `@Stable`. Then you can do something like: >> >> ReentrantLock[] locks; >> >> T get(int idx) { >> Object x = backing[idx]; >> if (x == nul

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v6]

2025-03-13 Thread Maurizio Cimadamore
On Thu, 13 Mar 2025 15:22:43 GMT, Per Minborg wrote: >> Implement JEP 502. >> >> The PR passes tier1-tier3 tests. > > Per Minborg has updated the pull request with a new target base due to a > merge or a rebase. The pull request now contains 246 commits: > > - Merge branch 'master' into imple

Re: RFR: 8341775: Duplicate manifest files are removed by jarsigner after signing [v9]

2025-03-13 Thread Kevin Driver
> JDK-8341775: In the case where there is a *single* META-INF directory but > potentially *multiple* manifest files of different cases, print a warning > before selecting the first one and ignoring the rest (the current behavior > should be maintained). Kevin Driver has updated the pull request

Re: RFR: 8325448: Hybrid Public Key Encryption [v10]

2025-03-13 Thread Weijun Wang
On Thu, 13 Mar 2025 18:47:58 GMT, Sean Mullan wrote: >> Weijun Wang has updated the pull request incrementally with one additional >> commit since the last revision: >> >> switch to Asserts.assertThrows in test; use traditional javadoc style > > src/java.base/share/classes/javax/crypto/spec/H

Re: RFR: 8325448: Hybrid Public Key Encryption [v10]

2025-03-13 Thread Sean Mullan
On Thu, 13 Mar 2025 20:04:13 GMT, Weijun Wang wrote: >> src/java.base/share/classes/javax/crypto/spec/HPKEParameterSpec.java line >> 195: >> >>> 193: * >> href="https://www.rfc-editor.org/rfc/rfc9180.html#name-key-encapsulation-mechanism";>Section >>> 7.1 of RFC 9180. >>> 194: */ >>>

Re: RFR: 8325448: Hybrid Public Key Encryption [v10]

2025-03-13 Thread Weijun Wang
On Thu, 13 Mar 2025 19:52:10 GMT, Sean Mullan wrote: >> Weijun Wang has updated the pull request incrementally with one additional >> commit since the last revision: >> >> switch to Asserts.assertThrows in test; use traditional javadoc style > > src/java.base/share/conf/security/java.security

Re: RFR: 8325448: Hybrid Public Key Encryption [v11]

2025-03-13 Thread Weijun Wang
On Thu, 13 Mar 2025 19:55:40 GMT, Weijun Wang wrote: >> Implement HPKE as defined in https://datatracker.ietf.org/doc/rfc9180/. >> ![HPKEParameterSpec](https://github.com/user-attachments/assets/8cc7101b-92d1-43be-b7b4-24a7ba449231) > > Weijun Wang has updated the pull request incrementally with

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v5]

2025-03-13 Thread Per Minborg
> Implement JEP 502. > > The PR passes tier1-tier3 tests. Per Minborg has updated the pull request incrementally with one additional commit since the last revision: Clean up exception messages and fix comments - Changes: - all: https://git.openjdk.org/jdk/pull/23972/files -

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v3]

2025-03-13 Thread Per Minborg
> Implement JEP 502. > > The PR passes tier1-tier3 tests. Per Minborg has updated the pull request incrementally with one additional commit since the last revision: Rename method and fix comment - Changes: - all: https://git.openjdk.org/jdk/pull/23972/files - new: https://gi

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v6]

2025-03-13 Thread Maurizio Cimadamore
On Thu, 13 Mar 2025 15:52:37 GMT, Maurizio Cimadamore wrote: >> Per Minborg has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 246 commits: >> >> - Merge branch 'master' into implement-jep502 >> - Clean up exception messages and f

Re: RFR: 8342682: Errors related to unused code on Windows after 8339120 in dt_shmem jdwp security and jpackage [v7]

2025-03-13 Thread Weijun Wang
On Mon, 11 Nov 2024 09:51:35 GMT, Julian Waters wrote: >> After 8339120, gcc began catching many different instances of unused code in >> the Windows specific codebase. Some of these seem to be bugs. I've taken the >> effort to mark out all the relevant globals and locals that trigger the >> u

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v6]

2025-03-13 Thread Maurizio Cimadamore
On Thu, 13 Mar 2025 15:48:25 GMT, Maurizio Cimadamore wrote: >> Per Minborg has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 246 commits: >> >> - Merge branch 'master' into implement-jep502 >> - Clean up exception messages and f

Re: RFR: 8325448: Hybrid Public Key Encryption [v10]

2025-03-13 Thread Sean Mullan
On Wed, 12 Mar 2025 12:18:22 GMT, Weijun Wang wrote: >> Implement HPKE as defined in https://datatracker.ietf.org/doc/rfc9180/. >> ![HPKEParameterSpec](https://github.com/user-attachments/assets/4a7e6609-fd64-444a-978f-bde1634caa70) > > Weijun Wang has updated the pull request incrementally with

Re: RFR: 8341775: Duplicate manifest files are removed by jarsigner after signing [v12]

2025-03-13 Thread Kevin Driver
> JDK-8341775: In the case where there is a *single* META-INF directory but > potentially *multiple* manifest files of different cases, print a warning > before selecting the first one and ignoring the rest (the current behavior > should be maintained). Kevin Driver has updated the pull request

Re: RFR: 8325448: Hybrid Public Key Encryption [v10]

2025-03-13 Thread Sean Mullan
On Thu, 13 Mar 2025 19:45:33 GMT, Weijun Wang wrote: >> src/java.base/share/classes/javax/crypto/spec/HPKEParameterSpec.java line 67: >> >>> 65: * https://www.iana.org/assignments/hpke/hpke.xhtml";>IANA HPKE >>> page. >>> 66: * >>> 67: * Once an {@code HPKEParameterSpec} object is created,

Re: SSLContext instances

2025-03-13 Thread Sean Mullan
Hello, Thanks for your interest in Java Security technology. There is also a method SSLContext.setDefault(SSLContext) [3], whose jdk 17 implementation has a permission check (setDefaultSSLContext) to prevent access to calling setDefault. With security manager deprecation/removal,  could this

Re: RFR: 8325448: Hybrid Public Key Encryption [v10]

2025-03-13 Thread Weijun Wang
On Thu, 13 Mar 2025 18:37:49 GMT, Sean Mullan wrote: >> Weijun Wang has updated the pull request incrementally with one additional >> commit since the last revision: >> >> switch to Asserts.assertThrows in test; use traditional javadoc style > > src/java.base/share/classes/javax/crypto/spec/H

Re: RFR: 8341775: Duplicate manifest files are removed by jarsigner after signing [v13]

2025-03-13 Thread Hai-May Chao
On Thu, 13 Mar 2025 18:55:38 GMT, Kevin Driver wrote: >> JDK-8341775: In the case where there is a *single* META-INF directory but >> potentially *multiple* manifest files of different cases, print a warning >> before selecting the first one and ignoring the rest (the current behavior >> shoul

Re: RFR: 8349583: Add mechanism to disable signature schemes based on their TLS scope [v18]

2025-03-13 Thread Anthony Scarpino
On Wed, 12 Mar 2025 17:26:30 GMT, Artur Barashev wrote: >> Currently when a signature scheme constraint is specified with >> "jdk.tls.disabledAlgorithms" property we don't differentiate between >> signatures used to sign a TLS handshake exchange and the signatures used in >> TLS certificates:

Re: SSLContext instances

2025-03-13 Thread Scott Lewis
Hi Sean, On 3/13/2025 12:03 PM, Sean Mullan wrote: Hello, Thanks for your interest in Java Security technology. There is also a method SSLContext.setDefault(SSLContext) [3], whose jdk 17 implementation has a permission check (setDefaultSSLContext) to prevent access to calling setDefault. W

Re: RFR: 8341775: Duplicate manifest files are removed by jarsigner after signing [v10]

2025-03-13 Thread Kevin Driver
> JDK-8341775: In the case where there is a *single* META-INF directory but > potentially *multiple* manifest files of different cases, print a warning > before selecting the first one and ignoring the rest (the current behavior > should be maintained). Kevin Driver has updated the pull request

Re: RFR: 8341775: Duplicate manifest files are removed by jarsigner after signing [v8]

2025-03-13 Thread Kevin Driver
On Tue, 11 Mar 2025 21:50:56 GMT, Weijun Wang wrote: >> Kevin Driver has updated the pull request incrementally with one additional >> commit since the last revision: >> >> review comments > > src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Main.java line > 1993: > >> 1991:

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview)

2025-03-13 Thread Per Minborg
On Tue, 11 Mar 2025 19:04:39 GMT, Chen Liang wrote: >> src/java.base/share/classes/java/lang/StableValue.java line 344: >> >>> 342: * {@linkplain java.lang.ref##reachability reachable} stable values >>> will hold their set >>> 343: * content perpetually. >>> 344: * >> >> Should the origina

Re: RFR: 8341775: Duplicate manifest files are removed by jarsigner after signing [v8]

2025-03-13 Thread Kevin Driver
On Tue, 11 Mar 2025 21:52:25 GMT, Weijun Wang wrote: >> Kevin Driver has updated the pull request incrementally with one additional >> commit since the last revision: >> >> review comments > > src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Resources.java > line 160: > >> 158:

Re: RFR: 8341775: Duplicate manifest files are removed by jarsigner after signing [v11]

2025-03-13 Thread Kevin Driver
> JDK-8341775: In the case where there is a *single* META-INF directory but > potentially *multiple* manifest files of different cases, print a warning > before selecting the first one and ignoring the rest (the current behavior > should be maintained). Kevin Driver has updated the pull request

Re: RFR: 8341775: Duplicate manifest files are removed by jarsigner after signing [v11]

2025-03-13 Thread Hai-May Chao
On Thu, 13 Mar 2025 17:15:33 GMT, Kevin Driver wrote: >> JDK-8341775: In the case where there is a *single* META-INF directory but >> potentially *multiple* manifest files of different cases, print a warning >> before selecting the first one and ignoring the rest (the current behavior >> shoul

Re: RFR: 8325448: Hybrid Public Key Encryption [v10]

2025-03-13 Thread Sean Mullan
On Wed, 12 Mar 2025 12:18:22 GMT, Weijun Wang wrote: >> Implement HPKE as defined in https://datatracker.ietf.org/doc/rfc9180/. >> ![HPKEParameterSpec](https://github.com/user-attachments/assets/4a7e6609-fd64-444a-978f-bde1634caa70) > > Weijun Wang has updated the pull request incrementally with

Re: RFR: 8341775: Duplicate manifest files are removed by jarsigner after signing [v13]

2025-03-13 Thread Kevin Driver
> JDK-8341775: In the case where there is a *single* META-INF directory but > potentially *multiple* manifest files of different cases, print a warning > before selecting the first one and ignoring the rest (the current behavior > should be maintained). Kevin Driver has updated the pull request

Re: RFR: 8325448: Hybrid Public Key Encryption [v10]

2025-03-13 Thread Sean Mullan
On Wed, 12 Mar 2025 12:18:22 GMT, Weijun Wang wrote: >> Implement HPKE as defined in https://datatracker.ietf.org/doc/rfc9180/. >> ![HPKEParameterSpec](https://github.com/user-attachments/assets/8cc7101b-92d1-43be-b7b4-24a7ba449231) > > Weijun Wang has updated the pull request incrementally with

Re: RFR: 8339280: jarsigner -verify performs cross-checking between CEN and LOC [v4]

2025-03-13 Thread Hai-May Chao
> The jarsigner -verify command currently performs verification by reading from > JarFile to navigate the central directory (CEN) headers. It is now enhanced > to include cross-validation of entries between JarFile (CEN-based) and > JarInputStream (stream-based) representations of the JAR. It em

Re: RFR: 8350964: Add an ArtifactResolver.fetch(clazz) method [v5]

2025-03-13 Thread Weijun Wang
On Thu, 13 Mar 2025 11:25:34 GMT, Matthew Donovan wrote: >> In this PR, I created a new method, `ArtifactResolver.fetchOne()`, to >> consolidate duplicate code across tests. > > Matthew Donovan has updated the pull request incrementally with one > additional commit since the last revision: > >

Re: RFR: 8341775: Duplicate manifest files are removed by jarsigner after signing [v13]

2025-03-13 Thread Weijun Wang
On Thu, 13 Mar 2025 21:18:31 GMT, Hai-May Chao wrote: >> Kevin Driver has updated the pull request incrementally with one additional >> commit since the last revision: >> >> test case modifications > > src/jdk.jartool/share/classes/sun/security/tools/jarsigner/resources/jarsigner.properties >

Re: RFR: 8349583: Add mechanism to disable signature schemes based on their TLS scope [v18]

2025-03-13 Thread Anthony Scarpino
On Wed, 12 Mar 2025 17:26:30 GMT, Artur Barashev wrote: >> Currently when a signature scheme constraint is specified with >> "jdk.tls.disabledAlgorithms" property we don't differentiate between >> signatures used to sign a TLS handshake exchange and the signatures used in >> TLS certificates:

Re: RFR: 8325448: Hybrid Public Key Encryption [v10]

2025-03-13 Thread Weijun Wang
On Thu, 13 Mar 2025 19:58:27 GMT, Sean Mullan wrote: >> `info` and `encapsulation` are frequently called. I don't think it's worth >> using a builder. The final `build()` call is always the same and unnecessary. > > If they are common, would it make more sense to include them as parameters to >

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview)

2025-03-13 Thread Chen Liang
On Mon, 10 Mar 2025 18:11:23 GMT, Per Minborg wrote: > Implement JEP 502. > > The PR passes tier1-tier3 tests. FYI we don't usually drop the benchmark scores in the PR description; we usually leave them in comments to indicate which revision the bench results apply to. src/hotspot/share/ci/c

RFR: 8351565: Implement JEP 502: Stable Values (Preview)

2025-03-13 Thread Per Minborg
Implement JEP 502. The PR passes tier1-tier3 tests. - Commit messages: - Use acquire semantics for reading rather than volatile semantics - Add missing null check - Simplify handling of sentinel, wrap, and unwrap - Fix JavaDoc issues - Fix members in StableEnumFunction - Addres

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview)

2025-03-13 Thread Johannes Graham
On Tue, 11 Mar 2025 07:48:40 GMT, Per Minborg wrote: >> src/java.base/share/classes/java/util/ImmutableCollections.java line 772: >> >>> 770: >>> 771: @jdk.internal.ValueBased >>> 772: static final class StableList extends AbstractImmutableList { >> >> Is there significant reuse gained

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview)

2025-03-13 Thread Per Minborg
On Tue, 11 Mar 2025 01:20:16 GMT, Johannes Graham wrote: >> Implement JEP 502. >> >> The PR passes tier1-tier3 tests. > > src/java.base/share/classes/java/util/ImmutableCollections.java line 772: > >> 770: >> 771: @jdk.internal.ValueBased >> 772: static final class StableList extends A

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview)

2025-03-13 Thread Luca Kellermann
On Mon, 10 Mar 2025 18:11:23 GMT, Per Minborg wrote: > Implement JEP 502. > > The PR passes tier1-tier3 tests. src/java.base/share/classes/java/lang/StableValue.java line 79: > 77: *logger.trySet(Logger.create(Component.class)); > 78: *} > 79: * return logger.orT

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview)

2025-03-13 Thread Per Minborg
On Mon, 10 Mar 2025 18:11:23 GMT, Per Minborg wrote: > Implement JEP 502. > > The PR passes tier1-tier3 tests. Here are the current benchmarks for Mac M1: Benchmark Mode Cnt Score Error Units StableFunctionBenchmark.function avgt 10 4.0

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview)

2025-03-13 Thread Quan Anh Mai
On Mon, 10 Mar 2025 18:11:23 GMT, Per Minborg wrote: > Implement JEP 502. > > The PR passes tier1-tier3 tests. src/java.base/share/classes/java/util/ImmutableCollections.java line 777: > 775: private final IntFunction mapper; > 776: @Stable > 777: private final StableVa

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview)

2025-03-13 Thread Per Minborg
On Wed, 12 Mar 2025 13:28:12 GMT, Maurizio Cimadamore wrote: >> What would be the difference between `@Stable StableValueImpl[] backing` >> and `@Stable Object[] backing`? > > It's true that the storage can be flatter here -- that said, this can also be > done as a later refactoring. One advan

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview)

2025-03-13 Thread Per Minborg
On Tue, 11 Mar 2025 16:15:10 GMT, Quan Anh Mai wrote: >> Can you please elaborate a bit more on your proposal @merykitty? > > If you have an `@Stable Object[]`, then the elements are also considered > `@Stable`. Then you can do something like: > > ReentrantLock[] locks; > > T get(int i

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview)

2025-03-13 Thread Johannes Graham
On Mon, 10 Mar 2025 23:42:06 GMT, Chen Liang wrote: >> src/java.base/share/classes/jdk/internal/lang/stable/StableEnumFunction.java >> line 112: >> >>> 110: final Class enumType = >>> (Class)inputs.iterator().next().getClass(); >>> 111: return (Function) new StableEnumFunction(

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview)

2025-03-13 Thread Per Minborg
On Tue, 11 Mar 2025 00:40:31 GMT, Johannes Graham wrote: >> Indeed, a bit set predicate can be used to check input validity if it is >> necessary - I think for enums, using a `StableFunction.ofEnum` dedicated API >> might be better just because `StableValue` can access >> `Class.getEnumConstan

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview)

2025-03-13 Thread Maurizio Cimadamore
On Wed, 12 Mar 2025 08:09:04 GMT, Per Minborg wrote: >> If you have an `@Stable Object[]`, then the elements are also considered >> `@Stable`. Then you can do something like: >> >> ReentrantLock[] locks; >> >> T get(int idx) { >> Object x = backing[idx]; >> if (x == nul

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview)

2025-03-13 Thread Per Minborg
On Wed, 12 Mar 2025 14:14:59 GMT, Per Minborg wrote: >> You can probably use `acquire` only for the first `get` as it is in the fast >> path. For other I guess `volatile` is fine. > > Yeah. Maybe that could strike a balance. On an M1 Mac: Volatile: StableValueBenchmark.stableavgt 1

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview)

2025-03-13 Thread Alan Bateman
On Mon, 10 Mar 2025 18:11:23 GMT, Per Minborg wrote: > Implement JEP 502. > > The PR passes tier1-tier3 tests. src/jdk.unsupported/share/classes/sun/misc/Unsafe.java line 983: > 981: > 982: @ForceInline > 983: private static void assertNotTrusted(Field f) { I don't think this can be

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview)

2025-03-13 Thread Per Minborg
On Tue, 11 Mar 2025 08:44:51 GMT, Per Minborg wrote: >> What if instead you had a `@Stable` array of Object of the appropriate size, >> and populated each cell with a StableValue if the corresponding index was in >> the set, otherwise used a sentinel value. Then on the lookup, if it was the >>

Re: RFR: 8350964: Add an ArtifactResolver.fetch(clazz) method [v5]

2025-03-13 Thread Matthew Donovan
> In this PR, I created a new method, `ArtifactResolver.fetchOne()`, to > consolidate duplicate code across tests. Matthew Donovan has updated the pull request incrementally with one additional commit since the last revision: fixed imports and copyright year - Changes: - all:

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview)

2025-03-13 Thread Luca Kellermann
On Wed, 12 Mar 2025 08:16:50 GMT, Per Minborg wrote: >> The nulling out is only safe if the write to the value is visible when a >> nulled-out function is visible. I think SV can ensure this, but an >> implementation can easily go wrong trying to do this. (Also `orElseSet` does >> not NPE if t

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview)

2025-03-13 Thread Per Minborg
On Wed, 12 Mar 2025 14:38:28 GMT, Luca Kellermann wrote: >> This is something we experimented with a bit in the past. It isn't easy to >> do in the general case. There are pros (the function and its resources that >> can be collected) and cons (e.g., mutability, visibility, complexity, etc.) >

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview)

2025-03-13 Thread Quan Anh Mai
On Tue, 11 Mar 2025 11:19:13 GMT, Per Minborg wrote: >> src/java.base/share/classes/java/util/ImmutableCollections.java line 777: >> >>> 775: private final IntFunction mapper; >>> 776: @Stable >>> 777: private final StableValueImpl[] backing; >> >> You can use a backing