| 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 #ifndef V8_HEAP_GC_IDLE_TIME_HANDLER_H_ | 5 #ifndef V8_HEAP_GC_IDLE_TIME_HANDLER_H_ |
| 6 #define V8_HEAP_GC_IDLE_TIME_HANDLER_H_ | 6 #define V8_HEAP_GC_IDLE_TIME_HANDLER_H_ |
| 7 | 7 |
| 8 #include "src/globals.h" | 8 #include "src/globals.h" |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 size_t scavenge_speed_in_bytes_per_ms; | 131 size_t scavenge_speed_in_bytes_per_ms; |
| 132 size_t used_new_space_size; | 132 size_t used_new_space_size; |
| 133 size_t new_space_capacity; | 133 size_t new_space_capacity; |
| 134 size_t new_space_allocation_throughput_in_bytes_per_ms; | 134 size_t new_space_allocation_throughput_in_bytes_per_ms; |
| 135 }; | 135 }; |
| 136 | 136 |
| 137 GCIdleTimeHandler() | 137 GCIdleTimeHandler() |
| 138 : mark_compacts_since_idle_round_started_(0), | 138 : mark_compacts_since_idle_round_started_(0), |
| 139 scavenges_since_last_idle_round_(0) {} | 139 scavenges_since_last_idle_round_(0) {} |
| 140 | 140 |
| 141 GCIdleTimeAction Compute(size_t idle_time_in_ms, HeapState heap_state); | 141 GCIdleTimeAction Compute(double idle_time, HeapState heap_state); |
| 142 | 142 |
| 143 void NotifyIdleMarkCompact() { | 143 void NotifyIdleMarkCompact() { |
| 144 if (mark_compacts_since_idle_round_started_ < kMaxMarkCompactsInIdleRound) { | 144 if (mark_compacts_since_idle_round_started_ < kMaxMarkCompactsInIdleRound) { |
| 145 ++mark_compacts_since_idle_round_started_; | 145 ++mark_compacts_since_idle_round_started_; |
| 146 if (mark_compacts_since_idle_round_started_ == | 146 if (mark_compacts_since_idle_round_started_ == |
| 147 kMaxMarkCompactsInIdleRound) { | 147 kMaxMarkCompactsInIdleRound) { |
| 148 scavenges_since_last_idle_round_ = 0; | 148 scavenges_since_last_idle_round_ = 0; |
| 149 } | 149 } |
| 150 } | 150 } |
| 151 } | 151 } |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 int mark_compacts_since_idle_round_started_; | 183 int mark_compacts_since_idle_round_started_; |
| 184 int scavenges_since_last_idle_round_; | 184 int scavenges_since_last_idle_round_; |
| 185 | 185 |
| 186 DISALLOW_COPY_AND_ASSIGN(GCIdleTimeHandler); | 186 DISALLOW_COPY_AND_ASSIGN(GCIdleTimeHandler); |
| 187 }; | 187 }; |
| 188 | 188 |
| 189 } // namespace internal | 189 } // namespace internal |
| 190 } // namespace v8 | 190 } // namespace v8 |
| 191 | 191 |
| 192 #endif // V8_HEAP_GC_IDLE_TIME_HANDLER_H_ | 192 #endif // V8_HEAP_GC_IDLE_TIME_HANDLER_H_ |
| OLD | NEW |