Chromium Code Reviews| 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 3660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3671 int MarkCompactCollector::SweepInParallel(PagedSpace* space, | 3671 int MarkCompactCollector::SweepInParallel(PagedSpace* space, |
| 3672 int required_freed_bytes) { | 3672 int required_freed_bytes) { |
| 3673 int max_freed = 0; | 3673 int max_freed = 0; |
| 3674 int max_freed_overall = 0; | 3674 int max_freed_overall = 0; |
| 3675 PageIterator it(space); | 3675 PageIterator it(space); |
| 3676 while (it.has_next()) { | 3676 while (it.has_next()) { |
| 3677 Page* p = it.next(); | 3677 Page* p = it.next(); |
| 3678 max_freed = SweepInParallel(p, space); | 3678 max_freed = SweepInParallel(p, space); |
| 3679 DCHECK(max_freed >= 0); | 3679 DCHECK(max_freed >= 0); |
| 3680 if (required_freed_bytes > 0 && max_freed >= required_freed_bytes) { | 3680 if (required_freed_bytes > 0 && max_freed >= required_freed_bytes) { |
| 3681 return max_freed; | 3681 if (!p->IsFlagSet(Page::NEVER_ALLOCATE_ON_PAGE)) { |
|
Hannes Payer (out of office)
2015/12/11 16:10:37
I think I would prefer dropping Page::NEVER_ALLOCA
Michael Lippautz
2015/12/16 09:24:55
They are already filtered out during free list ope
| |
| 3682 return max_freed; | |
| 3683 } | |
| 3682 } | 3684 } |
| 3683 max_freed_overall = Max(max_freed, max_freed_overall); | 3685 max_freed_overall = Max(max_freed, max_freed_overall); |
| 3684 if (p == space->end_of_unswept_pages()) break; | 3686 if (p == space->end_of_unswept_pages()) break; |
| 3685 } | 3687 } |
| 3686 return max_freed_overall; | 3688 return max_freed_overall; |
| 3687 } | 3689 } |
| 3688 | 3690 |
| 3689 | 3691 |
| 3690 int MarkCompactCollector::SweepInParallel(Page* page, PagedSpace* space) { | 3692 int MarkCompactCollector::SweepInParallel(Page* page, PagedSpace* space) { |
| 3691 int max_freed = 0; | 3693 int max_freed = 0; |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3961 MarkBit mark_bit = Marking::MarkBitFrom(host); | 3963 MarkBit mark_bit = Marking::MarkBitFrom(host); |
| 3962 if (Marking::IsBlack(mark_bit)) { | 3964 if (Marking::IsBlack(mark_bit)) { |
| 3963 RelocInfo rinfo(isolate(), pc, RelocInfo::CODE_TARGET, 0, host); | 3965 RelocInfo rinfo(isolate(), pc, RelocInfo::CODE_TARGET, 0, host); |
| 3964 RecordRelocSlot(&rinfo, target); | 3966 RecordRelocSlot(&rinfo, target); |
| 3965 } | 3967 } |
| 3966 } | 3968 } |
| 3967 } | 3969 } |
| 3968 | 3970 |
| 3969 } // namespace internal | 3971 } // namespace internal |
| 3970 } // namespace v8 | 3972 } // namespace v8 |
| OLD | NEW |