Chromium Code Reviews| 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 158 | 158 |
| 159 // Verify that all pointers in the heap point to the heap. | 159 // Verify that all pointers in the heap point to the heap. |
| 160 bool Verify() const; | 160 bool Verify() const; |
| 161 | 161 |
| 162 // Print heap sizes. | 162 // Print heap sizes. |
| 163 void PrintSizes() const; | 163 void PrintSizes() const; |
| 164 | 164 |
| 165 // Return amount of memory used and capacity in a space. | 165 // Return amount of memory used and capacity in a space. |
| 166 intptr_t UsedInWords(Space space) const; | 166 intptr_t UsedInWords(Space space) const; |
| 167 intptr_t CapacityInWords(Space space) const; | 167 intptr_t CapacityInWords(Space space) const; |
| 168 | 168 // Return the amount of GCing in microseconds. |
| 169 int64_t GCTimeInMicros(Space space) const; | |
| 170 double GCTimeInSeconds(Space space) const; | |
|
Ivan Posva
2014/01/17 06:53:16
Why do you need both? Micros and Seconds?
Cutch
2014/01/17 18:37:59
Removed Seconds.
| |
| 171 intptr_t Collections(Space space) const; | |
| 169 // Returns the [lowest, highest) addresses in the heap. | 172 // Returns the [lowest, highest) addresses in the heap. |
| 170 void StartEndAddress(uword* start, uword* end) const; | 173 void StartEndAddress(uword* start, uword* end) const; |
| 171 | 174 |
| 172 ObjectSet* CreateAllocatedObjectSet() const; | 175 ObjectSet* CreateAllocatedObjectSet() const; |
| 173 | 176 |
| 174 // Generates a profile of the current and VM isolate heaps. | 177 // Generates a profile of the current and VM isolate heaps. |
| 175 void Profile(Dart_FileWriteCallback callback, void* stream) const; | 178 void Profile(Dart_FileWriteCallback callback, void* stream) const; |
| 176 void ProfileToFile(const char* reason) const; | 179 void ProfileToFile(const char* reason) const; |
| 177 | 180 |
| 178 static const char* GCReasonToString(GCReason gc_reason); | 181 static const char* GCReasonToString(GCReason gc_reason); |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 271 Heap(); | 274 Heap(); |
| 272 | 275 |
| 273 uword AllocateNew(intptr_t size); | 276 uword AllocateNew(intptr_t size); |
| 274 uword AllocateOld(intptr_t size, HeapPage::PageType type); | 277 uword AllocateOld(intptr_t size, HeapPage::PageType type); |
| 275 | 278 |
| 276 // GC stats collection. | 279 // GC stats collection. |
| 277 void RecordBeforeGC(Space space, GCReason reason); | 280 void RecordBeforeGC(Space space, GCReason reason); |
| 278 void RecordAfterGC(); | 281 void RecordAfterGC(); |
| 279 void PrintStats(); | 282 void PrintStats(); |
| 280 void UpdateObjectHistogram(); | 283 void UpdateObjectHistogram(); |
| 284 void UpdateClassHeapStatsBeforeGC(Heap::Space space); | |
| 281 | 285 |
| 282 // The different spaces used for allocation. | 286 // The different spaces used for allocation. |
| 283 Scavenger* new_space_; | 287 Scavenger* new_space_; |
| 284 PageSpace* old_space_; | 288 PageSpace* old_space_; |
| 285 | 289 |
| 286 WeakTable* new_weak_tables_[kNumWeakSelectors]; | 290 WeakTable* new_weak_tables_[kNumWeakSelectors]; |
| 287 WeakTable* old_weak_tables_[kNumWeakSelectors]; | 291 WeakTable* old_weak_tables_[kNumWeakSelectors]; |
| 288 | 292 |
| 289 // GC stats collection. | 293 // GC stats collection. |
| 290 GCStats stats_; | 294 GCStats stats_; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 323 NoHeapGrowthControlScope(); | 327 NoHeapGrowthControlScope(); |
| 324 ~NoHeapGrowthControlScope(); | 328 ~NoHeapGrowthControlScope(); |
| 325 private: | 329 private: |
| 326 bool current_growth_controller_state_; | 330 bool current_growth_controller_state_; |
| 327 DISALLOW_COPY_AND_ASSIGN(NoHeapGrowthControlScope); | 331 DISALLOW_COPY_AND_ASSIGN(NoHeapGrowthControlScope); |
| 328 }; | 332 }; |
| 329 | 333 |
| 330 } // namespace dart | 334 } // namespace dart |
| 331 | 335 |
| 332 #endif // VM_HEAP_H_ | 336 #endif // VM_HEAP_H_ |
| OLD | NEW |