| 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 // Initialize the heap and register it with the isolate. | 155 // Initialize the heap and register it with the isolate. |
| 156 static void Init(Isolate* isolate); | 156 static void Init(Isolate* isolate); |
| 157 | 157 |
| 158 // Verify that all pointers in the heap point to the heap. | 158 // Verify that all pointers in the heap point to the heap. |
| 159 bool Verify() const; | 159 bool Verify() const; |
| 160 | 160 |
| 161 // Print heap sizes. | 161 // Print heap sizes. |
| 162 void PrintSizes() const; | 162 void PrintSizes() const; |
| 163 | 163 |
| 164 // Return amount of memory used and capacity in a space. | 164 // Return amount of memory used and capacity in a space. |
| 165 intptr_t Used(Space space) const; | 165 intptr_t UsedInWords(Space space) const; |
| 166 intptr_t Capacity(Space space) const; | 166 intptr_t CapacityInWords(Space space) const; |
| 167 | 167 |
| 168 // Returns the [lowest, highest) addresses in the heap. | 168 // Returns the [lowest, highest) addresses in the heap. |
| 169 void StartEndAddress(uword* start, uword* end) const; | 169 void StartEndAddress(uword* start, uword* end) const; |
| 170 | 170 |
| 171 ObjectSet* CreateAllocatedObjectSet() const; | 171 ObjectSet* CreateAllocatedObjectSet() const; |
| 172 | 172 |
| 173 // Generates a profile of the current and VM isolate heaps. | 173 // Generates a profile of the current and VM isolate heaps. |
| 174 void Profile(Dart_FileWriteCallback callback, void* stream) const; | 174 void Profile(Dart_FileWriteCallback callback, void* stream) const; |
| 175 void ProfileToFile(const char* reason) const; | 175 void ProfileToFile(const char* reason) const; |
| 176 | 176 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 public: | 237 public: |
| 238 GCStats() {} | 238 GCStats() {} |
| 239 intptr_t num_; | 239 intptr_t num_; |
| 240 Heap::Space space_; | 240 Heap::Space space_; |
| 241 Heap::GCReason reason_; | 241 Heap::GCReason reason_; |
| 242 | 242 |
| 243 class Data : public ValueObject { | 243 class Data : public ValueObject { |
| 244 public: | 244 public: |
| 245 Data() {} | 245 Data() {} |
| 246 int64_t micros_; | 246 int64_t micros_; |
| 247 intptr_t new_used_; | 247 intptr_t new_used_in_words_; |
| 248 intptr_t new_capacity_; | 248 intptr_t new_capacity_in_words_; |
| 249 intptr_t old_used_; | 249 intptr_t old_used_in_words_; |
| 250 intptr_t old_capacity_; | 250 intptr_t old_capacity_in_words_; |
| 251 private: | 251 private: |
| 252 DISALLOW_COPY_AND_ASSIGN(Data); | 252 DISALLOW_COPY_AND_ASSIGN(Data); |
| 253 }; | 253 }; |
| 254 | 254 |
| 255 enum { | 255 enum { |
| 256 kDataEntries = 4 | 256 kDataEntries = 4 |
| 257 }; | 257 }; |
| 258 | 258 |
| 259 Data before_; | 259 Data before_; |
| 260 Data after_; | 260 Data after_; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 NoHeapGrowthControlScope(); | 322 NoHeapGrowthControlScope(); |
| 323 ~NoHeapGrowthControlScope(); | 323 ~NoHeapGrowthControlScope(); |
| 324 private: | 324 private: |
| 325 bool current_growth_controller_state_; | 325 bool current_growth_controller_state_; |
| 326 DISALLOW_COPY_AND_ASSIGN(NoHeapGrowthControlScope); | 326 DISALLOW_COPY_AND_ASSIGN(NoHeapGrowthControlScope); |
| 327 }; | 327 }; |
| 328 | 328 |
| 329 } // namespace dart | 329 } // namespace dart |
| 330 | 330 |
| 331 #endif // VM_HEAP_H_ | 331 #endif // VM_HEAP_H_ |
| OLD | NEW |