Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(480)

Unified Diff: src/mark-compact.h

Issue 19182002: Added mark bit cell iterator. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/mark-compact.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) :
« no previous file with comments | « no previous file | src/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698