| OLD | NEW | 
|---|
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/gc-idle-time-handler.h" | 5 #include "src/heap/gc-idle-time-handler.h" | 
| 6 #include "src/heap/gc-tracer.h" | 6 #include "src/heap/gc-tracer.h" | 
| 7 #include "src/utils.h" | 7 #include "src/utils.h" | 
| 8 | 8 | 
| 9 namespace v8 { | 9 namespace v8 { | 
| 10 namespace internal { | 10 namespace internal { | 
| (...skipping 23 matching lines...) Expand all  Loading... | 
| 34     case DO_FULL_GC: | 34     case DO_FULL_GC: | 
| 35       PrintF("full GC"); | 35       PrintF("full GC"); | 
| 36       break; | 36       break; | 
| 37     case DO_FINALIZE_SWEEPING: | 37     case DO_FINALIZE_SWEEPING: | 
| 38       PrintF("finalize sweeping"); | 38       PrintF("finalize sweeping"); | 
| 39       break; | 39       break; | 
| 40   } | 40   } | 
| 41 } | 41 } | 
| 42 | 42 | 
| 43 | 43 | 
|  | 44 void GCIdleTimeHandler::HeapState::Print() { | 
|  | 45   PrintF("contexts_disposed=%d ", contexts_disposed); | 
|  | 46   PrintF("contexts_disposal_rate=%f ", contexts_disposal_rate); | 
|  | 47   PrintF("size_of_objects=%" V8_PTR_PREFIX "d ", size_of_objects); | 
|  | 48   PrintF("incremental_marking_stopped=%d ", incremental_marking_stopped); | 
|  | 49   PrintF("can_start_incremental_marking=%d ", can_start_incremental_marking); | 
|  | 50   PrintF("sweeping_in_progress=%d ", sweeping_in_progress); | 
|  | 51   PrintF("mark_compact_speed=%" V8_PTR_PREFIX "d ", | 
|  | 52          mark_compact_speed_in_bytes_per_ms); | 
|  | 53   PrintF("incremental_marking_speed=%" V8_PTR_PREFIX "d ", | 
|  | 54          incremental_marking_speed_in_bytes_per_ms); | 
|  | 55   PrintF("scavenge_speed=%" V8_PTR_PREFIX "d ", scavenge_speed_in_bytes_per_ms); | 
|  | 56   PrintF("new_space_size=%" V8_PTR_PREFIX "d ", used_new_space_size); | 
|  | 57   PrintF("new_space_capacity=%" V8_PTR_PREFIX "d ", new_space_capacity); | 
|  | 58   PrintF("new_space_allocation_throughput=%" V8_PTR_PREFIX "d", | 
|  | 59          new_space_allocation_throughput_in_bytes_per_ms); | 
|  | 60 } | 
|  | 61 | 
|  | 62 | 
| 44 size_t GCIdleTimeHandler::EstimateMarkingStepSize( | 63 size_t GCIdleTimeHandler::EstimateMarkingStepSize( | 
| 45     size_t idle_time_in_ms, size_t marking_speed_in_bytes_per_ms) { | 64     size_t idle_time_in_ms, size_t marking_speed_in_bytes_per_ms) { | 
| 46   DCHECK(idle_time_in_ms > 0); | 65   DCHECK(idle_time_in_ms > 0); | 
| 47 | 66 | 
| 48   if (marking_speed_in_bytes_per_ms == 0) { | 67   if (marking_speed_in_bytes_per_ms == 0) { | 
| 49     marking_speed_in_bytes_per_ms = kInitialConservativeMarkingSpeed; | 68     marking_speed_in_bytes_per_ms = kInitialConservativeMarkingSpeed; | 
| 50   } | 69   } | 
| 51 | 70 | 
| 52   size_t marking_step_size = marking_speed_in_bytes_per_ms * idle_time_in_ms; | 71   size_t marking_step_size = marking_speed_in_bytes_per_ms * idle_time_in_ms; | 
| 53   if (marking_step_size / marking_speed_in_bytes_per_ms != idle_time_in_ms) { | 72   if (marking_step_size / marking_speed_in_bytes_per_ms != idle_time_in_ms) { | 
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 197   if (heap_state.incremental_marking_stopped && | 216   if (heap_state.incremental_marking_stopped && | 
| 198       !heap_state.can_start_incremental_marking) { | 217       !heap_state.can_start_incremental_marking) { | 
| 199     return GCIdleTimeAction::Nothing(); | 218     return GCIdleTimeAction::Nothing(); | 
| 200   } | 219   } | 
| 201   size_t step_size = EstimateMarkingStepSize( | 220   size_t step_size = EstimateMarkingStepSize( | 
| 202       idle_time_in_ms, heap_state.incremental_marking_speed_in_bytes_per_ms); | 221       idle_time_in_ms, heap_state.incremental_marking_speed_in_bytes_per_ms); | 
| 203   return GCIdleTimeAction::IncrementalMarking(step_size); | 222   return GCIdleTimeAction::IncrementalMarking(step_size); | 
| 204 } | 223 } | 
| 205 } | 224 } | 
| 206 } | 225 } | 
| OLD | NEW | 
|---|