64bit friendly GC CAS operations.
Change-Id: I54dfa5fdaf0d057ef74c84efb10a609e01923c9e
diff --git a/runtime/gc/accounting/space_bitmap-inl.h b/runtime/gc/accounting/space_bitmap-inl.h
index 1dde18d..01c70fa 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 @@
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 ac20972..74a0274 100644
--- a/runtime/gc/space/bump_pointer_space-inl.h
+++ b/runtime/gc/space/bump_pointer_space-inl.h
@@ -34,10 +34,9 @@
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);
}