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

Unified Diff: src/heap/spaces.cc

Issue 1511933002: [cctest] Add tests for aborting compaction of pages (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: More tests 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
Index: src/heap/spaces.cc
diff --git a/src/heap/spaces.cc b/src/heap/spaces.cc
index 988da6bc99e6440f2b6e873aee94887c70a38620..8fe4a0ce5ea4edab06e1faf8e02172235c190942 100644
--- a/src/heap/spaces.cc
+++ b/src/heap/spaces.cc
@@ -954,7 +954,8 @@ PagedSpace::PagedSpace(Heap* heap, AllocationSpace space,
Executability executable)
: Space(heap, space, executable),
free_list_(this),
- end_of_unswept_pages_(NULL) {
+ end_of_unswept_pages_(NULL),
+ force_oom_(false) {
area_size_ = MemoryAllocator::PageAreaSize(space);
accounting_stats_.Clear();
@@ -1077,6 +1078,11 @@ void CompactionSpace::RefillFreeList() {
}
+bool CompactionSpace::ShouldForceOOM() {
+ return heap()->paged_space(identity())->ShouldForceOOM();
+}
+
+
void PagedSpace::MoveOverFreeMemory(PagedSpace* other) {
DCHECK(identity() == other->identity());
// Destroy the linear allocation space of {other}. This is needed to
@@ -1168,6 +1174,8 @@ Object* PagedSpace::FindObject(Address addr) {
bool PagedSpace::CanExpand(size_t size) {
+ if (ShouldForceOOM()) return false;
+
DCHECK(heap()->mark_compact_collector()->is_compacting() ||
Capacity() <= heap()->MaxOldGenerationSize());
« no previous file with comments | « src/heap/spaces.h ('k') | test/cctest/cctest.gyp » ('j') | test/cctest/heap/test-compaction.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698