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