| 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-tracer.h" | 10 #include "src/heap/gc-tracer.h" |
| 11 #include "src/heap/mark-compact-inl.h" | 11 #include "src/heap/mark-compact-inl.h" |
| 12 #include "src/heap/objects-visiting.h" | 12 #include "src/heap/objects-visiting.h" |
| 13 #include "src/heap/objects-visiting-inl.h" | 13 #include "src/heap/objects-visiting-inl.h" |
| 14 #include "src/v8.h" |
| 14 | 15 |
| 15 namespace v8 { | 16 namespace v8 { |
| 16 namespace internal { | 17 namespace internal { |
| 17 | 18 |
| 18 | 19 |
| 19 IncrementalMarking::StepActions IncrementalMarking::IdleStepActions() { | 20 IncrementalMarking::StepActions IncrementalMarking::IdleStepActions() { |
| 20 return StepActions(IncrementalMarking::NO_GC_VIA_STACK_GUARD, | 21 return StepActions(IncrementalMarking::NO_GC_VIA_STACK_GUARD, |
| 21 IncrementalMarking::FORCE_MARKING, | 22 IncrementalMarking::FORCE_MARKING, |
| 22 IncrementalMarking::DO_NOT_FORCE_COMPLETION); | 23 IncrementalMarking::DO_NOT_FORCE_COMPLETION); |
| 23 } | 24 } |
| (...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 if (!heap_->mark_compact_collector()->sweeping_in_progress()) { | 480 if (!heap_->mark_compact_collector()->sweeping_in_progress()) { |
| 480 StartMarking(); | 481 StartMarking(); |
| 481 } else { | 482 } else { |
| 482 if (FLAG_trace_incremental_marking) { | 483 if (FLAG_trace_incremental_marking) { |
| 483 PrintF("[IncrementalMarking] Start sweeping.\n"); | 484 PrintF("[IncrementalMarking] Start sweeping.\n"); |
| 484 } | 485 } |
| 485 state_ = SWEEPING; | 486 state_ = SWEEPING; |
| 486 } | 487 } |
| 487 | 488 |
| 488 heap_->new_space()->LowerInlineAllocationLimit(kAllocatedThreshold); | 489 heap_->new_space()->LowerInlineAllocationLimit(kAllocatedThreshold); |
| 490 incremental_marking_job()->Start(heap_); |
| 489 } | 491 } |
| 490 | 492 |
| 491 | 493 |
| 492 void IncrementalMarking::StartMarking() { | 494 void IncrementalMarking::StartMarking() { |
| 493 if (FLAG_trace_incremental_marking) { | 495 if (FLAG_trace_incremental_marking) { |
| 494 PrintF("[IncrementalMarking] Start marking\n"); | 496 PrintF("[IncrementalMarking] Start marking\n"); |
| 495 } | 497 } |
| 496 | 498 |
| 497 is_compacting_ = !FLAG_never_compact && | 499 is_compacting_ = !FLAG_never_compact && |
| 498 heap_->mark_compact_collector()->StartCompaction( | 500 heap_->mark_compact_collector()->StartCompaction( |
| (...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1012 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { | 1014 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { |
| 1013 idle_marking_delay_counter_++; | 1015 idle_marking_delay_counter_++; |
| 1014 } | 1016 } |
| 1015 | 1017 |
| 1016 | 1018 |
| 1017 void IncrementalMarking::ClearIdleMarkingDelayCounter() { | 1019 void IncrementalMarking::ClearIdleMarkingDelayCounter() { |
| 1018 idle_marking_delay_counter_ = 0; | 1020 idle_marking_delay_counter_ = 0; |
| 1019 } | 1021 } |
| 1020 } // namespace internal | 1022 } // namespace internal |
| 1021 } // namespace v8 | 1023 } // namespace v8 |
| OLD | NEW |