diff options
author | Hans Boehm <hboehm@google.com> | 2014-06-27 14:50:10 -0700 |
---|---|---|
committer | Hans Boehm <hboehm@google.com> | 2014-07-11 15:37:05 -0700 |
commit | 48f5c47907654350ce30a8dfdda0e977f5d3d39f (patch) | |
tree | c535d2af13e6fb175ba4ab0d9d044b5c9d2f8489 /compiler/llvm/gbc_expander.cc | |
parent | 438b9039c77b2c9556f362e8cbbefcf21c55b527 (diff) | |
download | art-48f5c47907654350ce30a8dfdda0e977f5d3d39f.tar.gz art-48f5c47907654350ce30a8dfdda0e977f5d3d39f.tar.bz2 art-48f5c47907654350ce30a8dfdda0e977f5d3d39f.zip |
Replace memory barriers to better reflect Java needs.
Replaces barriers that enforce ordering of one access type
(e.g. Load) with respect to another (e.g. store) with more general
ones that better reflect both Java requirements and actual hardware
barrier/fence instructions. The old code was inconsistent and
unclear about which barriers implied which others. Sometimes
multiple barriers were generated and then eliminated;
sometimes it was assumed that certain barriers implied others.
The new barriers closely parallel those in C++11, though, for now,
we use something closer to the old naming.
Bug: 14685856
Change-Id: Ie1c80afe3470057fc6f2b693a9831dfe83add831
Diffstat (limited to 'compiler/llvm/gbc_expander.cc')
-rw-r--r-- | compiler/llvm/gbc_expander.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/compiler/llvm/gbc_expander.cc b/compiler/llvm/gbc_expander.cc index f8dca66de0..902f8dd4f5 100644 --- a/compiler/llvm/gbc_expander.cc +++ b/compiler/llvm/gbc_expander.cc @@ -1648,7 +1648,7 @@ llvm::Value* GBCExpanderPass::Expand_HLIGet(llvm::CallInst& call_inst, field_value = SignOrZeroExtendCat1Types(field_value, field_jty); if (is_volatile) { - irb_.CreateMemoryBarrier(art::kLoadLoad); + irb_.CreateMemoryBarrier(art::kLoadAny); } } @@ -1702,7 +1702,7 @@ void GBCExpanderPass::Expand_HLIPut(llvm::CallInst& call_inst, DCHECK_GE(field_offset.Int32Value(), 0); if (is_volatile) { - irb_.CreateMemoryBarrier(art::kStoreStore); + irb_.CreateMemoryBarrier(art::kAnyStore); } llvm::PointerType* field_type = @@ -1717,7 +1717,7 @@ void GBCExpanderPass::Expand_HLIPut(llvm::CallInst& call_inst, irb_.CreateStore(new_value, field_addr, kTBAAHeapInstance, field_jty); if (is_volatile) { - irb_.CreateMemoryBarrier(art::kLoadLoad); + irb_.CreateMemoryBarrier(art::kAnyAny); } if (field_jty == kObject) { // If put an object, mark the GC card table. @@ -1870,7 +1870,7 @@ llvm::Value* GBCExpanderPass::EmitLoadStaticStorage(uint32_t dex_pc, phi->addIncoming(loaded_storage_object_addr, block_after_load_static); // Ensure load of status and load of value don't re-order. - irb_.CreateMemoryBarrier(art::kLoadLoad); + irb_.CreateMemoryBarrier(art::kLoadAny); return phi; } @@ -1948,7 +1948,7 @@ llvm::Value* GBCExpanderPass::Expand_HLSget(llvm::CallInst& call_inst, static_field_value = SignOrZeroExtendCat1Types(static_field_value, field_jty); if (is_volatile) { - irb_.CreateMemoryBarrier(art::kLoadLoad); + irb_.CreateMemoryBarrier(art::kLoadAny); } } @@ -2025,7 +2025,7 @@ void GBCExpanderPass::Expand_HLSput(llvm::CallInst& call_inst, } if (is_volatile) { - irb_.CreateMemoryBarrier(art::kStoreStore); + irb_.CreateMemoryBarrier(art::kAnyStore); } llvm::Value* static_field_offset_value = irb_.getPtrEquivInt(field_offset.Int32Value()); @@ -2038,7 +2038,7 @@ void GBCExpanderPass::Expand_HLSput(llvm::CallInst& call_inst, irb_.CreateStore(new_value, static_field_addr, kTBAAHeapStatic, field_jty); if (is_volatile) { - irb_.CreateMemoryBarrier(art::kStoreLoad); + irb_.CreateMemoryBarrier(art::kAnyAny); } if (field_jty == kObject) { // If put an object, mark the GC card table. |