On Thu, 24 Nov 2022 14:05:41 GMT, Andrew Haley <a...@openjdk.org> wrote:

>> JEP 429 implementation.
>
> Andrew Haley has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Unused variable

src/jdk.incubator.concurrent/share/classes/jdk/incubator/concurrent/ScopedValue.java
 line 385:

> 383:             try {
> 384:                 JLA.setScopedValueBindings(newSnapshot);
> 385:                 JLA.ensureMaterializedForStackWalk(newSnapshot);

Question: is it necessary here to invoke `ensureMaterializedForStackWalk()` 
It's really only there to prevent the new `Snapshot` from being scalar 
replaced. But we know that it cannot be scalar replaced, because it really does 
escape: a pointer to it is stored in the current `Thread`. So should we simply 
remove the call to `ensureMaterializedForStackWalk()`, on the grounds that it 
cannot have any effect?

-------------

PR: https://git.openjdk.org/jdk/pull/10952

Reply via email to