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/incremental-marking.h" | 5 #include "src/heap/incremental-marking.h" |
6 | 6 |
7 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/compilation-cache.h" | 8 #include "src/compilation-cache.h" |
9 #include "src/conversions.h" | 9 #include "src/conversions.h" |
| 10 #include "src/heap/concurrent-marking.h" |
10 #include "src/heap/gc-idle-time-handler.h" | 11 #include "src/heap/gc-idle-time-handler.h" |
11 #include "src/heap/gc-tracer.h" | 12 #include "src/heap/gc-tracer.h" |
12 #include "src/heap/heap-inl.h" | 13 #include "src/heap/heap-inl.h" |
13 #include "src/heap/mark-compact-inl.h" | 14 #include "src/heap/mark-compact-inl.h" |
14 #include "src/heap/object-stats.h" | 15 #include "src/heap/object-stats.h" |
15 #include "src/heap/objects-visiting-inl.h" | 16 #include "src/heap/objects-visiting-inl.h" |
16 #include "src/heap/objects-visiting.h" | 17 #include "src/heap/objects-visiting.h" |
17 #include "src/tracing/trace-event.h" | 18 #include "src/tracing/trace-event.h" |
18 #include "src/v8.h" | 19 #include "src/v8.h" |
19 | 20 |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 } | 539 } |
539 #endif | 540 #endif |
540 | 541 |
541 heap_->CompletelyClearInstanceofCache(); | 542 heap_->CompletelyClearInstanceofCache(); |
542 heap_->isolate()->compilation_cache()->MarkCompactPrologue(); | 543 heap_->isolate()->compilation_cache()->MarkCompactPrologue(); |
543 | 544 |
544 // Mark strong roots grey. | 545 // Mark strong roots grey. |
545 IncrementalMarkingRootMarkingVisitor visitor(this); | 546 IncrementalMarkingRootMarkingVisitor visitor(this); |
546 heap_->IterateStrongRoots(&visitor, VISIT_ONLY_STRONG); | 547 heap_->IterateStrongRoots(&visitor, VISIT_ONLY_STRONG); |
547 | 548 |
| 549 if (FLAG_concurrent_marking) { |
| 550 ConcurrentMarking* concurrent_marking = heap_->concurrent_marking(); |
| 551 heap_->mark_compact_collector()->marking_deque()->Iterate( |
| 552 [concurrent_marking](HeapObject* obj) { |
| 553 concurrent_marking->AddRoot(obj); |
| 554 }); |
| 555 concurrent_marking->StartTask(); |
| 556 } |
| 557 |
548 // Ready to start incremental marking. | 558 // Ready to start incremental marking. |
549 if (FLAG_trace_incremental_marking) { | 559 if (FLAG_trace_incremental_marking) { |
550 heap()->isolate()->PrintWithTimestamp("[IncrementalMarking] Running\n"); | 560 heap()->isolate()->PrintWithTimestamp("[IncrementalMarking] Running\n"); |
551 } | 561 } |
552 } | 562 } |
553 | 563 |
554 void IncrementalMarking::StartBlackAllocation() { | 564 void IncrementalMarking::StartBlackAllocation() { |
555 DCHECK(FLAG_black_allocation); | 565 DCHECK(FLAG_black_allocation); |
556 DCHECK(IsMarking()); | 566 DCHECK(IsMarking()); |
557 black_allocation_ = true; | 567 black_allocation_ = true; |
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1174 idle_marking_delay_counter_++; | 1184 idle_marking_delay_counter_++; |
1175 } | 1185 } |
1176 | 1186 |
1177 | 1187 |
1178 void IncrementalMarking::ClearIdleMarkingDelayCounter() { | 1188 void IncrementalMarking::ClearIdleMarkingDelayCounter() { |
1179 idle_marking_delay_counter_ = 0; | 1189 idle_marking_delay_counter_ = 0; |
1180 } | 1190 } |
1181 | 1191 |
1182 } // namespace internal | 1192 } // namespace internal |
1183 } // namespace v8 | 1193 } // namespace v8 |
OLD | NEW |