summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Santiago Aboy Solanes <solanes@google.com> 2024-03-22 14:15:07 +0000
committer Santiago Aboy Solanes <solanes@google.com> 2024-04-02 15:44:22 +0000
commitf2760bda7a6c8bef53b1eaff1fa91fb19ad29645 (patch)
tree83f6dfcb43ba0d9a845baadc294392480919adc0
parente9c64c9f13093589c6a4d3b0bc66c744a7e44f9d (diff)
Make DexCachePairArray Set/GetPair use release/acquire
We no longer read dex caches from compiled managed code and we've got the thread local cache for interpreters (nterp and switch), so this isn't performance-critical anymore. Bug: 325262531 Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b Change-Id: Ib2a4f3710e0e153ca6fbd57380bce375c3bb028d
-rw-r--r--runtime/mirror/dex_cache.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/mirror/dex_cache.h b/runtime/mirror/dex_cache.h
index d93464759f..8910dfcbb5 100644
--- a/runtime/mirror/dex_cache.h
+++ b/runtime/mirror/dex_cache.h
@@ -179,11 +179,11 @@ template <typename T, size_t size> class DexCachePairArray {
}
DexCachePair<T> GetPair(uint32_t index) {
- return entries_[SlotIndex(index)].load(std::memory_order_relaxed);
+ return entries_[SlotIndex(index)].load(std::memory_order_acquire);
}
void SetPair(uint32_t index, DexCachePair<T> value) {
- entries_[SlotIndex(index)].store(value, std::memory_order_relaxed);
+ entries_[SlotIndex(index)].store(value, std::memory_order_release);
}
void Clear(uint32_t index) {