diff options
Diffstat (limited to 'runtime/mirror/object.cc')
-rw-r--r-- | runtime/mirror/object.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/runtime/mirror/object.cc b/runtime/mirror/object.cc index 9262a3e0b6..bbbdf98be8 100644 --- a/runtime/mirror/object.cc +++ b/runtime/mirror/object.cc @@ -159,7 +159,8 @@ int32_t Object::IdentityHashCode() const { case LockWord::kUnlocked: { // Try to compare and swap in a new hash, if we succeed we will return the hash on the next // loop iteration. - LockWord hash_word(LockWord::FromHashCode(GenerateIdentityHashCode())); + LockWord hash_word = LockWord::FromHashCode(GenerateIdentityHashCode(), + lw.ReadBarrierState()); DCHECK_EQ(hash_word.GetState(), LockWord::kHashCode); if (const_cast<Object*>(this)->CasLockWordWeakRelaxed(lw, hash_word)) { return hash_word.GetHashCode(); |