Move finalization out of the VM.
This change introduces a new reference class whose referent
points to instances requiring finalization. This makes the
finalization of objects possible using a reference queue and
a dedicated thread which removes objects from the queue.
Change-Id: I0ff6dd272f00ca08c6ed3aa667bf766a039a944e
diff --git a/vm/oo/Object.h b/vm/oo/Object.h
index 7f2fbf6..b32d5b9 100644
--- a/vm/oo/Object.h
+++ b/vm/oo/Object.h
@@ -80,12 +80,14 @@
CLASS_ISFINALIZABLE = (1<<31), // class/ancestor overrides finalize()
CLASS_ISARRAY = (1<<30), // class is a "[*"
CLASS_ISOBJECTARRAY = (1<<29), // class is a "[L*" or "[[*"
+
CLASS_ISREFERENCE = (1<<28), // class is a soft/weak/phantom ref
// only ISREFERENCE is set --> soft
CLASS_ISWEAKREFERENCE = (1<<27), // class is a weak reference
- CLASS_ISPHANTOMREFERENCE = (1<<26), // class is a phantom reference
+ CLASS_ISFINALIZERREFERENCE = (1<<26), // class is a phantom reference
+ CLASS_ISPHANTOMREFERENCE = (1<<25), // class is a phantom reference
- CLASS_MULTIPLE_DEFS = (1<<25), // DEX verifier: defs in multiple DEXs
+ CLASS_MULTIPLE_DEFS = (1<<24), // DEX verifier: defs in multiple DEXs
/* unlike the others, these can be present in the optimized DEX file */
CLASS_ISOPTIMIZED = (1<<17), // class may contain opt instrs