Chromium Code Reviews

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

Issue 1273483002: GC: Refactor public incremental marking interface in heap (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/heap/incremental-marking.h" 7 #include "src/heap/incremental-marking.h"
8 8
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/compilation-cache.h" 10 #include "src/compilation-cache.h"
(...skipping 452 matching lines...)
463 Object* e = stubs->ValueAt(i); 463 Object* e = stubs->ValueAt(i);
464 if (e->IsCode()) { 464 if (e->IsCode()) {
465 RecordWriteStub::Patch(Code::cast(e), mode); 465 RecordWriteStub::Patch(Code::cast(e), mode);
466 } 466 }
467 } 467 }
468 } 468 }
469 } 469 }
470 } 470 }
471 471
472 472
473 void IncrementalMarking::Start(int mark_compact_flags) { 473 void IncrementalMarking::Start(int mark_compact_flags,
474 const GCCallbackFlags gc_callback_flags) {
474 if (FLAG_trace_incremental_marking) { 475 if (FLAG_trace_incremental_marking) {
475 PrintF("[IncrementalMarking] Start\n"); 476 PrintF("[IncrementalMarking] Start\n");
476 } 477 }
477 DCHECK(FLAG_incremental_marking); 478 DCHECK(FLAG_incremental_marking);
478 DCHECK(FLAG_incremental_marking_steps); 479 DCHECK(FLAG_incremental_marking_steps);
479 DCHECK(state_ == STOPPED); 480 DCHECK(state_ == STOPPED);
480 DCHECK(heap_->gc_state() == Heap::NOT_IN_GC); 481 DCHECK(heap_->gc_state() == Heap::NOT_IN_GC);
481 DCHECK(!heap_->isolate()->serializer_enabled()); 482 DCHECK(!heap_->isolate()->serializer_enabled());
482 483
483 ResetStepCounters(); 484 ResetStepCounters();
484 485
486 gc_callback_flags_ = gc_callback_flags;
485 was_activated_ = true; 487 was_activated_ = true;
486 488
487 if (!heap_->mark_compact_collector()->sweeping_in_progress()) { 489 if (!heap_->mark_compact_collector()->sweeping_in_progress()) {
488 heap_->mark_compact_collector()->SetFlags(mark_compact_flags); 490 heap_->mark_compact_collector()->SetFlags(mark_compact_flags);
489 StartMarking(); 491 StartMarking();
490 heap_->mark_compact_collector()->SetFlags(Heap::kNoGCFlags); 492 heap_->mark_compact_collector()->SetFlags(Heap::kNoGCFlags);
491 } else { 493 } else {
492 if (FLAG_trace_incremental_marking) { 494 if (FLAG_trace_incremental_marking) {
493 PrintF("[IncrementalMarking] Start sweeping.\n"); 495 PrintF("[IncrementalMarking] Start sweeping.\n");
494 } 496 }
(...skipping 526 matching lines...)
1021 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { 1023 void IncrementalMarking::IncrementIdleMarkingDelayCounter() {
1022 idle_marking_delay_counter_++; 1024 idle_marking_delay_counter_++;
1023 } 1025 }
1024 1026
1025 1027
1026 void IncrementalMarking::ClearIdleMarkingDelayCounter() { 1028 void IncrementalMarking::ClearIdleMarkingDelayCounter() {
1027 idle_marking_delay_counter_ = 0; 1029 idle_marking_delay_counter_ = 0;
1028 } 1030 }
1029 } // namespace internal 1031 } // namespace internal
1030 } // namespace v8 1032 } // namespace v8
OLDNEW
« src/heap/incremental-marking.h ('K') | « src/heap/incremental-marking.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine