diff -r f7e573226c2b -r 40746ab0a30b jitcraft/Heap.cpp --- a/jitcraft/Heap.cpp Sat Jul 14 18:43:34 2012 -0700 +++ b/jitcraft/Heap.cpp Sat Jul 14 21:01:52 2012 -0700 @@ -312,19 +312,16 @@ while (bits) { uint32 bit = FindRightmostBit(bits); Address object = HeapChunk::FromMarkBit(chunk, markbits, bit); + + assert(object >= freeStart); if (freeStart != object) space->markRegionFree(freeStart, object - freeStart); + Object *obj = reinterpret_cast(object); freeStart = object + SizeOfObject(obj, obj->map()); + // Since black is 10, we never need to clear the next bit. bits &= ~(1 << bit); - if (bits == HeapChunk::kMarkBitsPerWord - 1) { - // This bit is the last bit on this word, so bump up to the - // next word and exclude the first bit. - markbits++; - assert(markbits < markbitsEnd); - bits = *markbits & ~(1 << 0); - } } markbits++; bits = *markbits;