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
diff --git a/vm/alloc/Alloc.cpp b/vm/alloc/Alloc.cpp
index 1529510..31df25d 100644
--- a/vm/alloc/Alloc.cpp
+++ b/vm/alloc/Alloc.cpp
@@ -224,12 +224,8 @@
  */
 Object* dvmCloneObject(Object* obj, int flags)
 {
-    ClassObject* clazz;
-    Object* copy;
-    size_t size;
-
     assert(dvmIsValidObject(obj));
-    clazz = obj->clazz;
+    ClassObject* clazz = obj->clazz;
 
     /* Class.java shouldn't let us get here (java.lang.Class is final
      * and does not implement Clonable), but make extra sure.
@@ -237,20 +233,21 @@
      */
     assert(!dvmIsTheClassClass(clazz));
 
+    size_t size;
     if (IS_CLASS_FLAG_SET(clazz, CLASS_ISARRAY)) {
         size = dvmArrayObjectSize((ArrayObject *)obj);
     } else {
         size = clazz->objectSize;
     }
 
-    copy = (Object*)dvmMalloc(size, flags);
+    Object* copy = (Object*)dvmMalloc(size, flags);
     if (copy == NULL)
         return NULL;
 
-    /* We assume that memcpy will copy obj by words. */
-    memcpy(copy, obj, size);
-    DVM_LOCK_INIT(&copy->lock);
-    dvmWriteBarrierObject(copy);
+    DVM_OBJECT_INIT(copy, clazz);
+    size_t offset = sizeof(Object);
+    /* Copy instance data.  We assume memcpy copies by words. */
+    memcpy((char*)copy + offset, (char*)obj + offset, size - offset);
 
     /* Mark the clone as finalizable if appropriate. */
     if (IS_CLASS_FLAG_SET(clazz, CLASS_ISFINALIZABLE)) {