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

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

Issue 1418293006: Remove redundant activation threshold for incremental marking. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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 | « no previous file | no next file » | 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/gc-idle-time-handler.h" 10 #include "src/heap/gc-idle-time-handler.h"
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 return CanBeActivated() && 467 return CanBeActivated() &&
468 heap_->HeapIsFullEnoughToStartIncrementalMarking( 468 heap_->HeapIsFullEnoughToStartIncrementalMarking(
469 heap_->old_generation_allocation_limit()); 469 heap_->old_generation_allocation_limit());
470 } 470 }
471 471
472 472
473 bool IncrementalMarking::WasActivated() { return was_activated_; } 473 bool IncrementalMarking::WasActivated() { return was_activated_; }
474 474
475 475
476 bool IncrementalMarking::CanBeActivated() { 476 bool IncrementalMarking::CanBeActivated() {
477 #ifndef DEBUG
478 static const intptr_t kActivationThreshold = 8 * MB;
479 #else
480 // TODO(gc) consider setting this to some low level so that some
481 // debug tests run with incremental marking and some without.
482 static const intptr_t kActivationThreshold = 0;
483 #endif
484 // Only start incremental marking in a safe state: 1) when incremental 477 // Only start incremental marking in a safe state: 1) when incremental
485 // marking is turned on, 2) when we are currently not in a GC, and 478 // marking is turned on, 2) when we are currently not in a GC, and
486 // 3) when we are currently not serializing or deserializing the heap. 479 // 3) when we are currently not serializing or deserializing the heap.
487 // Don't switch on for very small heaps. 480 // Don't switch on for very small heaps.
488 return FLAG_incremental_marking && heap_->gc_state() == Heap::NOT_IN_GC && 481 return FLAG_incremental_marking && heap_->gc_state() == Heap::NOT_IN_GC &&
489 heap_->deserialization_complete() && 482 heap_->deserialization_complete() &&
490 !heap_->isolate()->serializer_enabled() && 483 !heap_->isolate()->serializer_enabled();
491 heap_->PromotedSpaceSizeOfObjects() > kActivationThreshold;
492 } 484 }
493 485
494 486
495 void IncrementalMarking::ActivateGeneratedStub(Code* stub) { 487 void IncrementalMarking::ActivateGeneratedStub(Code* stub) {
496 DCHECK(RecordWriteStub::GetMode(stub) == RecordWriteStub::STORE_BUFFER_ONLY); 488 DCHECK(RecordWriteStub::GetMode(stub) == RecordWriteStub::STORE_BUFFER_ONLY);
497 489
498 if (!IsMarking()) { 490 if (!IsMarking()) {
499 // Initially stub is generated in STORE_BUFFER_ONLY mode thus 491 // Initially stub is generated in STORE_BUFFER_ONLY mode thus
500 // we don't need to do anything if incremental marking is 492 // we don't need to do anything if incremental marking is
501 // not active. 493 // not active.
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
1154 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { 1146 void IncrementalMarking::IncrementIdleMarkingDelayCounter() {
1155 idle_marking_delay_counter_++; 1147 idle_marking_delay_counter_++;
1156 } 1148 }
1157 1149
1158 1150
1159 void IncrementalMarking::ClearIdleMarkingDelayCounter() { 1151 void IncrementalMarking::ClearIdleMarkingDelayCounter() {
1160 idle_marking_delay_counter_ = 0; 1152 idle_marking_delay_counter_ = 0;
1161 } 1153 }
1162 } // namespace internal 1154 } // namespace internal
1163 } // namespace v8 1155 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698