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 1279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1290 } | 1290 } |
1291 }; | 1291 }; |
1292 | 1292 |
1293 | 1293 |
1294 void MarkCompactMarkingVisitor::Initialize() { | 1294 void MarkCompactMarkingVisitor::Initialize() { |
1295 StaticMarkingVisitor<MarkCompactMarkingVisitor>::Initialize(); | 1295 StaticMarkingVisitor<MarkCompactMarkingVisitor>::Initialize(); |
1296 | 1296 |
1297 table_.Register(kVisitJSRegExp, &VisitRegExpAndFlushCode); | 1297 table_.Register(kVisitJSRegExp, &VisitRegExpAndFlushCode); |
1298 | 1298 |
1299 if (FLAG_track_gc_object_stats) { | 1299 if (FLAG_track_gc_object_stats) { |
1300 ObjectStatsVisitor::Initialize(&table_); | 1300 MarkCompactObjectStatsVisitor::Initialize(&table_); |
1301 } | 1301 } |
1302 } | 1302 } |
1303 | 1303 |
1304 | 1304 |
1305 class CodeMarkingVisitor : public ThreadVisitor { | 1305 class CodeMarkingVisitor : public ThreadVisitor { |
1306 public: | 1306 public: |
1307 explicit CodeMarkingVisitor(MarkCompactCollector* collector) | 1307 explicit CodeMarkingVisitor(MarkCompactCollector* collector) |
1308 : collector_(collector) {} | 1308 : collector_(collector) {} |
1309 | 1309 |
1310 void VisitThread(Isolate* isolate, ThreadLocalTop* top) { | 1310 void VisitThread(Isolate* isolate, ThreadLocalTop* top) { |
(...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2201 PostponeInterruptsScope postpone(isolate()); | 2201 PostponeInterruptsScope postpone(isolate()); |
2202 | 2202 |
2203 { | 2203 { |
2204 TRACE_GC(heap()->tracer(), GCTracer::Scope::MC_MARK_FINISH_INCREMENTAL); | 2204 TRACE_GC(heap()->tracer(), GCTracer::Scope::MC_MARK_FINISH_INCREMENTAL); |
2205 IncrementalMarking* incremental_marking = heap_->incremental_marking(); | 2205 IncrementalMarking* incremental_marking = heap_->incremental_marking(); |
2206 if (was_marked_incrementally_) { | 2206 if (was_marked_incrementally_) { |
2207 incremental_marking->Finalize(); | 2207 incremental_marking->Finalize(); |
2208 } else { | 2208 } else { |
2209 // Abort any pending incremental activities e.g. incremental sweeping. | 2209 // Abort any pending incremental activities e.g. incremental sweeping. |
2210 incremental_marking->Stop(); | 2210 incremental_marking->Stop(); |
2211 if (FLAG_track_gc_object_stats) { | |
Hannes Payer (out of office)
2016/05/11 15:43:56
I think it is cleaner to clear the object stats ri
mythria
2016/05/11 15:52:26
They are already cleared after printing trace info
| |
2212 // Clear object stats collected during incremental marking. | |
2213 heap()->object_stats_->ClearObjectStats(); | |
2214 } | |
2211 if (marking_deque_.in_use()) { | 2215 if (marking_deque_.in_use()) { |
2212 marking_deque_.Uninitialize(true); | 2216 marking_deque_.Uninitialize(true); |
2213 } | 2217 } |
2214 } | 2218 } |
2215 } | 2219 } |
2216 | 2220 |
2217 #ifdef DEBUG | 2221 #ifdef DEBUG |
2218 DCHECK(state_ == PREPARE_GC); | 2222 DCHECK(state_ == PREPARE_GC); |
2219 state_ = MARK_LIVE_OBJECTS; | 2223 state_ = MARK_LIVE_OBJECTS; |
2220 #endif | 2224 #endif |
(...skipping 1726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3947 MarkBit mark_bit = Marking::MarkBitFrom(host); | 3951 MarkBit mark_bit = Marking::MarkBitFrom(host); |
3948 if (Marking::IsBlack(mark_bit)) { | 3952 if (Marking::IsBlack(mark_bit)) { |
3949 RelocInfo rinfo(isolate(), pc, RelocInfo::CODE_TARGET, 0, host); | 3953 RelocInfo rinfo(isolate(), pc, RelocInfo::CODE_TARGET, 0, host); |
3950 RecordRelocSlot(host, &rinfo, target); | 3954 RecordRelocSlot(host, &rinfo, target); |
3951 } | 3955 } |
3952 } | 3956 } |
3953 } | 3957 } |
3954 | 3958 |
3955 } // namespace internal | 3959 } // namespace internal |
3956 } // namespace v8 | 3960 } // namespace v8 |
OLD | NEW |