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 4106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4117 GCTracer::Scope::MC_SWEEP_MAP); | 4117 GCTracer::Scope::MC_SWEEP_MAP); |
4118 StartSweepSpace(heap()->map_space()); | 4118 StartSweepSpace(heap()->map_space()); |
4119 } | 4119 } |
4120 sweeper().StartSweeping(); | 4120 sweeper().StartSweeping(); |
4121 } | 4121 } |
4122 | 4122 |
4123 // Deallocate unmarked large objects. | 4123 // Deallocate unmarked large objects. |
4124 heap_->lo_space()->FreeUnmarkedObjects(); | 4124 heap_->lo_space()->FreeUnmarkedObjects(); |
4125 } | 4125 } |
4126 | 4126 |
4127 Isolate* MarkCompactCollector::isolate() const { return heap_->isolate(); } | |
4128 | |
4129 | |
4130 void MarkCompactCollector::Initialize() { | 4127 void MarkCompactCollector::Initialize() { |
4131 MarkCompactMarkingVisitor::Initialize(); | 4128 MarkCompactMarkingVisitor::Initialize(); |
4132 IncrementalMarking::Initialize(); | 4129 IncrementalMarking::Initialize(); |
4133 } | 4130 } |
4134 | 4131 |
4135 void MarkCompactCollector::RecordCodeEntrySlot(HeapObject* host, Address slot, | 4132 void MarkCompactCollector::RecordCodeEntrySlot(HeapObject* host, Address slot, |
4136 Code* target) { | 4133 Code* target) { |
4137 Page* target_page = Page::FromAddress(reinterpret_cast<Address>(target)); | 4134 Page* target_page = Page::FromAddress(reinterpret_cast<Address>(target)); |
4138 Page* source_page = Page::FromAddress(reinterpret_cast<Address>(host)); | 4135 Page* source_page = Page::FromAddress(reinterpret_cast<Address>(host)); |
4139 if (target_page->IsEvacuationCandidate() && | 4136 if (target_page->IsEvacuationCandidate() && |
(...skipping 17 matching lines...) Expand all Loading... |
4157 // The target is always in old space, we don't have to record the slot in | 4154 // The target is always in old space, we don't have to record the slot in |
4158 // the old-to-new remembered set. | 4155 // the old-to-new remembered set. |
4159 DCHECK(!heap()->InNewSpace(target)); | 4156 DCHECK(!heap()->InNewSpace(target)); |
4160 RecordRelocSlot(host, &rinfo, target); | 4157 RecordRelocSlot(host, &rinfo, target); |
4161 } | 4158 } |
4162 } | 4159 } |
4163 } | 4160 } |
4164 | 4161 |
4165 } // namespace internal | 4162 } // namespace internal |
4166 } // namespace v8 | 4163 } // namespace v8 |
OLD | NEW |