Skip to content
Permalink
Browse files

8231955: ARM32: Address displacement is 0 for volatile field access b…

…ecause of Unsafe field access

Reviewed-by: dlong
  • Loading branch information
mychris authored and Boris Ulasevich committed Nov 6, 2019
1 parent 708890f commit 7fbb1f5ae1c675920f67a3af7fc66b0c6cbaf976
Showing with 20 additions and 6 deletions.
  1. +20 −6 src/hotspot/cpu/arm/c1_LIRGenerator_arm.cpp
@@ -1310,9 +1310,16 @@ void LIRGenerator::volatile_field_store(LIR_Opr value, LIR_Address* address,
CodeEmitInfo* info) {
if (value->is_double_cpu()) {
assert(address->index()->is_illegal(), "should have a constant displacement");
LIR_Opr tmp = new_pointer_register();
add_large_constant(address->base(), address->disp(), tmp);
__ volatile_store_mem_reg(value, new LIR_Address(tmp, (intx)0, address->type()), info);
LIR_Address* store_addr = NULL;
if (address->disp() != 0) {
LIR_Opr tmp = new_pointer_register();
add_large_constant(address->base(), address->disp(), tmp);
store_addr = new LIR_Address(tmp, (intx)0, address->type());
} else {
// address->disp() can be 0, if the address is referenced using the unsafe intrinsic
store_addr = address;
}
__ volatile_store_mem_reg(value, store_addr, info);
return;
}
__ store(value, address, info, lir_patch_none);
@@ -1322,9 +1329,16 @@ void LIRGenerator::volatile_field_load(LIR_Address* address, LIR_Opr result,
CodeEmitInfo* info) {
if (result->is_double_cpu()) {
assert(address->index()->is_illegal(), "should have a constant displacement");
LIR_Opr tmp = new_pointer_register();
add_large_constant(address->base(), address->disp(), tmp);
__ volatile_load_mem_reg(new LIR_Address(tmp, (intx)0, address->type()), result, info);
LIR_Address* load_addr = NULL;
if (address->disp() != 0) {
LIR_Opr tmp = new_pointer_register();
add_large_constant(address->base(), address->disp(), tmp);
load_addr = new LIR_Address(tmp, (intx)0, address->type());
} else {
// address->disp() can be 0, if the address is referenced using the unsafe intrinsic
load_addr = address;
}
__ volatile_load_mem_reg(load_addr, result, info);
return;
}
__ load(address, result, info, lir_patch_none);

0 comments on commit 7fbb1f5

Please sign in to comment.
You can’t perform that action at this time.