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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 size_t scavenge_speed_in_bytes_per_ms; | 141 size_t scavenge_speed_in_bytes_per_ms; |
142 size_t used_new_space_size; | 142 size_t used_new_space_size; |
143 size_t new_space_capacity; | 143 size_t new_space_capacity; |
144 size_t new_space_allocation_throughput_in_bytes_per_ms; | 144 size_t new_space_allocation_throughput_in_bytes_per_ms; |
145 }; | 145 }; |
146 | 146 |
147 GCIdleTimeHandler() | 147 GCIdleTimeHandler() |
148 : mark_compacts_since_idle_round_started_(0), | 148 : mark_compacts_since_idle_round_started_(0), |
149 scavenges_since_last_idle_round_(0) {} | 149 scavenges_since_last_idle_round_(0) {} |
150 | 150 |
151 GCIdleTimeAction Compute(size_t idle_time_in_ms, HeapState heap_state); | 151 GCIdleTimeAction Compute(double idle_time_in_ms, HeapState heap_state); |
152 | 152 |
153 void NotifyIdleMarkCompact() { | 153 void NotifyIdleMarkCompact() { |
154 if (mark_compacts_since_idle_round_started_ < kMaxMarkCompactsInIdleRound) { | 154 if (mark_compacts_since_idle_round_started_ < kMaxMarkCompactsInIdleRound) { |
155 ++mark_compacts_since_idle_round_started_; | 155 ++mark_compacts_since_idle_round_started_; |
156 if (mark_compacts_since_idle_round_started_ == | 156 if (mark_compacts_since_idle_round_started_ == |
157 kMaxMarkCompactsInIdleRound) { | 157 kMaxMarkCompactsInIdleRound) { |
158 scavenges_since_last_idle_round_ = 0; | 158 scavenges_since_last_idle_round_ = 0; |
159 } | 159 } |
160 } | 160 } |
161 } | 161 } |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 int mark_compacts_since_idle_round_started_; | 200 int mark_compacts_since_idle_round_started_; |
201 int scavenges_since_last_idle_round_; | 201 int scavenges_since_last_idle_round_; |
202 | 202 |
203 DISALLOW_COPY_AND_ASSIGN(GCIdleTimeHandler); | 203 DISALLOW_COPY_AND_ASSIGN(GCIdleTimeHandler); |
204 }; | 204 }; |
205 | 205 |
206 } // namespace internal | 206 } // namespace internal |
207 } // namespace v8 | 207 } // namespace v8 |
208 | 208 |
209 #endif // V8_HEAP_GC_IDLE_TIME_HANDLER_H_ | 209 #endif // V8_HEAP_GC_IDLE_TIME_HANDLER_H_ |
OLD | NEW |