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 27 matching lines...) Expand all Loading... |
38 deadline, i::IncrementalMarking::NO_GC_VIA_STACK_GUARD, | 38 deadline, i::IncrementalMarking::NO_GC_VIA_STACK_GUARD, |
39 i::IncrementalMarking::FORCE_COMPLETION, i::StepOrigin::kTask); | 39 i::IncrementalMarking::FORCE_COMPLETION, i::StepOrigin::kTask); |
40 heap->FinalizeIncrementalMarkingIfComplete( | 40 heap->FinalizeIncrementalMarkingIfComplete( |
41 GarbageCollectionReason::kFinalizeMarkingViaTask); | 41 GarbageCollectionReason::kFinalizeMarkingViaTask); |
42 } | 42 } |
43 | 43 |
44 void IncrementalMarkingJob::Task::RunInternal() { | 44 void IncrementalMarkingJob::Task::RunInternal() { |
45 Heap* heap = isolate()->heap(); | 45 Heap* heap = isolate()->heap(); |
46 job_->NotifyTask(); | 46 job_->NotifyTask(); |
47 IncrementalMarking* incremental_marking = heap->incremental_marking(); | 47 IncrementalMarking* incremental_marking = heap->incremental_marking(); |
48 if (incremental_marking->IsStopped()) { | |
49 if (heap->IncrementalMarkingLimitReached() != | |
50 Heap::IncrementalMarkingLimit::kNoLimit) { | |
51 heap->StartIncrementalMarking(Heap::kNoGCFlags, | |
52 GarbageCollectionReason::kIdleTask, | |
53 kNoGCCallbackFlags); | |
54 } | |
55 } | |
56 if (!incremental_marking->IsStopped()) { | 48 if (!incremental_marking->IsStopped()) { |
57 Step(heap); | 49 Step(heap); |
58 if (!incremental_marking->IsStopped()) { | 50 if (!incremental_marking->IsStopped()) { |
59 job_->ScheduleTask(heap); | 51 job_->ScheduleTask(heap); |
60 } | 52 } |
61 } | 53 } |
62 } | 54 } |
63 | 55 |
64 } // namespace internal | 56 } // namespace internal |
65 } // namespace v8 | 57 } // namespace v8 |
OLD | NEW |