comparison src/share/vm/c1/c1_LIRGenerator.cpp @ 14662:3c3953fb3f2a

8033380: Experimental VM flag to enforce access atomicity Summary: -XX:+AlwaysAtomicAccesses to unconditionally enforce the access atomicity. Reviewed-by: roland, kvn, iveresov
author shade
date Mon, 03 Mar 2014 15:54:45 +0400
parents 8cdf3f43f63e
children b51e29501f30
comparison
equal deleted inserted replaced
14661:bbfe3ac1471d 14662:3c3953fb3f2a
1732 true /* do_load*/, 1732 true /* do_load*/,
1733 needs_patching, 1733 needs_patching,
1734 (info ? new CodeEmitInfo(info) : NULL)); 1734 (info ? new CodeEmitInfo(info) : NULL));
1735 } 1735 }
1736 1736
1737 if (is_volatile && !needs_patching) { 1737 bool needs_atomic_access = is_volatile || AlwaysAtomicAccesses;
1738 if (needs_atomic_access && !needs_patching) {
1738 volatile_field_store(value.result(), address, info); 1739 volatile_field_store(value.result(), address, info);
1739 } else { 1740 } else {
1740 LIR_PatchCode patch_code = needs_patching ? lir_patch_normal : lir_patch_none; 1741 LIR_PatchCode patch_code = needs_patching ? lir_patch_normal : lir_patch_none;
1741 __ store(value.result(), address, info, patch_code); 1742 __ store(value.result(), address, info, patch_code);
1742 } 1743 }
1805 address = new LIR_Address(object.result(), PATCHED_ADDR, field_type); 1806 address = new LIR_Address(object.result(), PATCHED_ADDR, field_type);
1806 } else { 1807 } else {
1807 address = generate_address(object.result(), x->offset(), field_type); 1808 address = generate_address(object.result(), x->offset(), field_type);
1808 } 1809 }
1809 1810
1810 if (is_volatile && !needs_patching) { 1811 bool needs_atomic_access = is_volatile || AlwaysAtomicAccesses;
1812 if (needs_atomic_access && !needs_patching) {
1811 volatile_field_load(address, reg, info); 1813 volatile_field_load(address, reg, info);
1812 } else { 1814 } else {
1813 LIR_PatchCode patch_code = needs_patching ? lir_patch_normal : lir_patch_none; 1815 LIR_PatchCode patch_code = needs_patching ? lir_patch_normal : lir_patch_none;
1814 __ load(address, reg, info, patch_code); 1816 __ load(address, reg, info, patch_code);
1815 } 1817 }