Eliminate pointer tagging on the reference operation queue.

Tags are unconditionally added before references are added to the
reference queue.  This tag is checked when a reference is removed from
the queue and subsequently cleared.  There are no other observers of
this tag and so it is equivalent to not tag the reference in the first
place.  The original intent may have been to tag the references in
different ways.  Removing this code simplifies reference tracing.

Change-Id: Idb18929e601acdd049b4a92ebf588f3f5febb75c
diff --git a/vm/alloc/Heap.c b/vm/alloc/Heap.c
index 32b4d3b..dcca837 100644
--- a/vm/alloc/Heap.c
+++ b/vm/alloc/Heap.c
@@ -190,30 +190,11 @@
 
     assert(op != NULL);
 
-    obj = NULL;
-
     dvmLockMutex(&gDvm.heapWorkerListLock);
 
-    /* We must handle reference operations before finalizations.
-     * If:
-     *     a) Someone subclasses WeakReference and overrides clear()
-     *     b) A reference of this type is the last reference to
-     *        a finalizable object
-     * then we need to guarantee that the overridden clear() is called
-     * on the reference before finalize() is called on the referent.
-     * Both of these operations will always be scheduled at the same
-     * time, so handling reference operations first will guarantee
-     * the required order.
-     */
     obj = dvmHeapGetNextObjectFromLargeTable(&gcHeap->referenceOperations);
     if (obj != NULL) {
-        uintptr_t workBits;
-
-        workBits = (uintptr_t)obj & WORKER_ENQUEUE;
-        assert(workBits != 0);
-        obj = (Object *)((uintptr_t)obj & ~WORKER_ENQUEUE);
-
-        *op = workBits;
+        *op = WORKER_ENQUEUE;
     } else {
         obj = dvmHeapGetNextObjectFromLargeTable(
                 &gcHeap->pendingFinalizationRefs);
@@ -225,9 +206,6 @@
     if (obj != NULL) {
         /* Don't let the GC collect the object until the
          * worker thread is done with it.
-         *
-         * This call is safe;  it uses thread-local storage
-         * and doesn't acquire any locks.
          */
         dvmAddTrackedAlloc(obj, NULL);
     }