Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(293)

Side by Side Diff: src/heap/incremental-marking.cc

Issue 2735803005: [heap] Start concurrent marking simultaneously with incremental marking. (Closed)
Patch Set: fix test Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/heap/heap.cc ('k') | src/heap/mark-compact.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/heap/heap.cc ('k') | src/heap/mark-compact.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698