Skip to content

8351997: AArch64: Interpreter volatile reference stores with G1 are not sequentially consistent #1905

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/hotspot/cpu/aarch64/templateTable_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1135,6 +1135,7 @@ void TemplateTable::aastore() {
// Get the value we will store
__ ldr(r0, at_tos());
// Now store using the appropriate barrier
// Clobbers: r10, r11, r3
do_oop_store(_masm, element_address, r0, IS_ARRAY);
__ b(done);

Expand All @@ -1143,6 +1144,7 @@ void TemplateTable::aastore() {
__ profile_null_seen(r2);

// Store a null
// Clobbers: r10, r11, r3
do_oop_store(_masm, element_address, noreg, IS_ARRAY);

// Pop stack arguments
Expand Down Expand Up @@ -2774,6 +2776,7 @@ void TemplateTable::putfield_or_static(int byte_no, bool is_static, RewriteContr
__ pop(atos);
if (!is_static) pop_and_check_object(obj);
// Store into the field
// Clobbers: r10, r11, r3
do_oop_store(_masm, field, r0, IN_HEAP);
if (rc == may_rewrite) {
patch_bytecode(Bytecodes::_fast_aputfield, bc, r1, true, byte_no);
Expand Down Expand Up @@ -2973,16 +2976,16 @@ void TemplateTable::fast_storefield(TosState state)
// Must prevent reordering of the following cp cache loads with bytecode load
__ membar(MacroAssembler::LoadLoad);

// test for volatile with r3
__ ldrw(r3, Address(r2, in_bytes(base +
// test for volatile with r5
__ ldrw(r5, Address(r2, in_bytes(base +
ConstantPoolCacheEntry::flags_offset())));

// replace index with field offset from cache entry
__ ldr(r1, Address(r2, in_bytes(base + ConstantPoolCacheEntry::f2_offset())));

{
Label notVolatile;
__ tbz(r3, ConstantPoolCacheEntry::is_volatile_shift, notVolatile);
__ tbz(r5, ConstantPoolCacheEntry::is_volatile_shift, notVolatile);
__ membar(MacroAssembler::StoreStore | MacroAssembler::LoadStore);
__ bind(notVolatile);
}
Expand All @@ -2998,6 +3001,7 @@ void TemplateTable::fast_storefield(TosState state)
// access field
switch (bytecode()) {
case Bytecodes::_fast_aputfield:
// Clobbers: r10, r11, r3
do_oop_store(_masm, field, r0, IN_HEAP);
break;
case Bytecodes::_fast_lputfield:
Expand Down Expand Up @@ -3030,7 +3034,7 @@ void TemplateTable::fast_storefield(TosState state)

{
Label notVolatile;
__ tbz(r3, ConstantPoolCacheEntry::is_volatile_shift, notVolatile);
__ tbz(r5, ConstantPoolCacheEntry::is_volatile_shift, notVolatile);
__ membar(MacroAssembler::StoreLoad | MacroAssembler::StoreStore);
__ bind(notVolatile);
}
Expand Down