C2, ThreadLocalNode, and Loom

Roland Westrelin rwestrel at redhat.com
Fri Nov 25 09:03:58 UTC 2022


> This reminds me of a similar problem that doesn't have a good solution 
> yet, and solving one might be a template for the other. In GC barriers, 
> one thing that is very commonly done is 1. Load GC state from a global 
> field, 2. Branch to slow- (or mid-) path if GC is supposed to take some 
> action. This GC state is loaded at every barrier site, because it's 
> treated as RAW memory. However, since it only ever changes at 
> safepoints, it would be nice to be able to tell C2 that it doesn't need 
> reloading between safepoints. I suspect that if we had a 
> constant-between-safepoints notion in C2, several other uses and 
> possible optimizations could be found.

That would require SafePointNode to produce a new memory state. Then
there's no need to pin nodes that must not float across a
safepoint. Anyway, that's the kind of change to c2 that's disruptive
with little benefit that's very unlikely to happen.

Roland.



More information about the hotspot-compiler-dev mailing list