RFR: 8299125: UnifiedOopRef in JFR leakprofiler should treat thread local oops correctly [v2]
Erik Österlund
eosterlund at openjdk.org
Tue Jan 3 15:35:49 UTC 2023
On Tue, 3 Jan 2023 14:58:46 GMT, Axel Boldt-Christmas <aboldtch at openjdk.org> wrote:
>> Thanks. Should not the same construct be used in RawRootClosure? Or is it not needed there because the raw references to oops are not loaded through the Access Api?
>
> Raw storage has no GC barriers so a null oop there must be NULL. The RawAccess API is really only used when dealing with narrowOop or templated generic code which can be either. `RawAccess<>::oop_load(oop* ref)` will just become a `*ref`. I think I used RawAccess everywhere initially ,but @fisk thought that it should not be used for raw oop*, not sure if there were some other reason behind it than it being unnecessary / obfuscating.
I think what I might have said is that RawAccess helps with compressed oop conversion and memory ordering sprinklings. If you don't need to do anything special with either of those and you just want a plain dereference of an oop*, then just doing a plain dereference achieves the same thing with a lot less templates. Using RawAccess can make it look like there is more to it than there really is. It's perfectly correct, but maybe just not needed and makes you scratch your head a bit when really there is nothing special to see at all.
-------------
PR: https://git.openjdk.org/jdk/pull/11741
More information about the hotspot-dev
mailing list