diff options
author | Ian Rogers <irogers@google.com> | 2014-01-24 00:51:29 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-01-24 00:51:29 +0000 |
commit | 2f7130b2db84a730d32e5b7b99a161ff3cf6326b (patch) | |
tree | 4ea2974b43f7db3adc4e6f412dc39f329f8a1e37 | |
parent | 8c95011dad0ea0e3a88775de70256ace93488baf (diff) | |
parent | 55b2764c23776a7eba91d6514a4ad2cbc95e0fd0 (diff) | |
download | android_art-2f7130b2db84a730d32e5b7b99a161ff3cf6326b.tar.gz android_art-2f7130b2db84a730d32e5b7b99a161ff3cf6326b.tar.bz2 android_art-2f7130b2db84a730d32e5b7b99a161ff3cf6326b.zip |
Merge "64bit friendly GC CAS operations."
-rw-r--r-- | runtime/gc/accounting/space_bitmap-inl.h | 3 | ||||
-rw-r--r-- | runtime/gc/space/bump_pointer_space-inl.h | 7 |
2 files changed, 4 insertions, 6 deletions
diff --git a/runtime/gc/accounting/space_bitmap-inl.h b/runtime/gc/accounting/space_bitmap-inl.h index 1dde18da4a..01c70facdf 100644 --- a/runtime/gc/accounting/space_bitmap-inl.h +++ b/runtime/gc/accounting/space_bitmap-inl.h @@ -18,7 +18,6 @@ #define ART_RUNTIME_GC_ACCOUNTING_SPACE_BITMAP_INL_H_ #include "base/logging.h" -#include "cutils/atomic-inline.h" #include "utils.h" namespace art { @@ -40,7 +39,7 @@ inline bool SpaceBitmap::AtomicTestAndSet(const mirror::Object* obj) { if ((old_word & mask) != 0) { return true; } - } while (UNLIKELY(android_atomic_cas(old_word, old_word | mask, address) != 0)); + } while (!__sync_bool_compare_and_swap(address, old_word, old_word | mask)); return false; } diff --git a/runtime/gc/space/bump_pointer_space-inl.h b/runtime/gc/space/bump_pointer_space-inl.h index ac20972a70..74a027462e 100644 --- a/runtime/gc/space/bump_pointer_space-inl.h +++ b/runtime/gc/space/bump_pointer_space-inl.h @@ -34,10 +34,9 @@ inline mirror::Object* BumpPointerSpace::AllocNonvirtualWithoutAccounting(size_t if (UNLIKELY(new_end > growth_end_)) { return nullptr; } - // TODO: Use a cas which always equals the size of pointers. - } while (android_atomic_cas(reinterpret_cast<int32_t>(old_end), - reinterpret_cast<int32_t>(new_end), - reinterpret_cast<volatile int32_t*>(&end_)) != 0); + } while (!__sync_bool_compare_and_swap(reinterpret_cast<volatile intptr_t*>(&end_), + reinterpret_cast<intptr_t>(old_end), + reinterpret_cast<intptr_t>(new_end))); return reinterpret_cast<mirror::Object*>(old_end); } |