OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef VM_PAGES_H_ | 5 #ifndef VM_PAGES_H_ |
6 #define VM_PAGES_H_ | 6 #define VM_PAGES_H_ |
7 | 7 |
8 #include "vm/freelist.h" | 8 #include "vm/freelist.h" |
9 #include "vm/globals.h" | 9 #include "vm/globals.h" |
10 #include "vm/virtual_memory.h" | 10 #include "vm/virtual_memory.h" |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 void SetGrowthControlState(bool state) { | 212 void SetGrowthControlState(bool state) { |
213 page_space_controller_.set_is_enabled(state); | 213 page_space_controller_.set_is_enabled(state); |
214 } | 214 } |
215 | 215 |
216 bool GrowthControlState() { | 216 bool GrowthControlState() { |
217 return page_space_controller_.is_enabled(); | 217 return page_space_controller_.is_enabled(); |
218 } | 218 } |
219 | 219 |
220 void WriteProtect(bool read_only); | 220 void WriteProtect(bool read_only); |
221 | 221 |
| 222 void AddGCTime(int64_t micros) { |
| 223 gc_time_micros_ += micros; |
| 224 } |
| 225 |
| 226 int64_t gc_time_micros() const { |
| 227 return gc_time_micros_; |
| 228 } |
| 229 |
| 230 void IncrementCollections() { |
| 231 collections_++; |
| 232 } |
| 233 |
| 234 intptr_t collections() const { |
| 235 return collections_; |
| 236 } |
| 237 |
222 private: | 238 private: |
223 // Ids for time and data records in Heap::GCStats. | 239 // Ids for time and data records in Heap::GCStats. |
224 enum { | 240 enum { |
225 // Time | 241 // Time |
226 kMarkObjects = 0, | 242 kMarkObjects = 0, |
227 kResetFreeLists = 1, | 243 kResetFreeLists = 1, |
228 kSweepPages = 2, | 244 kSweepPages = 2, |
229 kSweepLargePages = 3, | 245 kSweepLargePages = 3, |
230 // Data | 246 // Data |
231 kGarbageRatio = 0, | 247 kGarbageRatio = 0, |
(...skipping 28 matching lines...) Expand all Loading... |
260 // Various sizes being tracked for this generation. | 276 // Various sizes being tracked for this generation. |
261 intptr_t max_capacity_in_words_; | 277 intptr_t max_capacity_in_words_; |
262 intptr_t capacity_in_words_; | 278 intptr_t capacity_in_words_; |
263 intptr_t used_in_words_; | 279 intptr_t used_in_words_; |
264 | 280 |
265 // Keep track whether a MarkSweep is currently running. | 281 // Keep track whether a MarkSweep is currently running. |
266 bool sweeping_; | 282 bool sweeping_; |
267 | 283 |
268 PageSpaceController page_space_controller_; | 284 PageSpaceController page_space_controller_; |
269 | 285 |
| 286 int64_t gc_time_micros_; |
| 287 intptr_t collections_; |
| 288 |
270 friend class PageSpaceController; | 289 friend class PageSpaceController; |
271 | 290 |
272 DISALLOW_IMPLICIT_CONSTRUCTORS(PageSpace); | 291 DISALLOW_IMPLICIT_CONSTRUCTORS(PageSpace); |
273 }; | 292 }; |
274 | 293 |
275 } // namespace dart | 294 } // namespace dart |
276 | 295 |
277 #endif // VM_PAGES_H_ | 296 #endif // VM_PAGES_H_ |
OLD | NEW |