Index: src/heap/spaces.h |
diff --git a/src/heap/spaces.h b/src/heap/spaces.h |
index 40604d424cc425b43871446b53d41599fd395a6c..7a9b6915e7654211b8f4302b8165014930eed230 100644 |
--- a/src/heap/spaces.h |
+++ b/src/heap/spaces.h |
@@ -323,6 +323,9 @@ class MemoryChunk { |
// candidates selection cycle. |
FORCE_EVACUATION_CANDIDATE_FOR_TESTING, |
+ // This flag is inteded to be used for testing. |
+ NEVER_ALLOCATE_ON_PAGE, |
+ |
// The memory chunk is already logically freed, however the actual freeing |
// still has to be performed. |
PRE_FREED, |
@@ -682,6 +685,10 @@ class MemoryChunk { |
return IsFlagSet(EVACUATION_CANDIDATE); |
} |
+ bool CanAllocate() { |
+ return !IsEvacuationCandidate() && !IsFlagSet(NEVER_ALLOCATE_ON_PAGE); |
+ } |
+ |
bool ShouldSkipEvacuationSlotRecording() { |
return (flags_ & kSkipEvacuationSlotsRecordingMask) != 0; |
} |