RFR: 8299032: Interface IN_NATIVE oop stores for C2
Roberto Castañeda Lozano
rcastanedalo at openjdk.org
Thu Jan 12 14:07:22 UTC 2023
On Fri, 23 Dec 2022 13:54:44 GMT, Erik Österlund <eosterlund at openjdk.org> wrote:
> Loom added the first IN_NATIVE oop store to C2 code, when switching the current virtual thread of a platform thread. Instead of interfacing this properly, a raw store was used. But a future GC algorithm, such as generational ZGC, might not work well with raw stores. We should add support to the access API for this. Looks like Shenandoah was already missing something here as they do concurrent root processing requiring SATB barriers on IN_NATIVE oop stores. It is not in the scope of this PR to fix the Shenandoah bug - someone working on Shenandoah should do this. This PR merely adds an interface such that GCs that need to do something different here, can do that. Serial, Parallel and G1 don't need to do anything for IN_NATIVE stores as they do STW root processing. ZGC doesn't (yet) have store barriers at all, and hence doesn't need to do anything special either.
Looks good! Do not forget to update the copyright headers.
I checked the coverage of `inline_native_setCurrentThread()` in tiers 1-3, and this function is only exercised by the serviceability and a few long-running, CTW-like test cases. We should probably extend `test/hotspot/jtreg/compiler/intrinsics` with specific tests for Loom intrinsics (in a separate RFE).
-------------
Marked as reviewed by rcastanedalo (Reviewer).
PR: https://git.openjdk.org/jdk/pull/11777
More information about the hotspot-dev
mailing list