| 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/heap.h" |   10 #include "src/heap/heap.h" | 
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  201   void LeaveNoMarkingScope() { no_marking_scope_depth_--; } |  201   void LeaveNoMarkingScope() { no_marking_scope_depth_--; } | 
|  202  |  202  | 
|  203   void NotifyIncompleteScanOfObject(int unscanned_bytes) { |  203   void NotifyIncompleteScanOfObject(int unscanned_bytes) { | 
|  204     unscanned_bytes_of_large_object_ = unscanned_bytes; |  204     unscanned_bytes_of_large_object_ = unscanned_bytes; | 
|  205   } |  205   } | 
|  206  |  206  | 
|  207   void ClearIdleMarkingDelayCounter(); |  207   void ClearIdleMarkingDelayCounter(); | 
|  208  |  208  | 
|  209   bool IsIdleMarkingDelayCounterLimitReached(); |  209   bool IsIdleMarkingDelayCounterLimitReached(); | 
|  210  |  210  | 
|  211   INLINE(static void MarkObject(Heap* heap, HeapObject* object)); |  211   static void MarkObject(Heap* heap, HeapObject* object); | 
 |  212  | 
 |  213   void IterateBlackObject(HeapObject* object); | 
|  212  |  214  | 
|  213   Heap* heap() const { return heap_; } |  215   Heap* heap() const { return heap_; } | 
|  214  |  216  | 
|  215   IncrementalMarkingJob* incremental_marking_job() { |  217   IncrementalMarkingJob* incremental_marking_job() { | 
|  216     return &incremental_marking_job_; |  218     return &incremental_marking_job_; | 
|  217   } |  219   } | 
|  218  |  220  | 
 |  221   bool black_allocation() { return black_allocation_; } | 
 |  222  | 
|  219  private: |  223  private: | 
|  220   class Observer : public AllocationObserver { |  224   class Observer : public AllocationObserver { | 
|  221    public: |  225    public: | 
|  222     Observer(IncrementalMarking& incremental_marking, intptr_t step_size) |  226     Observer(IncrementalMarking& incremental_marking, intptr_t step_size) | 
|  223         : AllocationObserver(step_size), |  227         : AllocationObserver(step_size), | 
|  224           incremental_marking_(incremental_marking) {} |  228           incremental_marking_(incremental_marking) {} | 
|  225  |  229  | 
|  226     void Step(int bytes_allocated, Address, size_t) override { |  230     void Step(int bytes_allocated, Address, size_t) override { | 
|  227       incremental_marking_.Step(bytes_allocated, |  231       incremental_marking_.Step(bytes_allocated, | 
|  228                                 IncrementalMarking::GC_VIA_STACK_GUARD); |  232                                 IncrementalMarking::GC_VIA_STACK_GUARD); | 
|  229     } |  233     } | 
|  230  |  234  | 
|  231    private: |  235    private: | 
|  232     IncrementalMarking& incremental_marking_; |  236     IncrementalMarking& incremental_marking_; | 
|  233   }; |  237   }; | 
|  234  |  238  | 
|  235   int64_t SpaceLeftInOldSpace(); |  239   int64_t SpaceLeftInOldSpace(); | 
|  236  |  240  | 
|  237   void SpeedUp(); |  241   void SpeedUp(); | 
|  238  |  242  | 
|  239   void ResetStepCounters(); |  243   void ResetStepCounters(); | 
|  240  |  244  | 
|  241   void StartMarking(); |  245   void StartMarking(); | 
|  242  |  246  | 
 |  247   void StartBlackAllocation(); | 
 |  248   void FinishBlackAllocation(); | 
 |  249  | 
|  243   void MarkRoots(); |  250   void MarkRoots(); | 
|  244   void MarkObjectGroups(); |  251   void MarkObjectGroups(); | 
|  245   void ProcessWeakCells(); |  252   void ProcessWeakCells(); | 
|  246   // Retain dying maps for <FLAG_retain_maps_for_n_gc> garbage collections to |  253   // Retain dying maps for <FLAG_retain_maps_for_n_gc> garbage collections to | 
|  247   // increase chances of reusing of map transition tree in future. |  254   // increase chances of reusing of map transition tree in future. | 
|  248   void RetainMaps(); |  255   void RetainMaps(); | 
|  249  |  256  | 
|  250   void ActivateIncrementalWriteBarrier(PagedSpace* space); |  257   void ActivateIncrementalWriteBarrier(PagedSpace* space); | 
|  251   static void ActivateIncrementalWriteBarrier(NewSpace* space); |  258   static void ActivateIncrementalWriteBarrier(NewSpace* space); | 
|  252   void ActivateIncrementalWriteBarrier(); |  259   void ActivateIncrementalWriteBarrier(); | 
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  285   intptr_t allocated_; |  292   intptr_t allocated_; | 
|  286   intptr_t write_barriers_invoked_since_last_step_; |  293   intptr_t write_barriers_invoked_since_last_step_; | 
|  287   size_t idle_marking_delay_counter_; |  294   size_t idle_marking_delay_counter_; | 
|  288  |  295  | 
|  289   int no_marking_scope_depth_; |  296   int no_marking_scope_depth_; | 
|  290  |  297  | 
|  291   int unscanned_bytes_of_large_object_; |  298   int unscanned_bytes_of_large_object_; | 
|  292  |  299  | 
|  293   bool was_activated_; |  300   bool was_activated_; | 
|  294  |  301  | 
 |  302   bool black_allocation_; | 
 |  303  | 
|  295   bool finalize_marking_completed_; |  304   bool finalize_marking_completed_; | 
|  296  |  305  | 
|  297   int incremental_marking_finalization_rounds_; |  306   int incremental_marking_finalization_rounds_; | 
|  298  |  307  | 
|  299   GCRequestType request_type_; |  308   GCRequestType request_type_; | 
|  300  |  309  | 
|  301   IncrementalMarkingJob incremental_marking_job_; |  310   IncrementalMarkingJob incremental_marking_job_; | 
|  302  |  311  | 
|  303   DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking); |  312   DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking); | 
|  304 }; |  313 }; | 
|  305 }  // namespace internal |  314 }  // namespace internal | 
|  306 }  // namespace v8 |  315 }  // namespace v8 | 
|  307  |  316  | 
|  308 #endif  // V8_HEAP_INCREMENTAL_MARKING_H_ |  317 #endif  // V8_HEAP_INCREMENTAL_MARKING_H_ | 
| OLD | NEW |