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

Unified Diff: src/heap/spaces.h

Issue 1518803005: Reland of "[cctest] Add tests for aborting compaction of pages" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Sweep NEVER_ALLOCATE_ON_PAGE pages. Memory gets dropped in the free list again Created 5 years 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.cc ('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 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;
}
« no previous file with comments | « src/heap/mark-compact.cc ('k') | src/heap/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698