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 #ifndef V8_HEAP_INCREMENTAL_MARKING_H_ | 5 #ifndef V8_HEAP_INCREMENTAL_MARKING_H_ |
6 #define V8_HEAP_INCREMENTAL_MARKING_H_ | 6 #define V8_HEAP_INCREMENTAL_MARKING_H_ |
7 | 7 |
8 #include "src/cancelable-task.h" | 8 #include "src/cancelable-task.h" |
9 #include "src/execution.h" | 9 #include "src/execution.h" |
10 #include "src/heap/incremental-marking-job.h" | 10 #include "src/heap/incremental-marking-job.h" |
| 11 #include "src/heap/spaces.h" |
11 #include "src/objects.h" | 12 #include "src/objects.h" |
12 | 13 |
13 namespace v8 { | 14 namespace v8 { |
14 namespace internal { | 15 namespace internal { |
15 | 16 |
16 // Forward declarations. | 17 // Forward declarations. |
17 class MarkBit; | 18 class MarkBit; |
18 class PagedSpace; | 19 class PagedSpace; |
19 | 20 |
20 class IncrementalMarking { | 21 class IncrementalMarking { |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 | 208 |
208 INLINE(static void MarkObject(Heap* heap, HeapObject* object)); | 209 INLINE(static void MarkObject(Heap* heap, HeapObject* object)); |
209 | 210 |
210 Heap* heap() const { return heap_; } | 211 Heap* heap() const { return heap_; } |
211 | 212 |
212 IncrementalMarkingJob* incremental_marking_job() { | 213 IncrementalMarkingJob* incremental_marking_job() { |
213 return &incremental_marking_job_; | 214 return &incremental_marking_job_; |
214 } | 215 } |
215 | 216 |
216 private: | 217 private: |
| 218 class Observer : public InlineAllocationObserver { |
| 219 public: |
| 220 Observer(IncrementalMarking& incremental_marking, intptr_t step_size) |
| 221 : InlineAllocationObserver(step_size), |
| 222 incremental_marking_(incremental_marking) {} |
| 223 |
| 224 virtual void Step(int bytes_allocated) { |
| 225 incremental_marking_.Step(bytes_allocated, |
| 226 IncrementalMarking::GC_VIA_STACK_GUARD); |
| 227 } |
| 228 |
| 229 private: |
| 230 IncrementalMarking& incremental_marking_; |
| 231 }; |
| 232 |
217 int64_t SpaceLeftInOldSpace(); | 233 int64_t SpaceLeftInOldSpace(); |
218 | 234 |
219 void SpeedUp(); | 235 void SpeedUp(); |
220 | 236 |
221 void ResetStepCounters(); | 237 void ResetStepCounters(); |
222 | 238 |
223 void StartMarking(); | 239 void StartMarking(); |
224 | 240 |
225 void MarkRoots(); | 241 void MarkRoots(); |
226 void MarkObjectGroups(); | 242 void MarkObjectGroups(); |
(...skipping 14 matching lines...) Expand all Loading... |
241 INLINE(void ProcessMarkingDeque()); | 257 INLINE(void ProcessMarkingDeque()); |
242 | 258 |
243 INLINE(intptr_t ProcessMarkingDeque(intptr_t bytes_to_process)); | 259 INLINE(intptr_t ProcessMarkingDeque(intptr_t bytes_to_process)); |
244 | 260 |
245 INLINE(void VisitObject(Map* map, HeapObject* obj, int size)); | 261 INLINE(void VisitObject(Map* map, HeapObject* obj, int size)); |
246 | 262 |
247 void IncrementIdleMarkingDelayCounter(); | 263 void IncrementIdleMarkingDelayCounter(); |
248 | 264 |
249 Heap* heap_; | 265 Heap* heap_; |
250 | 266 |
| 267 Observer observer_; |
| 268 |
251 State state_; | 269 State state_; |
252 bool is_compacting_; | 270 bool is_compacting_; |
253 | 271 |
254 int steps_count_; | 272 int steps_count_; |
255 int64_t old_generation_space_available_at_start_of_incremental_; | 273 int64_t old_generation_space_available_at_start_of_incremental_; |
256 int64_t old_generation_space_used_at_start_of_incremental_; | 274 int64_t old_generation_space_used_at_start_of_incremental_; |
257 int64_t bytes_rescanned_; | 275 int64_t bytes_rescanned_; |
258 bool should_hurry_; | 276 bool should_hurry_; |
259 int marking_speed_; | 277 int marking_speed_; |
260 intptr_t bytes_scanned_; | 278 intptr_t bytes_scanned_; |
(...skipping 14 matching lines...) Expand all Loading... |
275 GCRequestType request_type_; | 293 GCRequestType request_type_; |
276 | 294 |
277 IncrementalMarkingJob incremental_marking_job_; | 295 IncrementalMarkingJob incremental_marking_job_; |
278 | 296 |
279 DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking); | 297 DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking); |
280 }; | 298 }; |
281 } // namespace internal | 299 } // namespace internal |
282 } // namespace v8 | 300 } // namespace v8 |
283 | 301 |
284 #endif // V8_HEAP_INCREMENTAL_MARKING_H_ | 302 #endif // V8_HEAP_INCREMENTAL_MARKING_H_ |
OLD | NEW |