Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(270)

Side by Side Diff: src/heap/incremental-marking-job.cc

Issue 1374203002: [heap] No leakage of incremental-marking.h outside of heap. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/heap/incremental-marking.cc ('k') | src/heap/memory-reducer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 MarkCompactCollector* mark_compact_collector = heap->mark_compact_collector(); 70 MarkCompactCollector* mark_compact_collector = heap->mark_compact_collector();
71 if (incremental_marking->IsStopped()) { 71 if (incremental_marking->IsStopped()) {
72 return kDone; 72 return kDone;
73 } 73 }
74 if (mark_compact_collector->sweeping_in_progress()) { 74 if (mark_compact_collector->sweeping_in_progress()) {
75 if (mark_compact_collector->IsSweepingCompleted()) { 75 if (mark_compact_collector->IsSweepingCompleted()) {
76 mark_compact_collector->EnsureSweepingCompleted(); 76 mark_compact_collector->EnsureSweepingCompleted();
77 } 77 }
78 return kMoreWork; 78 return kMoreWork;
79 } 79 }
80 const double remaining_idle_time_in_ms = heap->AdvanceIncrementalMarking( 80 const double remaining_idle_time_in_ms =
81 0, deadline_in_ms, IncrementalMarking::IdleStepActions()); 81 incremental_marking->AdvanceIncrementalMarking(
82 0, deadline_in_ms, IncrementalMarking::IdleStepActions());
82 if (remaining_idle_time_in_ms > 0.0) { 83 if (remaining_idle_time_in_ms > 0.0) {
83 heap->TryFinalizeIdleIncrementalMarking(remaining_idle_time_in_ms); 84 heap->TryFinalizeIdleIncrementalMarking(remaining_idle_time_in_ms);
84 } 85 }
85 return incremental_marking->IsStopped() ? kDone : kMoreWork; 86 return incremental_marking->IsStopped() ? kDone : kMoreWork;
86 } 87 }
87 88
88 89
89 void IncrementalMarkingJob::IdleTask::RunInternal(double deadline_in_seconds) { 90 void IncrementalMarkingJob::IdleTask::RunInternal(double deadline_in_seconds) {
90 double deadline_in_ms = 91 double deadline_in_ms =
91 deadline_in_seconds * 92 deadline_in_seconds *
(...skipping 16 matching lines...) Expand all
108 idle_time_in_ms, idle_time_in_ms - deadline_difference, 109 idle_time_in_ms, idle_time_in_ms - deadline_difference,
109 deadline_difference); 110 deadline_difference);
110 } 111 }
111 } 112 }
112 113
113 114
114 void IncrementalMarkingJob::DelayedTask::Step(Heap* heap) { 115 void IncrementalMarkingJob::DelayedTask::Step(Heap* heap) {
115 const int kIncrementalMarkingDelayMs = 50; 116 const int kIncrementalMarkingDelayMs = 50;
116 double deadline = 117 double deadline =
117 heap->MonotonicallyIncreasingTimeInMs() + kIncrementalMarkingDelayMs; 118 heap->MonotonicallyIncreasingTimeInMs() + kIncrementalMarkingDelayMs;
118 heap->AdvanceIncrementalMarking( 119 heap->incremental_marking()->AdvanceIncrementalMarking(
119 0, deadline, i::IncrementalMarking::StepActions( 120 0, deadline, i::IncrementalMarking::StepActions(
120 i::IncrementalMarking::NO_GC_VIA_STACK_GUARD, 121 i::IncrementalMarking::NO_GC_VIA_STACK_GUARD,
121 i::IncrementalMarking::FORCE_MARKING, 122 i::IncrementalMarking::FORCE_MARKING,
122 i::IncrementalMarking::FORCE_COMPLETION)); 123 i::IncrementalMarking::FORCE_COMPLETION));
123 heap->FinalizeIncrementalMarkingIfComplete( 124 heap->FinalizeIncrementalMarkingIfComplete(
124 "Incremental marking task: finalize incremental marking"); 125 "Incremental marking task: finalize incremental marking");
125 } 126 }
126 127
127 128
128 void IncrementalMarkingJob::DelayedTask::RunInternal() { 129 void IncrementalMarkingJob::DelayedTask::RunInternal() {
129 Heap* heap = isolate_->heap(); 130 Heap* heap = isolate_->heap();
130 job_->NotifyDelayedTask(); 131 job_->NotifyDelayedTask();
131 IncrementalMarking* incremental_marking = heap->incremental_marking(); 132 IncrementalMarking* incremental_marking = heap->incremental_marking();
132 if (!incremental_marking->IsStopped()) { 133 if (!incremental_marking->IsStopped()) {
133 if (job_->ShouldForceMarkingStep()) { 134 if (job_->ShouldForceMarkingStep()) {
134 Step(heap); 135 Step(heap);
135 } 136 }
136 // The Step() above could have finished incremental marking. 137 // The Step() above could have finished incremental marking.
137 if (!incremental_marking->IsStopped()) { 138 if (!incremental_marking->IsStopped()) {
138 job_->ScheduleDelayedTask(heap); 139 job_->ScheduleDelayedTask(heap);
139 } 140 }
140 } 141 }
141 } 142 }
142 143
143 } // namespace internal 144 } // namespace internal
144 } // namespace v8 145 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/incremental-marking.cc ('k') | src/heap/memory-reducer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698