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