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

Side by Side Diff: src/heap/mark-compact.cc

Issue 2374023002: [heap] Don't move pages in reduce memory mode (Closed)
Patch Set: Created 4 years, 2 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/heap/mark-compact.h" 5 #include "src/heap/mark-compact.h"
6 6
7 #include "src/base/atomicops.h" 7 #include "src/base/atomicops.h"
8 #include "src/base/bits.h" 8 #include "src/base/bits.h"
9 #include "src/base/sys-info.h" 9 #include "src/base/sys-info.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 3278 matching lines...) Expand 10 before | Expand all | Expand 10 after
3289 heap_, heap_->isolate()->cancelable_task_manager(), 3289 heap_, heap_->isolate()->cancelable_task_manager(),
3290 &page_parallel_job_semaphore_); 3290 &page_parallel_job_semaphore_);
3291 3291
3292 int abandoned_pages = 0; 3292 int abandoned_pages = 0;
3293 intptr_t live_bytes = 0; 3293 intptr_t live_bytes = 0;
3294 for (Page* page : evacuation_candidates_) { 3294 for (Page* page : evacuation_candidates_) {
3295 live_bytes += page->LiveBytes(); 3295 live_bytes += page->LiveBytes();
3296 job.AddPage(page, &abandoned_pages); 3296 job.AddPage(page, &abandoned_pages);
3297 } 3297 }
3298 3298
3299 const bool reduce_memory = heap()->ShouldReduceMemory();
3299 for (Page* page : newspace_evacuation_candidates_) { 3300 for (Page* page : newspace_evacuation_candidates_) {
3300 live_bytes += page->LiveBytes(); 3301 live_bytes += page->LiveBytes();
3301 if (!page->NeverEvacuate() && 3302 if (!reduce_memory && !page->NeverEvacuate() &&
3302 (page->LiveBytes() > Evacuator::PageEvacuationThreshold())) { 3303 (page->LiveBytes() > Evacuator::PageEvacuationThreshold())) {
3303 if (page->InIntermediateGeneration()) { 3304 if (page->InIntermediateGeneration()) {
3304 EvacuateNewSpacePageVisitor::MoveToOldSpace(page, heap()->old_space()); 3305 EvacuateNewSpacePageVisitor::MoveToOldSpace(page, heap()->old_space());
3305 } else { 3306 } else {
3306 EvacuateNewSpacePageVisitor::MoveToToSpace(page); 3307 EvacuateNewSpacePageVisitor::MoveToToSpace(page);
3307 } 3308 }
3308 } 3309 }
3309 3310
3310 job.AddPage(page, &abandoned_pages); 3311 job.AddPage(page, &abandoned_pages);
3311 } 3312 }
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after
4026 // The target is always in old space, we don't have to record the slot in 4027 // The target is always in old space, we don't have to record the slot in
4027 // the old-to-new remembered set. 4028 // the old-to-new remembered set.
4028 DCHECK(!heap()->InNewSpace(target)); 4029 DCHECK(!heap()->InNewSpace(target));
4029 RecordRelocSlot(host, &rinfo, target); 4030 RecordRelocSlot(host, &rinfo, target);
4030 } 4031 }
4031 } 4032 }
4032 } 4033 }
4033 4034
4034 } // namespace internal 4035 } // namespace internal
4035 } // namespace v8 4036 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698