Index: src/spaces-inl.h |
=================================================================== |
--- src/spaces-inl.h (revision 11322) |
+++ src/spaces-inl.h (working copy) |
@@ -39,6 +39,15 @@ |
// ----------------------------------------------------------------------------- |
// Bitmap |
+int Bitmap::CellsCount() { |
+ MemoryChunk* chunk = MemoryChunk::FromAddress(address()); |
+ ASSERT(chunk->is_valid()); |
+ size_t rLength = (chunk->area_start() - address()) << kBitsPerByteLog2; |
+ if (rLength > kLength) rLength = kLength; |
+ rLength &= ~(kBitsPerCell - 1); |
+ return CellsForLength(rLength); |
+} |
+ |
void Bitmap::Clear(MemoryChunk* chunk) { |
Bitmap* bitmap = chunk->markbits(); |
for (int i = 0; i < bitmap->CellsCount(); i++) bitmap->cells()[i] = 0; |