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

Unified Diff: src/heap/spaces.h

Issue 1040443002: MarkBit cleanup: They have to be accessed through Marking accessors. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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 | « src/heap/objects-visiting-inl.h ('k') | src/heap/spaces.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/spaces.h
diff --git a/src/heap/spaces.h b/src/heap/spaces.h
index fce96772139fde9d79623e20f7c0a2a360e20f07..cd5e9f2c7be4d8b44a6c6e921fd6f76e0aaee442 100644
--- a/src/heap/spaces.h
+++ b/src/heap/spaces.h
@@ -104,19 +104,15 @@ class MarkBit {
inline MarkBit(CellType* cell, CellType mask) : cell_(cell), mask_(mask) {}
- inline CellType* cell() { return cell_; }
- inline CellType mask() { return mask_; }
-
#ifdef DEBUG
bool operator==(const MarkBit& other) {
return cell_ == other.cell_ && mask_ == other.mask_;
}
#endif
- inline void Set() { *cell_ |= mask_; }
- inline bool Get() { return (*cell_ & mask_) != 0; }
- inline void Clear() { *cell_ &= ~mask_; }
-
+ private:
+ inline CellType* cell() { return cell_; }
+ inline CellType mask() { return mask_; }
inline MarkBit Next() {
CellType new_mask = mask_ << 1;
@@ -127,9 +123,14 @@ class MarkBit {
}
}
- private:
+ inline void Set() { *cell_ |= mask_; }
+ inline bool Get() { return (*cell_ & mask_) != 0; }
+ inline void Clear() { *cell_ &= ~mask_; }
+
CellType* cell_;
CellType mask_;
+
+ friend class Marking;
};
« no previous file with comments | « src/heap/objects-visiting-inl.h ('k') | src/heap/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698