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

Unified Diff: src/heap/spaces.h

Issue 1012023002: Merge old data and pointer space. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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/mark-compact-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 2eae02953cbf2e41f0015bb766f57a814e0cba33..70346bb66798735bb9e2ff5aee822607f6c6fa4d 100644
--- a/src/heap/spaces.h
+++ b/src/heap/spaces.h
@@ -43,11 +43,11 @@ class Isolate;
//
// During scavenges and mark-sweep collections we sometimes (after a store
// buffer overflow) iterate intergenerational pointers without decoding heap
-// object maps so if the page belongs to old pointer space or large object
-// space it is essential to guarantee that the page does not contain any
+// object maps so if the page belongs to old space or large object space
+// it is essential to guarantee that the page does not contain any
// garbage pointers to new space: every pointer aligned word which satisfies
// the Heap::InNewSpace() predicate must be a pointer to a live heap object in
-// new space. Thus objects in old pointer and large object spaces should have a
+// new space. Thus objects in old space and large object spaces should have a
// special layout (e.g. no bare integer fields). This requirement does not
// apply to map space which is iterated in a special fashion. However we still
// require pointer fields of dead maps to be cleaned.
@@ -102,8 +102,7 @@ class MarkBit {
public:
typedef uint32_t CellType;
- inline MarkBit(CellType* cell, CellType mask, bool data_only)
- : cell_(cell), mask_(mask), data_only_(data_only) {}
+ inline MarkBit(CellType* cell, CellType mask) : cell_(cell), mask_(mask) {}
inline CellType* cell() { return cell_; }
inline CellType mask() { return mask_; }
@@ -118,25 +117,19 @@ class MarkBit {
inline bool Get() { return (*cell_ & mask_) != 0; }
inline void Clear() { *cell_ &= ~mask_; }
- inline bool data_only() { return data_only_; }
inline MarkBit Next() {
CellType new_mask = mask_ << 1;
if (new_mask == 0) {
- return MarkBit(cell_ + 1, 1, data_only_);
+ return MarkBit(cell_ + 1, 1);
} else {
- return MarkBit(cell_, new_mask, data_only_);
+ return MarkBit(cell_, new_mask);
}
}
private:
CellType* cell_;
CellType mask_;
- // This boolean indicates that the object is in a data-only space with no
- // pointers. This enables some optimizations when marking.
- // It is expected that this field is inlined and turned into control flow
- // at the place where the MarkBit object is created.
- bool data_only_;
};
@@ -187,10 +180,10 @@ class Bitmap {
return reinterpret_cast<Bitmap*>(addr);
}
- inline MarkBit MarkBitFromIndex(uint32_t index, bool data_only = false) {
+ inline MarkBit MarkBitFromIndex(uint32_t index) {
MarkBit::CellType mask = 1 << (index & kBitIndexMask);
MarkBit::CellType* cell = this->cells() + (index >> kBitsPerCellLog2);
- return MarkBit(cell, mask, data_only);
+ return MarkBit(cell, mask);
}
static inline void Clear(MemoryChunk* chunk);
@@ -370,7 +363,6 @@ class MemoryChunk {
IN_FROM_SPACE, // Mutually exclusive with IN_TO_SPACE.
IN_TO_SPACE, // All pages in new space has one of these two set.
NEW_SPACE_BELOW_AGE_MARK,
- CONTAINS_ONLY_DATA,
EVACUATION_CANDIDATE,
RESCAN_ON_EVACUATION,
NEVER_EVACUATE, // May contain immortal immutables.
@@ -565,8 +557,6 @@ class MemoryChunk {
return IsFlagSet(IS_EXECUTABLE) ? EXECUTABLE : NOT_EXECUTABLE;
}
- bool ContainsOnlyData() { return IsFlagSet(CONTAINS_ONLY_DATA); }
-
bool InNewSpace() {
return (flags_ & ((1 << IN_FROM_SPACE) | (1 << IN_TO_SPACE))) != 0;
}
@@ -2596,7 +2586,7 @@ class NewSpace : public Space {
// -----------------------------------------------------------------------------
-// Old object space (excluding map objects)
+// Old object space (includes the old space of objects and code space)
class OldSpace : public PagedSpace {
public:
@@ -2830,7 +2820,7 @@ class PointerChunkIterator BASE_EMBEDDED {
// Return NULL when the iterator is done.
MemoryChunk* next() {
switch (state_) {
- case kOldPointerState: {
+ case kOldSpaceState: {
if (old_pointer_iterator_.has_next()) {
return old_pointer_iterator_.next();
}
@@ -2869,7 +2859,7 @@ class PointerChunkIterator BASE_EMBEDDED {
private:
- enum State { kOldPointerState, kMapState, kLargeObjectState, kFinishedState };
+ enum State { kOldSpaceState, kMapState, kLargeObjectState, kFinishedState };
State state_;
PageIterator old_pointer_iterator_;
PageIterator map_iterator_;
« no previous file with comments | « src/heap/mark-compact-inl.h ('k') | src/heap/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698