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 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
540 if (!page->SweepingCompleted()) { | 540 if (!page->SweepingCompleted()) { |
541 // We were not able to sweep that page, i.e., a concurrent | 541 // We were not able to sweep that page, i.e., a concurrent |
542 // sweeper thread currently owns this page. Wait for the sweeper | 542 // sweeper thread currently owns this page. Wait for the sweeper |
543 // thread to be done with this page. | 543 // thread to be done with this page. |
544 page->WaitUntilSweepingCompleted(); | 544 page->WaitUntilSweepingCompleted(); |
545 } | 545 } |
546 } | 546 } |
547 } | 547 } |
548 | 548 |
549 | 549 |
550 void MarkCompactCollector::SweepAndRefill(CompactionSpace* space) { | |
551 if (!heap()->concurrent_sweeping_enabled() || !IsSweepingCompleted()) { | |
Hannes Payer (out of office)
2015/10/22 11:05:13
Let's factor this condition out into a separate fu
Michael Lippautz
2015/10/22 12:50:38
As discussed offline, the condition we want is act
| |
552 SweepInParallel(heap()->paged_space(space->identity()), 0); | |
553 } | |
554 space->RefillFreeList(); | |
555 } | |
556 | |
557 | |
550 void MarkCompactCollector::EnsureSweepingCompleted() { | 558 void MarkCompactCollector::EnsureSweepingCompleted() { |
551 DCHECK(sweeping_in_progress_ == true); | 559 DCHECK(sweeping_in_progress_ == true); |
552 | 560 |
553 // If sweeping is not completed or not running at all, we try to complete it | 561 // If sweeping is not completed or not running at all, we try to complete it |
554 // here. | 562 // here. |
555 if (!heap()->concurrent_sweeping_enabled() || !IsSweepingCompleted()) { | 563 if (!heap()->concurrent_sweeping_enabled() || !IsSweepingCompleted()) { |
556 SweepInParallel(heap()->paged_space(OLD_SPACE), 0); | 564 SweepInParallel(heap()->paged_space(OLD_SPACE), 0); |
557 SweepInParallel(heap()->paged_space(CODE_SPACE), 0); | 565 SweepInParallel(heap()->paged_space(CODE_SPACE), 0); |
558 SweepInParallel(heap()->paged_space(MAP_SPACE), 0); | 566 SweepInParallel(heap()->paged_space(MAP_SPACE), 0); |
559 } | 567 } |
(...skipping 4056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4616 MarkBit mark_bit = Marking::MarkBitFrom(host); | 4624 MarkBit mark_bit = Marking::MarkBitFrom(host); |
4617 if (Marking::IsBlack(mark_bit)) { | 4625 if (Marking::IsBlack(mark_bit)) { |
4618 RelocInfo rinfo(pc, RelocInfo::CODE_TARGET, 0, host); | 4626 RelocInfo rinfo(pc, RelocInfo::CODE_TARGET, 0, host); |
4619 RecordRelocSlot(&rinfo, target); | 4627 RecordRelocSlot(&rinfo, target); |
4620 } | 4628 } |
4621 } | 4629 } |
4622 } | 4630 } |
4623 | 4631 |
4624 } // namespace internal | 4632 } // namespace internal |
4625 } // namespace v8 | 4633 } // namespace v8 |
OLD | NEW |