RFR: JDK-8286666: JEP 429: Implementation of Scoped Values (Incubator) [v33]
Andrew Haley
aph at openjdk.org
Tue Nov 29 11:51:39 UTC 2022
On Thu, 24 Nov 2022 14:05:41 GMT, Andrew Haley <aph at 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
More information about the hotspot-dev
mailing list