| 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 3756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3767 // Clear sweeping flags indicating that marking bits are still intact. | 3767 // Clear sweeping flags indicating that marking bits are still intact. |
| 3768 p->ClearWasSwept(); | 3768 p->ClearWasSwept(); |
| 3769 | 3769 |
| 3770 if (p->IsFlagSet(Page::RESCAN_ON_EVACUATION) || | 3770 if (p->IsFlagSet(Page::RESCAN_ON_EVACUATION) || |
| 3771 p->IsEvacuationCandidate()) { | 3771 p->IsEvacuationCandidate()) { |
| 3772 // Will be processed in EvacuateNewSpaceAndCandidates. | 3772 // Will be processed in EvacuateNewSpaceAndCandidates. |
| 3773 DCHECK(evacuation_candidates_.length() > 0); | 3773 DCHECK(evacuation_candidates_.length() > 0); |
| 3774 continue; | 3774 continue; |
| 3775 } | 3775 } |
| 3776 | 3776 |
| 3777 if (p->IsFlagSet(Page::NEVER_ALLOCATE_ON_PAGE)) { |
| 3778 // We need to sweep the page to get it into an iterable state again. Note |
| 3779 // that this adds unusable memory into the free list that is later on |
| 3780 // (in the free list) dropped again. Since we only use the flag for |
| 3781 // testing this is fine. |
| 3782 Sweep<SWEEP_ONLY, SWEEP_ON_MAIN_THREAD, IGNORE_SKIP_LIST, |
| 3783 IGNORE_FREE_SPACE>(space, nullptr, p, nullptr); |
| 3784 continue; |
| 3785 } |
| 3786 |
| 3777 // One unused page is kept, all further are released before sweeping them. | 3787 // One unused page is kept, all further are released before sweeping them. |
| 3778 if (p->LiveBytes() == 0) { | 3788 if (p->LiveBytes() == 0) { |
| 3779 if (unused_page_present) { | 3789 if (unused_page_present) { |
| 3780 if (FLAG_gc_verbose) { | 3790 if (FLAG_gc_verbose) { |
| 3781 PrintIsolate(isolate(), "sweeping: released page: %p", p); | 3791 PrintIsolate(isolate(), "sweeping: released page: %p", p); |
| 3782 } | 3792 } |
| 3783 space->ReleasePage(p); | 3793 space->ReleasePage(p); |
| 3784 continue; | 3794 continue; |
| 3785 } | 3795 } |
| 3786 unused_page_present = true; | 3796 unused_page_present = true; |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3959 MarkBit mark_bit = Marking::MarkBitFrom(host); | 3969 MarkBit mark_bit = Marking::MarkBitFrom(host); |
| 3960 if (Marking::IsBlack(mark_bit)) { | 3970 if (Marking::IsBlack(mark_bit)) { |
| 3961 RelocInfo rinfo(isolate(), pc, RelocInfo::CODE_TARGET, 0, host); | 3971 RelocInfo rinfo(isolate(), pc, RelocInfo::CODE_TARGET, 0, host); |
| 3962 RecordRelocSlot(&rinfo, target); | 3972 RecordRelocSlot(&rinfo, target); |
| 3963 } | 3973 } |
| 3964 } | 3974 } |
| 3965 } | 3975 } |
| 3966 | 3976 |
| 3967 } // namespace internal | 3977 } // namespace internal |
| 3968 } // namespace v8 | 3978 } // namespace v8 |
| OLD | NEW |