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 2973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2984 bool success = false; | 2984 bool success = false; |
2985 DCHECK(p->IsEvacuationCandidate() || p->InNewSpace()); | 2985 DCHECK(p->IsEvacuationCandidate() || p->InNewSpace()); |
2986 int saved_live_bytes = p->LiveBytes(); | 2986 int saved_live_bytes = p->LiveBytes(); |
2987 double evacuation_time; | 2987 double evacuation_time; |
2988 { | 2988 { |
2989 AlwaysAllocateScope always_allocate(heap()->isolate()); | 2989 AlwaysAllocateScope always_allocate(heap()->isolate()); |
2990 TimedScope timed_scope(&evacuation_time); | 2990 TimedScope timed_scope(&evacuation_time); |
2991 success = collector_->VisitLiveObjects(p, visitor, kClearMarkbits); | 2991 success = collector_->VisitLiveObjects(p, visitor, kClearMarkbits); |
2992 } | 2992 } |
2993 if (FLAG_trace_evacuation) { | 2993 if (FLAG_trace_evacuation) { |
| 2994 const char age_mark_tag = |
| 2995 !p->InNewSpace() |
| 2996 ? 'x' |
| 2997 : !p->IsFlagSet(MemoryChunk::NEW_SPACE_BELOW_AGE_MARK) |
| 2998 ? '>' |
| 2999 : !p->ContainsLimit(heap()->new_space()->age_mark()) ? '<' |
| 3000 : '#'; |
2994 PrintIsolate(heap()->isolate(), | 3001 PrintIsolate(heap()->isolate(), |
2995 "evacuation[%p]: page=%p new_space=%d executable=%d " | 3002 "evacuation[%p]: page=%p new_space=%d age_mark_tag=%c " |
2996 "live_bytes=%d time=%f\n", | 3003 "executable=%d live_bytes=%d time=%f\n", |
2997 this, p, p->InNewSpace(), | 3004 this, p, p->InNewSpace(), age_mark_tag, |
2998 p->IsFlagSet(MemoryChunk::IS_EXECUTABLE), saved_live_bytes, | 3005 p->IsFlagSet(MemoryChunk::IS_EXECUTABLE), saved_live_bytes, |
2999 evacuation_time); | 3006 evacuation_time); |
3000 } | 3007 } |
3001 if (success) { | 3008 if (success) { |
3002 ReportCompactionProgress(evacuation_time, saved_live_bytes); | 3009 ReportCompactionProgress(evacuation_time, saved_live_bytes); |
3003 } | 3010 } |
3004 return success; | 3011 return success; |
3005 } | 3012 } |
3006 | 3013 |
3007 bool MarkCompactCollector::Evacuator::EvacuatePage(MemoryChunk* chunk) { | 3014 bool MarkCompactCollector::Evacuator::EvacuatePage(MemoryChunk* chunk) { |
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3806 MarkBit mark_bit = Marking::MarkBitFrom(host); | 3813 MarkBit mark_bit = Marking::MarkBitFrom(host); |
3807 if (Marking::IsBlack(mark_bit)) { | 3814 if (Marking::IsBlack(mark_bit)) { |
3808 RelocInfo rinfo(isolate(), pc, RelocInfo::CODE_TARGET, 0, host); | 3815 RelocInfo rinfo(isolate(), pc, RelocInfo::CODE_TARGET, 0, host); |
3809 RecordRelocSlot(host, &rinfo, target); | 3816 RecordRelocSlot(host, &rinfo, target); |
3810 } | 3817 } |
3811 } | 3818 } |
3812 } | 3819 } |
3813 | 3820 |
3814 } // namespace internal | 3821 } // namespace internal |
3815 } // namespace v8 | 3822 } // namespace v8 |
OLD | NEW |