summaryrefslogtreecommitdiffstats
path: root/compiler/dex/quick/x86/int_x86.cc
diff options
context:
space:
mode:
authorHans Boehm <hboehm@google.com>2014-07-11 23:08:14 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-07-11 16:35:27 +0000
commitaebf3cda094f34cf846d19a7724bdc8005267c95 (patch)
tree9c396a3013f10eb6e996ae57a188699791f0fa80 /compiler/dex/quick/x86/int_x86.cc
parent2751ffbe4e3192395e7402f93b597a397f01f889 (diff)
parent48f5c47907654350ce30a8dfdda0e977f5d3d39f (diff)
downloadandroid_art-aebf3cda094f34cf846d19a7724bdc8005267c95.tar.gz
android_art-aebf3cda094f34cf846d19a7724bdc8005267c95.tar.bz2
android_art-aebf3cda094f34cf846d19a7724bdc8005267c95.zip
Merge "Replace memory barriers to better reflect Java needs."
Diffstat (limited to 'compiler/dex/quick/x86/int_x86.cc')
-rwxr-xr-xcompiler/dex/quick/x86/int_x86.cc19
1 files changed, 11 insertions, 8 deletions
diff --git a/compiler/dex/quick/x86/int_x86.cc b/compiler/dex/quick/x86/int_x86.cc
index f1166f6263..4ecc5d8673 100755
--- a/compiler/dex/quick/x86/int_x86.cc
+++ b/compiler/dex/quick/x86/int_x86.cc
@@ -861,7 +861,7 @@ bool X86Mir2Lir::GenInlinedCas(CallInfo* info, bool is_long, bool is_object) {
// After a store we need to insert barrier in case of potential load. Since the
// locked cmpxchg has full barrier semantics, only a scheduling barrier will be generated.
- GenMemBarrier(kStoreLoad);
+ GenMemBarrier(kAnyAny);
FreeTemp(rs_r0q);
} else if (is_long) {
@@ -913,10 +913,11 @@ bool X86Mir2Lir::GenInlinedCas(CallInfo* info, bool is_long, bool is_object) {
}
NewLIR4(kX86LockCmpxchg64A, rs_obj.GetReg(), rs_off.GetReg(), 0, 0);
- // After a store we need to insert barrier in case of potential load. Since the
- // locked cmpxchg has full barrier semantics, only a scheduling barrier will be generated.
- GenMemBarrier(kStoreLoad);
-
+ // After a store we need to insert barrier to prevent reordering with either
+ // earlier or later memory accesses. Since
+ // locked cmpxchg has full barrier semantics, only a scheduling barrier will be generated,
+ // and it will be associated with the cmpxchg instruction, preventing both.
+ GenMemBarrier(kAnyAny);
if (push_si) {
FreeTemp(rs_rSI);
@@ -954,9 +955,11 @@ bool X86Mir2Lir::GenInlinedCas(CallInfo* info, bool is_long, bool is_object) {
LoadValueDirect(rl_src_expected, rs_r0);
NewLIR5(kX86LockCmpxchgAR, rl_object.reg.GetReg(), rl_offset.reg.GetReg(), 0, 0, rl_new_value.reg.GetReg());
- // After a store we need to insert barrier in case of potential load. Since the
- // locked cmpxchg has full barrier semantics, only a scheduling barrier will be generated.
- GenMemBarrier(kStoreLoad);
+ // After a store we need to insert barrier to prevent reordering with either
+ // earlier or later memory accesses. Since
+ // locked cmpxchg has full barrier semantics, only a scheduling barrier will be generated,
+ // and it will be associated with the cmpxchg instruction, preventing both.
+ GenMemBarrier(kAnyAny);
FreeTemp(rs_r0);
}