summaryrefslogtreecommitdiff
path: root/compiler/utils
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2016-12-06 14:33:12 +0000
committer android-build-merger <android-build-merger@google.com> 2016-12-06 14:33:12 +0000
commit78ba82ff895154cace59570da7375b5e3e357dc6 (patch)
treee3db64af82b6e01fc9c429e9dc8f28e15c43509d /compiler/utils
parent86a105a6770ff5c608ffb2e0d48b2d352d0513b9 (diff)
parent02d45c6afcd6d2d55fd8fd2a89fce75311ec5b44 (diff)
Merge "Fix two tests after vdex change."
am: 02d45c6afc Change-Id: I3d6e05b4d1a033a7ba4ffe4f868186a51e469795
Diffstat (limited to 'compiler/utils')
-rw-r--r--compiler/utils/atomic_method_ref_map-inl.h9
-rw-r--r--compiler/utils/atomic_method_ref_map.h2
2 files changed, 11 insertions, 0 deletions
diff --git a/compiler/utils/atomic_method_ref_map-inl.h b/compiler/utils/atomic_method_ref_map-inl.h
index 70ea028b17..d71c2fe997 100644
--- a/compiler/utils/atomic_method_ref_map-inl.h
+++ b/compiler/utils/atomic_method_ref_map-inl.h
@@ -78,6 +78,15 @@ inline void AtomicMethodRefMap<T>::Visit(const Visitor& visitor) {
}
}
+template <typename T>
+inline void AtomicMethodRefMap<T>::ClearEntries() {
+ for (auto& it : arrays_) {
+ for (auto& element : it.second) {
+ element.StoreRelaxed(nullptr);
+ }
+ }
+}
+
} // namespace art
#endif // ART_COMPILER_UTILS_ATOMIC_METHOD_REF_MAP_INL_H_
diff --git a/compiler/utils/atomic_method_ref_map.h b/compiler/utils/atomic_method_ref_map.h
index 11ab211817..fed848f563 100644
--- a/compiler/utils/atomic_method_ref_map.h
+++ b/compiler/utils/atomic_method_ref_map.h
@@ -55,6 +55,8 @@ class AtomicMethodRefMap {
template <typename Visitor>
void Visit(const Visitor& visitor);
+ void ClearEntries();
+
private:
// Verified methods. The method array is fixed to avoid needing a lock to extend it.
using ElementArray = dchecked_vector<Atomic<T>>;