Chromium Code Reviews| Index: src/mark-compact.h |
| diff --git a/src/mark-compact.h b/src/mark-compact.h |
| index b3e20f72b60987f927f7e480ad3e5cbc01e642fe..dfa84181d70e7ccbb2da8f8f1d72458eb6d981fe 100644 |
| --- a/src/mark-compact.h |
| +++ b/src/mark-compact.h |
| @@ -952,6 +952,55 @@ class MarkCompactCollector { |
| }; |
| +class MarkBitCellIterator BASE_EMBEDDED { |
| + public: |
| + explicit MarkBitCellIterator(MemoryChunk* chunk) |
| + : chunk_(chunk) { |
| + last_cell_index_ = |
| + Bitmap::IndexToCell( |
| + Bitmap::CellAlignIndex( |
| + chunk->AddressToMarkbitIndex(chunk->area_end()))); |
| + cell_base_ = chunk->area_start(); |
| + cell_index_ = Bitmap::IndexToCell( |
| + Bitmap::CellAlignIndex( |
|
titzer
2013/07/15 13:42:06
Indentation
Hannes Payer (out of office)
2013/07/16 12:13:00
Done.
|
| + chunk->AddressToMarkbitIndex(cell_base_))); |
| + cells_ = chunk->markbits()->cells(); |
| + } |
| + |
| + inline bool Done() { return cell_index_ == last_cell_index_; } |
| + |
| + inline bool HasNext() { return cell_index_ < last_cell_index_ - 1; } |
| + |
| + inline MarkBit::CellType* CurrentCell() { |
| + ASSERT(cell_index_ == |
|
titzer
2013/07/15 13:42:06
Can
fit
on
fewer
lines
Hannes Payer (out of office)
2013/07/16 12:13:00
Done.
|
| + Bitmap::IndexToCell( |
| + Bitmap::CellAlignIndex( |
| + chunk_->AddressToMarkbitIndex(cell_base_)))); |
| + return &cells_[cell_index_]; |
| + } |
| + |
| + inline Address CurrentCellBase() { |
| + ASSERT(cell_index_ == |
| + Bitmap::IndexToCell( |
| + Bitmap::CellAlignIndex( |
| + chunk_->AddressToMarkbitIndex(cell_base_)))); |
| + return cell_base_; |
| + } |
| + |
| + inline void Advance() { |
| + cell_index_++; |
| + cell_base_ += 32 * kPointerSize; |
| + } |
| + |
| + private: |
| + MemoryChunk* chunk_; |
| + MarkBit::CellType* cells_; |
| + unsigned int last_cell_index_; |
| + unsigned int cell_index_; |
| + Address cell_base_; |
| +}; |
| + |
| + |
| class SequentialSweepingScope BASE_EMBEDDED { |
| public: |
| explicit SequentialSweepingScope(MarkCompactCollector *collector) : |