Re: RFR: 8360884: Better scoped values [v5]

2025-07-03 Thread Alan Bateman
On Thu, 3 Jul 2025 13:34:23 GMT, Andrew Haley wrote: >> Scoped values cannot be used early in the JDK boot process because of some >> dependencies on System.getProperty(). This dependency should be removed in a >> way that allows scoped values to be created (but not necessarily bound) at >> an

Re: RFR: 8360884: Better scoped values [v5]

2025-07-03 Thread Chen Liang
On Thu, 3 Jul 2025 13:34:23 GMT, Andrew Haley wrote: >> Scoped values cannot be used early in the JDK boot process because of some >> dependencies on System.getProperty(). This dependency should be removed in a >> way that allows scoped values to be created (but not necessarily bound) at >> an

Re: RFR: 8360884: Better scoped values [v5]

2025-07-03 Thread Andrew Haley
> Scoped values cannot be used early in the JDK boot process because of some > dependencies on System.getProperty(). This dependency should be removed in a > way that allows scoped values to be created (but not necessarily bound) at > any stage during boot. > > Also, Scoped Value's constructor

Re: RFR: 8360884: Better scoped values [v4]

2025-07-01 Thread ExE Boss
On Tue, 1 Jul 2025 15:41:45 GMT, Alan Bateman wrote: >> Andrew Haley has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - 8360884: Better scoped values >> - 8360884: Better scoped values > > src/java.base/share/classes/java/lang/ScopedValu

Re: RFR: 8360884: Better scoped values [v4]

2025-07-01 Thread Alan Bateman
On Tue, 1 Jul 2025 11:15:54 GMT, Andrew Haley wrote: >> Scoped values cannot be used early in the JDK boot process because of some >> dependencies on System.getProperty(). This dependency should be removed in a >> way that allows scoped values to be created (but not necessarily bound) at >> an

Re: RFR: 8360884: Better scoped values [v4]

2025-07-01 Thread Andrew Haley
> Scoped values cannot be used early in the JDK boot process because of some > dependencies on System.getProperty(). This dependency should be removed in a > way that allows scoped values to be created (but not necessarily bound) at > any stage during boot. > > Also, Scoped Value's constructor

Re: RFR: 8360884: Better scoped values [v3]

2025-07-01 Thread ExE Boss
On Tue, 1 Jul 2025 08:21:10 GMT, Andrew Haley wrote: >> src/java.base/share/classes/java/lang/ScopedValue.java line 802: >> >>> 800: return x; >>> 801: } >>> 802: }; >> >> There's something a bit uncomfortable about initializing hashGe

Re: RFR: 8360884: Better scoped values [v3]

2025-07-01 Thread Andrew Haley
On Mon, 30 Jun 2025 15:55:03 GMT, Alan Bateman wrote: > There's something a bit uncomfortable about initializing hashGenerator in > ScopedValue's class initializer, then changing it in Constants class > initializer. Iimmediately clear what the memory model issues. It doesn't of > course matter

Re: RFR: 8360884: Better scoped values [v3]

2025-06-30 Thread Alan Bateman
On Mon, 30 Jun 2025 13:09:57 GMT, Andrew Haley wrote: >> Scoped values cannot be used early in the JDK boot process because of some >> dependencies on System.getProperty(). This dependency should be removed in a >> way that allows scoped values to be created (but not necessarily bound) at >> a

Re: RFR: 8360884: Better scoped values [v3]

2025-06-30 Thread Andrew Haley
On Fri, 27 Jun 2025 15:44:16 GMT, Chen Liang wrote: >> Andrew Haley has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Move THREAD_LOCAL_RANDOM_ACCESS into class Cache.Constants > > src/java.base/share/classes/java/lang/ScopedValue.java lin

Re: RFR: 8360884: Better scoped values [v3]

2025-06-30 Thread Chen Liang
On Mon, 30 Jun 2025 13:09:57 GMT, Andrew Haley wrote: >> Scoped values cannot be used early in the JDK boot process because of some >> dependencies on System.getProperty(). This dependency should be removed in a >> way that allows scoped values to be created (but not necessarily bound) at >> a

Re: RFR: 8360884: Better scoped values [v3]

2025-06-30 Thread Andrew Haley
> Scoped values cannot be used early in the JDK boot process because of some > dependencies on System.getProperty(). This dependency should be removed in a > way that allows scoped values to be created (but not necessarily bound) at > any stage during boot. > > Also, Scoped Value's constructor

Re: RFR: 8360884: Better scoped values [v2]

2025-06-30 Thread Andrew Haley
> Scoped values cannot be used early in the JDK boot process because of some > dependencies on System.getProperty(). This dependency should be removed in a > way that allows scoped values to be created (but not necessarily bound) at > any stage during boot. > > Also, Scoped Value's constructor

Re: RFR: 8360884: Better scoped values

2025-06-28 Thread Alan Bateman
On Fri, 27 Jun 2025 14:32:11 GMT, Andrew Haley wrote: > Scoped values cannot be used early in the JDK boot process because of some > dependencies on System.getProperty(). Just a bit more context here. There are several places where a class initializer may create a ScopedValue. This must be ver

Re: RFR: 8360884: Better scoped values

2025-06-27 Thread Chen Liang
On Fri, 27 Jun 2025 14:32:11 GMT, Andrew Haley wrote: > Scoped values cannot be used early in the JDK boot process because of some > dependencies on System.getProperty(). This dependency should be removed in a > way that allows scoped values to be created (but not necessarily bound) at > any s

Re: RFR: 8360884: Better scoped values

2025-06-27 Thread Andrew Haley
On Fri, 27 Jun 2025 15:12:57 GMT, Chen Liang wrote: > I looked at the existing code: the reason ScopedValue creation requires > getProperty in Cache is that `generateKey` uses `Cache.primarySlot(x)` and > `Cache.secondarySlot(x)`. Why did you choose to factor out `getProperty` into > a new cla

Re: RFR: 8360884: Better scoped values

2025-06-27 Thread Chen Liang
On Fri, 27 Jun 2025 14:32:11 GMT, Andrew Haley wrote: > Scoped values cannot be used early in the JDK boot process because of some > dependencies on System.getProperty(). This dependency should be removed in a > way that allows scoped values to be created (but not necessarily bound) at > any s

RFR: 8360884: Better scoped values

2025-06-27 Thread Andrew Haley
Scoped values cannot be used early in the JDK boot process because of some dependencies on System.getProperty(). This repen dency should be removed in a way that allows scoped values to be created (but not necessarily bound) at any stage during boot. Also, Scoped Value's constructor has a synch