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

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

Issue 1301183002: [heap] Cleanup and fix GC flags / add testing infra (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed Hannes' comments Created 5 years, 4 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/incremental-marking.h ('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/mark-compact-inl.h" 10 #include "src/heap/mark-compact-inl.h"
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 Object* e = stubs->ValueAt(i); 461 Object* e = stubs->ValueAt(i);
462 if (e->IsCode()) { 462 if (e->IsCode()) {
463 RecordWriteStub::Patch(Code::cast(e), mode); 463 RecordWriteStub::Patch(Code::cast(e), mode);
464 } 464 }
465 } 465 }
466 } 466 }
467 } 467 }
468 } 468 }
469 469
470 470
471 void IncrementalMarking::Start(int mark_compact_flags, 471 void IncrementalMarking::Start(int flags,
472 const GCCallbackFlags gc_callback_flags, 472 const GCCallbackFlags gc_callback_flags,
473 const char* reason) { 473 const char* reason) {
474 if (FLAG_trace_incremental_marking) { 474 if (FLAG_trace_incremental_marking) {
475 PrintF("[IncrementalMarking] Start (%s)\n", 475 PrintF("[IncrementalMarking] Start (%s)\n",
476 (reason == nullptr) ? "unknown reason" : reason); 476 (reason == nullptr) ? "unknown reason" : reason);
477 } 477 }
478 DCHECK(FLAG_incremental_marking); 478 DCHECK(FLAG_incremental_marking);
479 DCHECK(state_ == STOPPED); 479 DCHECK(state_ == STOPPED);
480 DCHECK(heap_->gc_state() == Heap::NOT_IN_GC); 480 DCHECK(heap_->gc_state() == Heap::NOT_IN_GC);
481 DCHECK(!heap_->isolate()->serializer_enabled()); 481 DCHECK(!heap_->isolate()->serializer_enabled());
482 482
483 ResetStepCounters(); 483 ResetStepCounters();
484 484
485 gc_callback_flags_ = gc_callback_flags; 485 gc_callback_flags_ = gc_callback_flags;
486 was_activated_ = true; 486 was_activated_ = true;
487 487
488 if (!heap_->mark_compact_collector()->sweeping_in_progress()) { 488 if (!heap_->mark_compact_collector()->sweeping_in_progress()) {
489 heap_->mark_compact_collector()->SetFlags(mark_compact_flags); 489 heap_->set_current_gc_flags(flags);
490 StartMarking(); 490 StartMarking();
491 heap_->mark_compact_collector()->SetFlags(Heap::kNoGCFlags);
492 } else { 491 } else {
493 if (FLAG_trace_incremental_marking) { 492 if (FLAG_trace_incremental_marking) {
494 PrintF("[IncrementalMarking] Start sweeping.\n"); 493 PrintF("[IncrementalMarking] Start sweeping.\n");
495 } 494 }
496 state_ = SWEEPING; 495 state_ = SWEEPING;
497 } 496 }
498 497
499 heap_->new_space()->LowerInlineAllocationLimit(kAllocatedThreshold); 498 heap_->new_space()->LowerInlineAllocationLimit(kAllocatedThreshold);
500 } 499 }
501 500
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after
1021 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { 1020 void IncrementalMarking::IncrementIdleMarkingDelayCounter() {
1022 idle_marking_delay_counter_++; 1021 idle_marking_delay_counter_++;
1023 } 1022 }
1024 1023
1025 1024
1026 void IncrementalMarking::ClearIdleMarkingDelayCounter() { 1025 void IncrementalMarking::ClearIdleMarkingDelayCounter() {
1027 idle_marking_delay_counter_ = 0; 1026 idle_marking_delay_counter_ = 0;
1028 } 1027 }
1029 } // namespace internal 1028 } // namespace internal
1030 } // namespace v8 1029 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/incremental-marking.h ('k') | src/heap/mark-compact.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698