Index: src/heap/spaces.h |
diff --git a/src/heap/spaces.h b/src/heap/spaces.h |
index efb784ca69cc977259d82a3b74977847270cafc5..3a6bd307af5bf85e032f29e1aec10001472e81d9 100644 |
--- a/src/heap/spaces.h |
+++ b/src/heap/spaces.h |
@@ -373,6 +373,7 @@ class MemoryChunk { |
CONTAINS_ONLY_DATA, |
EVACUATION_CANDIDATE, |
RESCAN_ON_EVACUATION, |
+ NEVER_EVACUATE, // May contain immortal immutables. |
// WAS_SWEPT indicates that marking bits have been cleared by the sweeper, |
// otherwise marking bits are still intact. |
@@ -604,7 +605,14 @@ class MemoryChunk { |
static const int kFlagsOffset = kPointerSize; |
- bool IsEvacuationCandidate() { return IsFlagSet(EVACUATION_CANDIDATE); } |
+ bool NeverEvacuate() { return IsFlagSet(NEVER_EVACUATE); } |
+ |
+ void MarkNeverEvacuate() { SetFlag(NEVER_EVACUATE); } |
+ |
+ bool IsEvacuationCandidate() { |
+ DCHECK(!(IsFlagSet(NEVER_EVACUATE) && IsFlagSet(EVACUATION_CANDIDATE))); |
+ return IsFlagSet(EVACUATION_CANDIDATE); |
+ } |
bool ShouldSkipEvacuationSlotRecording() { |
return (flags_ & kSkipEvacuationSlotsRecordingMask) != 0; |
@@ -619,6 +627,7 @@ class MemoryChunk { |
inline SlotsBuffer** slots_buffer_address() { return &slots_buffer_; } |
void MarkEvacuationCandidate() { |
+ DCHECK(!IsFlagSet(NEVER_EVACUATE)); |
DCHECK(slots_buffer_ == NULL); |
SetFlag(EVACUATION_CANDIDATE); |
} |