| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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_HEAP_H_ | 5 #ifndef VM_HEAP_H_ |
| 6 #define VM_HEAP_H_ | 6 #define VM_HEAP_H_ |
| 7 | 7 |
| 8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 #include "vm/allocation.h" | 9 #include "vm/allocation.h" |
| 10 #include "vm/flags.h" | 10 #include "vm/flags.h" |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 | 256 |
| 257 private: | 257 private: |
| 258 class GCStats : public ValueObject { | 258 class GCStats : public ValueObject { |
| 259 public: | 259 public: |
| 260 GCStats() {} | 260 GCStats() {} |
| 261 intptr_t num_; | 261 intptr_t num_; |
| 262 Heap::Space space_; | 262 Heap::Space space_; |
| 263 Heap::GCReason reason_; | 263 Heap::GCReason reason_; |
| 264 | 264 |
| 265 class Data : public ValueObject { | 265 class Data : public ValueObject { |
| 266 public: | 266 public: |
| 267 Data() {} | 267 Data() {} |
| 268 int64_t micros_; | 268 int64_t micros_; |
| 269 SpaceUsage new_; | 269 SpaceUsage new_; |
| 270 SpaceUsage old_; | 270 SpaceUsage old_; |
| 271 private: | 271 private: |
| 272 DISALLOW_COPY_AND_ASSIGN(Data); | 272 DISALLOW_COPY_AND_ASSIGN(Data); |
| 273 }; | 273 }; |
| 274 | 274 |
| 275 enum { | 275 enum { |
| 276 kDataEntries = 4 | 276 kDataEntries = 4 |
| 277 }; | 277 }; |
| 278 | 278 |
| 279 Data before_; | 279 Data before_; |
| 280 Data after_; | 280 Data after_; |
| 281 int64_t times_[kDataEntries]; | 281 int64_t times_[kDataEntries]; |
| 282 intptr_t data_[kDataEntries]; | 282 intptr_t data_[kDataEntries]; |
| 283 | 283 |
| 284 private: | 284 private: |
| 285 DISALLOW_COPY_AND_ASSIGN(GCStats); | 285 DISALLOW_COPY_AND_ASSIGN(GCStats); |
| 286 }; | 286 }; |
| 287 | 287 |
| 288 static const intptr_t kNewAllocatableSize = 256 * KB; | 288 static const intptr_t kNewAllocatableSize = 256 * KB; |
| 289 | 289 |
| 290 Heap(Isolate* isolate, | 290 Heap(Isolate* isolate, |
| 291 intptr_t max_new_gen_words, | 291 intptr_t max_new_gen_semi_words, // Max capacity of new semi-space. |
| 292 intptr_t max_old_gen_words); | 292 intptr_t max_old_gen_words); |
| 293 | 293 |
| 294 uword AllocateNew(intptr_t size); | 294 uword AllocateNew(intptr_t size); |
| 295 uword AllocateOld(intptr_t size, HeapPage::PageType type); | 295 uword AllocateOld(intptr_t size, HeapPage::PageType type); |
| 296 | 296 |
| 297 // GC stats collection. | 297 // GC stats collection. |
| 298 void RecordBeforeGC(Space space, GCReason reason); | 298 void RecordBeforeGC(Space space, GCReason reason); |
| 299 void RecordAfterGC(); | 299 void RecordAfterGC(); |
| 300 void PrintStats(); | 300 void PrintStats(); |
| 301 void UpdateClassHeapStatsBeforeGC(Heap::Space space); | 301 void UpdateClassHeapStatsBeforeGC(Heap::Space space); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 NoHeapGrowthControlScope(); | 351 NoHeapGrowthControlScope(); |
| 352 ~NoHeapGrowthControlScope(); | 352 ~NoHeapGrowthControlScope(); |
| 353 private: | 353 private: |
| 354 bool current_growth_controller_state_; | 354 bool current_growth_controller_state_; |
| 355 DISALLOW_COPY_AND_ASSIGN(NoHeapGrowthControlScope); | 355 DISALLOW_COPY_AND_ASSIGN(NoHeapGrowthControlScope); |
| 356 }; | 356 }; |
| 357 | 357 |
| 358 } // namespace dart | 358 } // namespace dart |
| 359 | 359 |
| 360 #endif // VM_HEAP_H_ | 360 #endif // VM_HEAP_H_ |
| OLD | NEW |