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 3091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3102 const char age_mark_tag = | 3102 const char age_mark_tag = |
3103 !p->InNewSpace() | 3103 !p->InNewSpace() |
3104 ? 'x' | 3104 ? 'x' |
3105 : !p->IsFlagSet(MemoryChunk::NEW_SPACE_BELOW_AGE_MARK) | 3105 : !p->IsFlagSet(MemoryChunk::NEW_SPACE_BELOW_AGE_MARK) |
3106 ? '>' | 3106 ? '>' |
3107 : !p->ContainsLimit(heap()->new_space()->age_mark()) ? '<' | 3107 : !p->ContainsLimit(heap()->new_space()->age_mark()) ? '<' |
3108 : '#'; | 3108 : '#'; |
3109 PrintIsolate(heap()->isolate(), | 3109 PrintIsolate(heap()->isolate(), |
3110 "evacuation[%p]: page=%p new_space=%d age_mark_tag=%c " | 3110 "evacuation[%p]: page=%p new_space=%d age_mark_tag=%c " |
3111 "page_evacuation=%d executable=%d live_bytes=%d time=%f\n", | 3111 "page_evacuation=%d executable=%d live_bytes=%d time=%f\n", |
3112 this, p, p->InNewSpace(), age_mark_tag, | 3112 static_cast<void*>(this), static_cast<void*>(p), |
| 3113 p->InNewSpace(), age_mark_tag, |
3113 p->IsFlagSet(MemoryChunk::PAGE_NEW_OLD_PROMOTION), | 3114 p->IsFlagSet(MemoryChunk::PAGE_NEW_OLD_PROMOTION), |
3114 p->IsFlagSet(MemoryChunk::IS_EXECUTABLE), saved_live_bytes, | 3115 p->IsFlagSet(MemoryChunk::IS_EXECUTABLE), saved_live_bytes, |
3115 evacuation_time); | 3116 evacuation_time); |
3116 } | 3117 } |
3117 if (success) { | 3118 if (success) { |
3118 ReportCompactionProgress(evacuation_time, saved_live_bytes); | 3119 ReportCompactionProgress(evacuation_time, saved_live_bytes); |
3119 } | 3120 } |
3120 return success; | 3121 return success; |
3121 } | 3122 } |
3122 | 3123 |
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3846 Sweeper::RawSweep<Sweeper::SWEEP_ONLY, Sweeper::SWEEP_ON_MAIN_THREAD, | 3847 Sweeper::RawSweep<Sweeper::SWEEP_ONLY, Sweeper::SWEEP_ON_MAIN_THREAD, |
3847 Sweeper::IGNORE_SKIP_LIST, Sweeper::IGNORE_FREE_SPACE>( | 3848 Sweeper::IGNORE_SKIP_LIST, Sweeper::IGNORE_FREE_SPACE>( |
3848 space, p, nullptr); | 3849 space, p, nullptr); |
3849 continue; | 3850 continue; |
3850 } | 3851 } |
3851 | 3852 |
3852 // One unused page is kept, all further are released before sweeping them. | 3853 // One unused page is kept, all further are released before sweeping them. |
3853 if (p->LiveBytes() == 0) { | 3854 if (p->LiveBytes() == 0) { |
3854 if (unused_page_present) { | 3855 if (unused_page_present) { |
3855 if (FLAG_gc_verbose) { | 3856 if (FLAG_gc_verbose) { |
3856 PrintIsolate(isolate(), "sweeping: released page: %p", p); | 3857 PrintIsolate(isolate(), "sweeping: released page: %p", |
| 3858 static_cast<void*>(p)); |
3857 } | 3859 } |
3858 space->ReleasePage(p); | 3860 space->ReleasePage(p); |
3859 continue; | 3861 continue; |
3860 } | 3862 } |
3861 unused_page_present = true; | 3863 unused_page_present = true; |
3862 } | 3864 } |
3863 | 3865 |
3864 sweeper().AddPage(space->identity(), p); | 3866 sweeper().AddPage(space->identity(), p); |
3865 will_be_swept++; | 3867 will_be_swept++; |
3866 } | 3868 } |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3939 MarkBit mark_bit = Marking::MarkBitFrom(host); | 3941 MarkBit mark_bit = Marking::MarkBitFrom(host); |
3940 if (Marking::IsBlack(mark_bit)) { | 3942 if (Marking::IsBlack(mark_bit)) { |
3941 RelocInfo rinfo(isolate(), pc, RelocInfo::CODE_TARGET, 0, host); | 3943 RelocInfo rinfo(isolate(), pc, RelocInfo::CODE_TARGET, 0, host); |
3942 RecordRelocSlot(host, &rinfo, target); | 3944 RecordRelocSlot(host, &rinfo, target); |
3943 } | 3945 } |
3944 } | 3946 } |
3945 } | 3947 } |
3946 | 3948 |
3947 } // namespace internal | 3949 } // namespace internal |
3948 } // namespace v8 | 3950 } // namespace v8 |
OLD | NEW |