From 03dbc04d1d5a3bd62801989b16e994a9ed0dafb5 Mon Sep 17 00:00:00 2001 From: Ian Rogers Date: Mon, 2 Jun 2014 14:24:56 -0700 Subject: Make class status volatile. Discourage loads and stores from reordering around the status being updated. Bug: 15347354 Change-Id: Ice805cb834617747c8209e98a142d3e5c7585719 --- compiler/dex/quick/gen_common.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'compiler/dex/quick/gen_common.cc') diff --git a/compiler/dex/quick/gen_common.cc b/compiler/dex/quick/gen_common.cc index 4f2a87672a..03edf2ac39 100644 --- a/compiler/dex/quick/gen_common.cc +++ b/compiler/dex/quick/gen_common.cc @@ -603,6 +603,8 @@ void Mir2Lir::GenSput(MIR* mir, RegLocation rl_src, bool is_long_or_double, field_info.StorageIndex(), r_base)); FreeTemp(r_tmp); + // Ensure load of status and load of value don't re-order. + GenMemBarrier(kLoadLoad); } FreeTemp(r_method); } @@ -694,6 +696,8 @@ void Mir2Lir::GenSget(MIR* mir, RegLocation rl_dest, field_info.StorageIndex(), r_base)); FreeTemp(r_tmp); + // Ensure load of status and load of value don't re-order. + GenMemBarrier(kLoadLoad); } FreeTemp(r_method); } -- cgit v1.2.3-59-g8ed1b