summaryrefslogtreecommitdiffstats
path: root/vm/Sync.cpp
diff options
context:
space:
mode:
authorCarl Shapiro <cshapiro@google.com>2011-04-20 18:07:44 -0700
committerCarl Shapiro <cshapiro@google.com>2011-04-20 18:07:44 -0700
commit122dac5b92c649b5d3182b163d7fce35e8c69d76 (patch)
tree2fee0eb2183fe138bbe832ff66ec6b2f57302502 /vm/Sync.cpp
parent5d6b40f4954c2f2cd664590f2cb73e2adc427dfc (diff)
downloadandroid_dalvik-122dac5b92c649b5d3182b163d7fce35e8c69d76.tar.gz
android_dalvik-122dac5b92c649b5d3182b163d7fce35e8c69d76.tar.bz2
android_dalvik-122dac5b92c649b5d3182b163d7fce35e8c69d76.zip
Remove DVM_LOCK_INIT and DVM_LOCK_INITIAL_THIN_VALUE.
The original implementation for thin locks used a magic non-zero value to encode the initial thin lock state. This magic value was kept around in DVM_LOCK_INITIAL_THIN_VALUE and stored into the lock word of newly allocated objects. A later revision to the thin locking code made the initial thin lock value be 0. That change eliminated the requirement that lock words be explicitly initialized as the allocator always returns zero-filled memory. Change-Id: I34e0b43b4c4db0f45cf7cf524e15d4a6096c1365
Diffstat (limited to 'vm/Sync.cpp')
-rw-r--r--vm/Sync.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/vm/Sync.cpp b/vm/Sync.cpp
index 6f0a50f7f..ef3524a18 100644
--- a/vm/Sync.cpp
+++ b/vm/Sync.cpp
@@ -1281,10 +1281,9 @@ retry:
* If the lock is thin assume it is unowned. We simulate
* an acquire, update, and release with a single CAS.
*/
- lock = DVM_LOCK_INITIAL_THIN_VALUE;
- lock |= (LW_HASH_STATE_HASHED << LW_HASH_STATE_SHIFT);
+ lock = (LW_HASH_STATE_HASHED << LW_HASH_STATE_SHIFT);
if (android_atomic_acquire_cas(
- (int32_t)DVM_LOCK_INITIAL_THIN_VALUE,
+ 0,
(int32_t)lock,
(int32_t *)lw) == 0) {
/*