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-job.h" | 5 #include "src/heap/incremental-marking-job.h" |
6 | 6 |
7 #include "src/base/platform/time.h" | 7 #include "src/base/platform/time.h" |
8 #include "src/heap/heap-inl.h" | 8 #include "src/heap/heap-inl.h" |
9 #include "src/heap/heap.h" | 9 #include "src/heap/heap.h" |
10 #include "src/heap/incremental-marking.h" | 10 #include "src/heap/incremental-marking.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 heap->MonotonicallyIncreasingTimeInMs() + kIncrementalMarkingDelayMs; | 37 heap->MonotonicallyIncreasingTimeInMs() + kIncrementalMarkingDelayMs; |
38 heap->incremental_marking()->AdvanceIncrementalMarking( | 38 heap->incremental_marking()->AdvanceIncrementalMarking( |
39 deadline, i::IncrementalMarking::NO_GC_VIA_STACK_GUARD, | 39 deadline, i::IncrementalMarking::NO_GC_VIA_STACK_GUARD, |
40 i::IncrementalMarking::FORCE_COMPLETION, i::StepOrigin::kTask); | 40 i::IncrementalMarking::FORCE_COMPLETION, i::StepOrigin::kTask); |
41 heap->FinalizeIncrementalMarkingIfComplete( | 41 heap->FinalizeIncrementalMarkingIfComplete( |
42 GarbageCollectionReason::kFinalizeMarkingViaTask); | 42 GarbageCollectionReason::kFinalizeMarkingViaTask); |
43 } | 43 } |
44 | 44 |
45 void IncrementalMarkingJob::Task::RunInternal() { | 45 void IncrementalMarkingJob::Task::RunInternal() { |
46 VMState<GC> state(isolate()); | 46 VMState<GC> state(isolate()); |
47 RuntimeCallTimerScope(isolate(), &RuntimeCallStats::GC_IncrementalMarkingJob); | 47 RuntimeCallTimerScope runtime_timer( |
| 48 isolate(), &RuntimeCallStats::GC_IncrementalMarkingJob); |
48 | 49 |
49 Heap* heap = isolate()->heap(); | 50 Heap* heap = isolate()->heap(); |
50 job_->NotifyTask(); | 51 job_->NotifyTask(); |
51 IncrementalMarking* incremental_marking = heap->incremental_marking(); | 52 IncrementalMarking* incremental_marking = heap->incremental_marking(); |
52 if (incremental_marking->IsStopped()) { | 53 if (incremental_marking->IsStopped()) { |
53 if (heap->IncrementalMarkingLimitReached() != | 54 if (heap->IncrementalMarkingLimitReached() != |
54 Heap::IncrementalMarkingLimit::kNoLimit) { | 55 Heap::IncrementalMarkingLimit::kNoLimit) { |
55 heap->StartIncrementalMarking(Heap::kNoGCFlags, | 56 heap->StartIncrementalMarking(Heap::kNoGCFlags, |
56 GarbageCollectionReason::kIdleTask, | 57 GarbageCollectionReason::kIdleTask, |
57 kNoGCCallbackFlags); | 58 kNoGCCallbackFlags); |
58 } | 59 } |
59 } | 60 } |
60 if (!incremental_marking->IsStopped()) { | 61 if (!incremental_marking->IsStopped()) { |
61 Step(heap); | 62 Step(heap); |
62 if (!incremental_marking->IsStopped()) { | 63 if (!incremental_marking->IsStopped()) { |
63 job_->ScheduleTask(heap); | 64 job_->ScheduleTask(heap); |
64 } | 65 } |
65 } | 66 } |
66 } | 67 } |
67 | 68 |
68 } // namespace internal | 69 } // namespace internal |
69 } // namespace v8 | 70 } // namespace v8 |
OLD | NEW |