| 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 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 } | 540 } |
| 540 #endif | 541 #endif |
| 541 | 542 |
| 542 heap_->CompletelyClearInstanceofCache(); | 543 heap_->CompletelyClearInstanceofCache(); |
| 543 heap_->isolate()->compilation_cache()->MarkCompactPrologue(); | 544 heap_->isolate()->compilation_cache()->MarkCompactPrologue(); |
| 544 | 545 |
| 545 // Mark strong roots grey. | 546 // Mark strong roots grey. |
| 546 IncrementalMarkingRootMarkingVisitor visitor(this); | 547 IncrementalMarkingRootMarkingVisitor visitor(this); |
| 547 heap_->IterateStrongRoots(&visitor, VISIT_ONLY_STRONG); | 548 heap_->IterateStrongRoots(&visitor, VISIT_ONLY_STRONG); |
| 548 | 549 |
| 550 if (FLAG_concurrent_marking) { |
| 551 ConcurrentMarking* concurrent_marking = heap_->concurrent_marking(); |
| 552 heap_->mark_compact_collector()->marking_deque()->Iterate( |
| 553 [concurrent_marking](HeapObject* obj) { |
| 554 concurrent_marking->AddRoot(obj); |
| 555 }); |
| 556 concurrent_marking->StartMarkingTask(); |
| 557 } |
| 558 |
| 549 // Ready to start incremental marking. | 559 // Ready to start incremental marking. |
| 550 if (FLAG_trace_incremental_marking) { | 560 if (FLAG_trace_incremental_marking) { |
| 551 heap()->isolate()->PrintWithTimestamp("[IncrementalMarking] Running\n"); | 561 heap()->isolate()->PrintWithTimestamp("[IncrementalMarking] Running\n"); |
| 552 } | 562 } |
| 553 } | 563 } |
| 554 | 564 |
| 555 void IncrementalMarking::StartBlackAllocation() { | 565 void IncrementalMarking::StartBlackAllocation() { |
| 556 DCHECK(FLAG_black_allocation); | 566 DCHECK(FLAG_black_allocation); |
| 557 DCHECK(IsMarking()); | 567 DCHECK(IsMarking()); |
| 558 black_allocation_ = true; | 568 black_allocation_ = true; |
| (...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1168 idle_marking_delay_counter_++; | 1178 idle_marking_delay_counter_++; |
| 1169 } | 1179 } |
| 1170 | 1180 |
| 1171 | 1181 |
| 1172 void IncrementalMarking::ClearIdleMarkingDelayCounter() { | 1182 void IncrementalMarking::ClearIdleMarkingDelayCounter() { |
| 1173 idle_marking_delay_counter_ = 0; | 1183 idle_marking_delay_counter_ = 0; |
| 1174 } | 1184 } |
| 1175 | 1185 |
| 1176 } // namespace internal | 1186 } // namespace internal |
| 1177 } // namespace v8 | 1187 } // namespace v8 |
| OLD | NEW |