| 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 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 631 DCHECK(space->identity() == OLD_SPACE || space->identity() == CODE_SPACE); | 631 DCHECK(space->identity() == OLD_SPACE || space->identity() == CODE_SPACE); |
| 632 | 632 |
| 633 int number_of_pages = space->CountTotalPages(); | 633 int number_of_pages = space->CountTotalPages(); |
| 634 size_t area_size = space->AreaSize(); | 634 size_t area_size = space->AreaSize(); |
| 635 | 635 |
| 636 // Pairs of (live_bytes_in_page, page). | 636 // Pairs of (live_bytes_in_page, page). |
| 637 typedef std::pair<size_t, Page*> LiveBytesPagePair; | 637 typedef std::pair<size_t, Page*> LiveBytesPagePair; |
| 638 std::vector<LiveBytesPagePair> pages; | 638 std::vector<LiveBytesPagePair> pages; |
| 639 pages.reserve(number_of_pages); | 639 pages.reserve(number_of_pages); |
| 640 | 640 |
| 641 DCHECK(!sweeping_in_progress()); |
| 642 DCHECK(!FLAG_concurrent_sweeping || |
| 643 sweeper().IsSweepingCompleted(space->identity())); |
| 641 for (Page* p : *space) { | 644 for (Page* p : *space) { |
| 642 if (p->NeverEvacuate()) continue; | 645 if (p->NeverEvacuate()) continue; |
| 643 // Invariant: Evacuation candidates are just created when marking is | 646 // Invariant: Evacuation candidates are just created when marking is |
| 644 // started. This means that sweeping has finished. Furthermore, at the end | 647 // started. This means that sweeping has finished. Furthermore, at the end |
| 645 // of a GC all evacuation candidates are cleared and their slot buffers are | 648 // of a GC all evacuation candidates are cleared and their slot buffers are |
| 646 // released. | 649 // released. |
| 647 CHECK(!p->IsEvacuationCandidate()); | 650 CHECK(!p->IsEvacuationCandidate()); |
| 648 CHECK_NULL(p->old_to_old_slots()); | 651 CHECK_NULL(p->old_to_old_slots()); |
| 649 CHECK_NULL(p->typed_old_to_old_slots()); | 652 CHECK_NULL(p->typed_old_to_old_slots()); |
| 650 CHECK(p->SweepingDone()); | 653 CHECK(p->SweepingDone()); |
| (...skipping 3261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3912 // The target is always in old space, we don't have to record the slot in | 3915 // The target is always in old space, we don't have to record the slot in |
| 3913 // the old-to-new remembered set. | 3916 // the old-to-new remembered set. |
| 3914 DCHECK(!heap()->InNewSpace(target)); | 3917 DCHECK(!heap()->InNewSpace(target)); |
| 3915 RecordRelocSlot(host, &rinfo, target); | 3918 RecordRelocSlot(host, &rinfo, target); |
| 3916 } | 3919 } |
| 3917 } | 3920 } |
| 3918 } | 3921 } |
| 3919 | 3922 |
| 3920 } // namespace internal | 3923 } // namespace internal |
| 3921 } // namespace v8 | 3924 } // namespace v8 |
| OLD | NEW |