| OLD | NEW |
| 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 3273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3284 live_bytes += page->LiveBytes(); | 3284 live_bytes += page->LiveBytes(); |
| 3285 job.AddPage(page, &abandoned_pages); | 3285 job.AddPage(page, &abandoned_pages); |
| 3286 } | 3286 } |
| 3287 | 3287 |
| 3288 const bool reduce_memory = heap()->ShouldReduceMemory(); | 3288 const bool reduce_memory = heap()->ShouldReduceMemory(); |
| 3289 const Address age_mark = heap()->new_space()->age_mark(); | 3289 const Address age_mark = heap()->new_space()->age_mark(); |
| 3290 for (Page* page : newspace_evacuation_candidates_) { | 3290 for (Page* page : newspace_evacuation_candidates_) { |
| 3291 live_bytes += page->LiveBytes(); | 3291 live_bytes += page->LiveBytes(); |
| 3292 if (!reduce_memory && !page->NeverEvacuate() && | 3292 if (!reduce_memory && !page->NeverEvacuate() && |
| 3293 (page->LiveBytes() > Evacuator::PageEvacuationThreshold()) && | 3293 (page->LiveBytes() > Evacuator::PageEvacuationThreshold()) && |
| 3294 !page->Contains(age_mark)) { | 3294 !page->Contains(age_mark) && |
| 3295 heap()->CanExpandOldGeneration(page->LiveBytes())) { |
| 3295 if (page->IsFlagSet(MemoryChunk::NEW_SPACE_BELOW_AGE_MARK)) { | 3296 if (page->IsFlagSet(MemoryChunk::NEW_SPACE_BELOW_AGE_MARK)) { |
| 3296 EvacuateNewSpacePageVisitor<NEW_TO_OLD>::Move(page); | 3297 EvacuateNewSpacePageVisitor<NEW_TO_OLD>::Move(page); |
| 3297 } else { | 3298 } else { |
| 3298 EvacuateNewSpacePageVisitor<NEW_TO_NEW>::Move(page); | 3299 EvacuateNewSpacePageVisitor<NEW_TO_NEW>::Move(page); |
| 3299 } | 3300 } |
| 3300 } | 3301 } |
| 3301 | 3302 |
| 3302 job.AddPage(page, &abandoned_pages); | 3303 job.AddPage(page, &abandoned_pages); |
| 3303 } | 3304 } |
| 3304 DCHECK_GE(job.NumberOfPages(), 1); | 3305 DCHECK_GE(job.NumberOfPages(), 1); |
| (...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4064 // The target is always in old space, we don't have to record the slot in | 4065 // The target is always in old space, we don't have to record the slot in |
| 4065 // the old-to-new remembered set. | 4066 // the old-to-new remembered set. |
| 4066 DCHECK(!heap()->InNewSpace(target)); | 4067 DCHECK(!heap()->InNewSpace(target)); |
| 4067 RecordRelocSlot(host, &rinfo, target); | 4068 RecordRelocSlot(host, &rinfo, target); |
| 4068 } | 4069 } |
| 4069 } | 4070 } |
| 4070 } | 4071 } |
| 4071 | 4072 |
| 4072 } // namespace internal | 4073 } // namespace internal |
| 4073 } // namespace v8 | 4074 } // namespace v8 |
| OLD | NEW |