Re: RFR: 8361497: Scoped Values: orElse and orElseThrow do not access the cache

2025-07-10 Thread Alan Bateman
On Mon, 7 Jul 2025 16:13:08 GMT, Andrew Haley wrote: > Neither `ScopedValue.orElse` nor `ScopedValue.orElseThrow` consult the cache > when searching for a binding. Neither do they update the cache when a binding > is found. > While this issue does not affect spec compliance, it is surprising to

Re: RFR: 8361497: Scoped Values: orElse and orElseThrow do not access the cache

2025-07-08 Thread Alan Bateman
On Mon, 7 Jul 2025 16:13:08 GMT, Andrew Haley wrote: > Neither `ScopedValue.orElse` nor `ScopedValue.orElseThrow` consult the cache > when searching for a binding. Neither do they update the cache when a binding > is found. > While this issue does not affect spec compliance, it is surprising to

Re: RFR: 8361497: Scoped Values: orElse and orElseThrow do not access the cache

2025-07-08 Thread Chen Liang
On Mon, 7 Jul 2025 16:13:08 GMT, Andrew Haley wrote: > Neither `ScopedValue.orElse` nor `ScopedValue.orElseThrow` consult the cache > when searching for a binding. Neither do they update the cache when a binding > is found. > While this issue does not affect spec compliance, it is surprising to

Re: RFR: 8361497: Scoped Values: orElse and orElseThrow do not access the cache

2025-07-08 Thread Andrew Haley
On Mon, 7 Jul 2025 16:33:22 GMT, Chen Liang wrote: > Can `get` and `slowGet` be refactored to use this `findBinding` too? Not really, no. Inlining is critical here, and `get()` is written in this way for efficiency of generated code. - PR Comment: https://git.openjdk.org/jdk/pull

Re: RFR: 8361497: Scoped Values: orElse and orElseThrow do not access the cache

2025-07-07 Thread Chen Liang
On Mon, 7 Jul 2025 16:13:08 GMT, Andrew Haley wrote: > Neither `ScopedValue.orElse` nor `ScopedValue.orElseThrow` consult the cache > when searching for a binding. Neither do they update the cache when a binding > is found. > While this issue does not affect spec compliance, it is surprising to

Re: RFR: 8361497: Scoped Values: orElse and orElseThrow do not access the cache

2025-07-07 Thread Andrew Haley
On Mon, 7 Jul 2025 16:13:08 GMT, Andrew Haley wrote: > Neither `ScopedValue.orElse` nor `ScopedValue.orElseThrow` consult the cache > when searching for a binding. Neither do they update the cache when a binding > is found. > While this issue does not affect spec compliance, it is surprising to

RFR: 8361497: Scoped Values: orElse and orElseThrow do not access the cache

2025-07-07 Thread Andrew Haley
Neither `ScopedValue.orElse` nor `ScopedValue.orElseThrow` consult the cache when searching for a binding. Neither do they update the cache when a binding is found. While this issue does not affect spec compliance, it is surprising to users that `x.orElse(other)` should be slower than `x.isBound