summaryrefslogtreecommitdiff
path: root/runtime/mirror/object.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/mirror/object.cc')
-rw-r--r--runtime/mirror/object.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/runtime/mirror/object.cc b/runtime/mirror/object.cc
index 4240e702b5..200bc471b8 100644
--- a/runtime/mirror/object.cc
+++ b/runtime/mirror/object.cc
@@ -197,7 +197,9 @@ int32_t Object::IdentityHashCode() {
// loop iteration.
LockWord hash_word = LockWord::FromHashCode(GenerateIdentityHashCode(), lw.GCState());
DCHECK_EQ(hash_word.GetState(), LockWord::kHashCode);
- if (current_this->CasLockWordWeakRelaxed(lw, hash_word)) {
+ // Use a strong CAS to prevent spurious failures since these can make the boot image
+ // non-deterministic.
+ if (current_this->CasLockWordStrongRelaxed(lw, hash_word)) {
return hash_word.GetHashCode();
}
break;