summaryrefslogtreecommitdiffstats
path: root/vm/BitVector.h
diff options
context:
space:
mode:
authorAndy McFadden <fadden@android.com>2010-12-10 15:34:00 -0800
committerAndy McFadden <fadden@android.com>2010-12-16 15:33:00 -0800
commit9fd527f3258381b33365cb18fd37c7864e2bbb40 (patch)
treeae144f104c1c44efdbc97c03a9b9797e558ea6d6 /vm/BitVector.h
parentbfac08e47db21634161398169e638d8b6fbd7373 (diff)
downloadandroid_dalvik-9fd527f3258381b33365cb18fd37c7864e2bbb40.tar.gz
android_dalvik-9fd527f3258381b33365cb18fd37c7864e2bbb40.tar.bz2
android_dalvik-9fd527f3258381b33365cb18fd37c7864e2bbb40.zip
Progress on live-precise GC.
This implements computation of register liveness. This is still a work in progress. The computation is disabled by default, and when enabled it's not yet used during the generation of register maps. The code has not been thoughly tested. While working on this I fiddled around with the verifier's verbose debugging stuff a bit. This also changes some stuff in BitVector. Unsigned ints are now prevalent, and functions like dvmSetBit abort rather than returning a boolean value when an illegal operation is attempted. (Some parallel functions in the compiler were also updated.) Bug 2534655 Change-Id: Iea161c6d63a310e1dbdac2aeeb7b7aeadda8807c
Diffstat (limited to 'vm/BitVector.h')
-rw-r--r--vm/BitVector.h27
1 files changed, 18 insertions, 9 deletions
diff --git a/vm/BitVector.h b/vm/BitVector.h
index 3c926b14e..d1a0ca31d 100644
--- a/vm/BitVector.h
+++ b/vm/BitVector.h
@@ -28,7 +28,7 @@
*/
typedef struct BitVector {
bool expandable; /* expand bitmap if we run out? */
- int storageSize; /* current size, in 32-bit words */
+ u4 storageSize; /* current size, in 32-bit words */
u4* storage;
} BitVector;
@@ -40,7 +40,7 @@ typedef struct BitVectorIterator {
} BitVectorIterator;
/* allocate a bit vector with enough space to hold "startBits" bits */
-BitVector* dvmAllocBitVector(int startBits, bool expandable);
+BitVector* dvmAllocBitVector(unsigned int startBits, bool expandable);
void dvmFreeBitVector(BitVector* pBits);
/*
@@ -49,24 +49,25 @@ void dvmFreeBitVector(BitVector* pBits);
* returns -1.
*
* dvmSetBit sets the specified bit, expanding the vector if necessary
- * (and possible).
+ * (and possible). Attempting to set a bit past the limit of a non-expandable
+ * bit vector will cause a fatal error.
*
* dvmSetInitialBits sets all bits in [0..numBits-1]. Won't expand the vector.
*
* dvmIsBitSet returns "true" if the bit is set.
*/
int dvmAllocBit(BitVector* pBits);
-bool dvmSetBit(BitVector* pBits, int num);
-void dvmClearBit(BitVector* pBits, int num);
+void dvmSetBit(BitVector* pBits, unsigned int num);
+void dvmClearBit(BitVector* pBits, unsigned int num);
void dvmClearAllBits(BitVector* pBits);
-void dvmSetInitialBits(BitVector* pBits, int numBits);
-bool dvmIsBitSet(const BitVector* pBits, int num);
+void dvmSetInitialBits(BitVector* pBits, unsigned int numBits);
+bool dvmIsBitSet(const BitVector* pBits, unsigned int num);
/* count the number of bits that have been set */
int dvmCountSetBits(const BitVector* pBits);
-/* copy one vector to the other compatible one */
-bool dvmCopyBitVector(BitVector *dest, const BitVector *src);
+/* copy one vector to another of equal size */
+void dvmCopyBitVector(BitVector *dest, const BitVector *src);
/*
* Intersect two bit vectors and store the result to the dest vector.
@@ -81,6 +82,14 @@ bool dvmUnifyBitVectors(BitVector *dest, const BitVector *src1,
const BitVector *src2);
/*
+ * Merge the contents of "src" into "dst", checking to see if this causes
+ * any changes to occur.
+ *
+ * Returns "true" if the contents of the destination vector were modified.
+ */
+bool dvmCheckMergeBitVectors(BitVector* dst, const BitVector* src);
+
+/*
* Compare two bit vectors and return true if difference is seen.
*/
bool dvmCompareBitVectors(const BitVector *src1, const BitVector *src2);