diff options
| author | Ben Cheng <bccheng@android.com> | 2010-10-28 11:13:58 -0700 |
|---|---|---|
| committer | Ben Cheng <bccheng@android.com> | 2010-12-13 16:49:33 -0800 |
| commit | 00603079b8723b32c955513eae63a8f97898074d (patch) | |
| tree | 3f7b93b0bdb9ac2d64896a9d0bbf5e5c7153cc71 /vm/BitVector.h | |
| parent | 823a87840e570ad06c4426537477a21243474a1c (diff) | |
| download | android_dalvik-00603079b8723b32c955513eae63a8f97898074d.tar.gz android_dalvik-00603079b8723b32c955513eae63a8f97898074d.tar.bz2 android_dalvik-00603079b8723b32c955513eae63a8f97898074d.zip | |
Implement method parser and SSA transformation.
Change-Id: If3fb3a36f33aaee8e5fdded4e9fa607be54f0bfb
Diffstat (limited to 'vm/BitVector.h')
| -rw-r--r-- | vm/BitVector.h | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/vm/BitVector.h b/vm/BitVector.h index 94abe7b85..3c926b14e 100644 --- a/vm/BitVector.h +++ b/vm/BitVector.h @@ -32,6 +32,13 @@ typedef struct BitVector { u4* storage; } BitVector; +/* Handy iterator to walk through the bit positions set to 1 */ +typedef struct BitVectorIterator { + BitVector *pBits; + u4 idx; + u4 bitSize; +} BitVectorIterator; + /* allocate a bit vector with enough space to hold "startBits" bits */ BitVector* dvmAllocBitVector(int startBits, bool expandable); void dvmFreeBitVector(BitVector* pBits); @@ -44,12 +51,15 @@ void dvmFreeBitVector(BitVector* pBits); * dvmSetBit sets the specified bit, expanding the vector if necessary * (and possible). * + * 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 dvmClearAllBits(BitVector* pBits); +void dvmSetInitialBits(BitVector* pBits, int numBits); bool dvmIsBitSet(const BitVector* pBits, int num); /* count the number of bits that have been set */ @@ -59,11 +69,26 @@ int dvmCountSetBits(const BitVector* pBits); bool dvmCopyBitVector(BitVector *dest, const BitVector *src); /* - * Intersect two bit vectores and merge the result on top of the pre-existing - * value in the dest vector. + * Intersect two bit vectors and store the result to the dest vector. */ bool dvmIntersectBitVectors(BitVector *dest, const BitVector *src1, const BitVector *src2); +/* + * Unify two bit vectors and store the result to the dest vector. + */ +bool dvmUnifyBitVectors(BitVector *dest, const BitVector *src1, + const BitVector *src2); + +/* + * Compare two bit vectors and return true if difference is seen. + */ +bool dvmCompareBitVectors(const BitVector *src1, const BitVector *src2); + +/* Initialize the iterator structure */ +void dvmBitVectorIteratorInit(BitVector* pBits, BitVectorIterator* iterator); + +/* Return the next position set to 1. -1 means end-of-vector reached */ +int dvmBitVectorIteratorNext(BitVectorIterator* iterator); #endif /*_DALVIK_BITVECTOR*/ |
