Index: src/mark-compact.h |
diff --git a/src/mark-compact.h b/src/mark-compact.h |
index b3e20f72b60987f927f7e480ad3e5cbc01e642fe..a50b9e5add7cabbad65ddd30d94ca31a3572fdc4 100644 |
--- a/src/mark-compact.h |
+++ b/src/mark-compact.h |
@@ -952,6 +952,50 @@ 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( |
+ 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_ == 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) : |