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

Unified Diff: src/heap/spaces.cc

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: Removed dead code 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..b414a0657de58fd4c1f0cb2e3daf605aa8b0d55e 100644
--- a/src/heap/spaces.cc
+++ b/src/heap/spaces.cc
@@ -2291,7 +2291,7 @@ FreeSpace* FreeListCategory::PickNodeFromList(int* node_size) {
if (node == nullptr) return nullptr;
Page* page = Page::FromAddress(node->address());
- while ((node != nullptr) && page->IsEvacuationCandidate()) {
+ while ((node != nullptr) && !page->CanAllocateOnPage()) {
available_ -= node->size();
page->add_available_in_free_list(type_, -(node->Size()));
node = node->next();
@@ -2333,7 +2333,7 @@ FreeSpace* FreeListCategory::SearchForNodeInList(int size_in_bytes,
int size = cur_node->size();
Page* page_for_node = Page::FromAddress(cur_node->address());
- if ((size >= size_in_bytes) || page_for_node->IsEvacuationCandidate()) {
+ if ((size >= size_in_bytes) || !page_for_node->CanAllocateOnPage()) {
// The node is either large enough or contained in an evacuation
// candidate. In both cases we need to unlink it from the list.
available_ -= size;
@@ -2347,7 +2347,7 @@ FreeSpace* FreeListCategory::SearchForNodeInList(int size_in_bytes,
prev_non_evac_node->set_next(cur_node->next());
}
// For evacuation candidates we continue.
- if (page_for_node->IsEvacuationCandidate()) {
+ if (!page_for_node->CanAllocateOnPage()) {
page_for_node->add_available_in_free_list(type_, -size);
continue;
}
@@ -2758,8 +2758,7 @@ void PagedSpace::RepairFreeListsAfterDeserialization() {
void PagedSpace::EvictEvacuationCandidatesFromLinearAllocationArea() {
if (allocation_info_.top() >= allocation_info_.limit()) return;
- if (Page::FromAllocationTop(allocation_info_.top())
- ->IsEvacuationCandidate()) {
+ if (!Page::FromAllocationTop(allocation_info_.top())->CanAllocateOnPage()) {
// Create filler object to keep page iterable if it was iterable.
int remaining =
static_cast<int>(allocation_info_.limit() - allocation_info_.top());
« src/heap/mark-compact.cc ('K') | « src/heap/spaces.h ('k') | test/cctest/cctest.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698