RFR: 8351997: AArch64: Interpreter volatile reference stores with G1 are not sequentially consistent
Erik Österlund
eosterlund at openjdk.org
Wed May 28 15:01:03 UTC 2025
On Wed, 28 May 2025 13:25:52 GMT, Fredrik Bredberg <fbredberg at openjdk.org> wrote:
> I tried to follow the `r5` register to see if it's safe to use, and got a bit scared when I saw that that `r5` is used inside `TemplateTable::load_resolved_field_entry()` as a temp register when calling `MacroAssembler::resolve_oop_handle()`. But that's no problem since `is_static` is `false`. Doing manual register allocation in the interpreter is a roller coaster that travels between hope and despair.
>
> Maybe we should add an `assert_different_registers()` statement that includes both `r5` and `rscratch2` after `if (is_static)` in `TemplateTable::load_resolved_field_entry()`?
That wouldn't hurt in that function, and indeed in most functions that have a bunch of register arguments. And even better would be to explicitly pass in that temp register instead of hard coding it. Having said that, I hesitate a bit mixing in orthogonal changes to this train that will have to go all the way back to JDK 8. But I'm happy to add that assert for the follow-up patch that tries to strengthen this code for the future. Hope that's okay.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/25483#issuecomment-2916662319
More information about the hotspot-runtime-dev
mailing list