diff options
Diffstat (limited to 'vm/compiler')
-rw-r--r-- | vm/compiler/CompilerUtility.h | 6 | ||||
-rw-r--r-- | vm/compiler/MethodSSATransformation.c | 6 | ||||
-rw-r--r-- | vm/compiler/Utility.c | 17 |
3 files changed, 13 insertions, 16 deletions
diff --git a/vm/compiler/CompilerUtility.h b/vm/compiler/CompilerUtility.h index 3e65a2eb0..5dd1faf8d 100644 --- a/vm/compiler/CompilerUtility.h +++ b/vm/compiler/CompilerUtility.h @@ -63,9 +63,9 @@ void dvmGrowableListIteratorInit(GrowableList *gList, intptr_t dvmGrowableListIteratorNext(GrowableListIterator *iterator); intptr_t dvmGrowableListGetElement(const GrowableList *gList, size_t idx); -BitVector* dvmCompilerAllocBitVector(int startBits, bool expandable); -bool dvmCompilerSetBit(BitVector* pBits, int num); -bool dvmCompilerClearBit(BitVector* pBits, int num); +BitVector* dvmCompilerAllocBitVector(unsigned int startBits, bool expandable); +bool dvmCompilerSetBit(BitVector* pBits, unsigned int num); +bool dvmCompilerClearBit(BitVector* pBits, unsigned int num); void dvmCompilerMarkAllBits(BitVector *pBits, bool set); void dvmDebugBitVector(char *msg, const BitVector *bv, int length); void dvmDumpLIRInsn(struct LIR *lir, unsigned char *baseAddr); diff --git a/vm/compiler/MethodSSATransformation.c b/vm/compiler/MethodSSATransformation.c index 48d5b5ce9..60eea334a 100644 --- a/vm/compiler/MethodSSATransformation.c +++ b/vm/compiler/MethodSSATransformation.c @@ -346,9 +346,9 @@ static void computeSuccLiveIn(BitVector *dest, dvmAbort(); } - int i; - for (i = 0; i < dest->storageSize; i++) { - dest->storage[i] |= src1->storage[i] & ~src2->storage[i]; + unsigned int idx; + for (idx = 0; idx < dest->storageSize; idx++) { + dest->storage[idx] |= src1->storage[idx] & ~src2->storage[idx]; } } diff --git a/vm/compiler/Utility.c b/vm/compiler/Utility.c index fe258331f..7be57efa2 100644 --- a/vm/compiler/Utility.c +++ b/vm/compiler/Utility.c @@ -269,13 +269,12 @@ void dvmCompilerDumpStats(void) * NOTE: this is the sister implementation of dvmAllocBitVector. In this version * memory is allocated from the compiler arena. */ -BitVector* dvmCompilerAllocBitVector(int startBits, bool expandable) +BitVector* dvmCompilerAllocBitVector(unsigned int startBits, bool expandable) { BitVector* bv; - int count; + unsigned int count; assert(sizeof(bv->storage[0]) == 4); /* assuming 32-bit units */ - assert(startBits >= 0); bv = (BitVector*) dvmCompilerNew(sizeof(BitVector), false); @@ -296,15 +295,14 @@ BitVector* dvmCompilerAllocBitVector(int startBits, bool expandable) * NOTE: this is the sister implementation of dvmSetBit. In this version * memory is allocated from the compiler arena. */ -bool dvmCompilerSetBit(BitVector *pBits, int num) +bool dvmCompilerSetBit(BitVector *pBits, unsigned int num) { - assert(num >= 0); - if (num >= pBits->storageSize * (int)sizeof(u4) * 8) { + if (num >= pBits->storageSize * sizeof(u4) * 8) { if (!pBits->expandable) dvmAbort(); /* Round up to word boundaries for "num+1" bits */ - int newSize = (num + 1 + 31) >> 5; + unsigned int newSize = (num + 1 + 31) >> 5; assert(newSize > pBits->storageSize); u4 *newStorage = (u4*)dvmCompilerNew(newSize * sizeof(u4), false); memcpy(newStorage, pBits->storage, pBits->storageSize * sizeof(u4)); @@ -327,10 +325,9 @@ bool dvmCompilerSetBit(BitVector *pBits, int num) * NOTE: this is the sister implementation of dvmClearBit. In this version * memory is allocated from the compiler arena. */ -bool dvmCompilerClearBit(BitVector *pBits, int num) +bool dvmCompilerClearBit(BitVector *pBits, unsigned int num) { - assert(num >= 0); - if (num >= pBits->storageSize * (int)sizeof(u4) * 8) { + if (num >= pBits->storageSize * sizeof(u4) * 8) { LOGE("Trying to clear a bit that is not set in the vector yet!"); dvmAbort(); } |