From 4e6a31eb97f22f4480827474b30b9e64f396eace Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Thu, 31 Oct 2013 10:35:05 -0700 Subject: Lazily compute object identity hash codes. Before, we computed identity hashcodes whenever we inflated a monitor. This caused issues since it meant that we would have all of these hash codes in the image, causing locks to excessively inflate during application run time. This change makes it so that we lazily compute hash codes. When a thin lock gets inflated, we assign a hash code of 0 assigned to it. This value signifies no hash code. When we try to get the identity hash code of an object with an inflated monitor, it gets computed if it is 0. Change-Id: Iae6acd1960515a36e74644e5b1323ff336731806 --- runtime/lock_word.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/lock_word.h') diff --git a/runtime/lock_word.h b/runtime/lock_word.h index 9b6c64a..1882ae6 100644 --- a/runtime/lock_word.h +++ b/runtime/lock_word.h @@ -132,7 +132,7 @@ class LockWord { } // Return the hash code stored in the lock word, must be kHashCode state. - uint32_t GetHashCode() const; + int32_t GetHashCode() const; uint32_t GetValue() const { return value_; -- cgit v1.1