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/gc-idle-time-handler.h" | 10 #include "src/heap/gc-idle-time-handler.h" |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 ActivateIncrementalWriteBarrier(heap_->map_space()); | 394 ActivateIncrementalWriteBarrier(heap_->map_space()); |
395 ActivateIncrementalWriteBarrier(heap_->code_space()); | 395 ActivateIncrementalWriteBarrier(heap_->code_space()); |
396 ActivateIncrementalWriteBarrier(heap_->new_space()); | 396 ActivateIncrementalWriteBarrier(heap_->new_space()); |
397 | 397 |
398 for (LargePage* lop : *heap_->lo_space()) { | 398 for (LargePage* lop : *heap_->lo_space()) { |
399 SetOldSpacePageFlags(lop, true, is_compacting_); | 399 SetOldSpacePageFlags(lop, true, is_compacting_); |
400 } | 400 } |
401 } | 401 } |
402 | 402 |
403 | 403 |
404 bool IncrementalMarking::ShouldActivateEvenWithoutIdleNotification() { | |
405 #ifndef DEBUG | |
406 static const intptr_t kActivationThreshold = 8 * MB; | |
407 #else | |
408 // TODO(gc) consider setting this to some low level so that some | |
409 // debug tests run with incremental marking and some without. | |
410 static const intptr_t kActivationThreshold = 0; | |
411 #endif | |
412 // Don't switch on for very small heaps. | |
413 return CanBeActivated() && | |
414 heap_->PromotedSpaceSizeOfObjects() > kActivationThreshold && | |
415 heap_->HeapIsFullEnoughToStartIncrementalMarking( | |
416 heap_->old_generation_allocation_limit()); | |
417 } | |
418 | |
419 | |
420 bool IncrementalMarking::WasActivated() { return was_activated_; } | 404 bool IncrementalMarking::WasActivated() { return was_activated_; } |
421 | 405 |
422 | 406 |
423 bool IncrementalMarking::CanBeActivated() { | 407 bool IncrementalMarking::CanBeActivated() { |
424 // Only start incremental marking in a safe state: 1) when incremental | 408 // Only start incremental marking in a safe state: 1) when incremental |
425 // marking is turned on, 2) when we are currently not in a GC, and | 409 // marking is turned on, 2) when we are currently not in a GC, and |
426 // 3) when we are currently not serializing or deserializing the heap. | 410 // 3) when we are currently not serializing or deserializing the heap. |
427 return FLAG_incremental_marking && heap_->gc_state() == Heap::NOT_IN_GC && | 411 return FLAG_incremental_marking && heap_->gc_state() == Heap::NOT_IN_GC && |
428 heap_->deserialization_complete() && | 412 heap_->deserialization_complete() && |
429 !heap_->isolate()->serializer_enabled(); | 413 !heap_->isolate()->serializer_enabled(); |
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1214 idle_marking_delay_counter_++; | 1198 idle_marking_delay_counter_++; |
1215 } | 1199 } |
1216 | 1200 |
1217 | 1201 |
1218 void IncrementalMarking::ClearIdleMarkingDelayCounter() { | 1202 void IncrementalMarking::ClearIdleMarkingDelayCounter() { |
1219 idle_marking_delay_counter_ = 0; | 1203 idle_marking_delay_counter_ = 0; |
1220 } | 1204 } |
1221 | 1205 |
1222 } // namespace internal | 1206 } // namespace internal |
1223 } // namespace v8 | 1207 } // namespace v8 |
OLD | NEW |