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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
169 // Returns the [lowest, highest) addresses in the heap. | 169 // Returns the [lowest, highest) addresses in the heap. |
170 void StartEndAddress(uword* start, uword* end) const; | 170 void StartEndAddress(uword* start, uword* end) const; |
171 | 171 |
172 ObjectSet* CreateAllocatedObjectSet() const; | 172 ObjectSet* CreateAllocatedObjectSet() const; |
173 | 173 |
174 // Generates a profile of the current and VM isolate heaps. | |
175 void Profile(Dart_FileWriteCallback callback, void* stream) const; | |
176 void ProfileToFile(const char* reason) const; | |
177 | |
178 static const char* GCReasonToString(GCReason gc_reason); | 174 static const char* GCReasonToString(GCReason gc_reason); |
179 | 175 |
180 // Associate a peer with an object. A non-existent peer is equal to NULL. | 176 // Associate a peer with an object. A non-existent peer is equal to NULL. |
181 void SetPeer(RawObject* raw_obj, void* peer) { | 177 void SetPeer(RawObject* raw_obj, void* peer) { |
182 SetWeakEntry(raw_obj, kPeers, reinterpret_cast<intptr_t>(peer)); | 178 SetWeakEntry(raw_obj, kPeers, reinterpret_cast<intptr_t>(peer)); |
183 } | 179 } |
184 void* GetPeer(RawObject* raw_obj) const { | 180 void* GetPeer(RawObject* raw_obj) const { |
185 return reinterpret_cast<void*>(GetWeakEntry(raw_obj, kPeers)); | 181 return reinterpret_cast<void*>(GetWeakEntry(raw_obj, kPeers)); |
186 } | 182 } |
187 int64_t PeerCount() const; | 183 int64_t PeerCount() const; |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 NoHeapGrowthControlScope(); | 319 NoHeapGrowthControlScope(); |
324 ~NoHeapGrowthControlScope(); | 320 ~NoHeapGrowthControlScope(); |
325 private: | 321 private: |
326 bool current_growth_controller_state_; | 322 bool current_growth_controller_state_; |
327 DISALLOW_COPY_AND_ASSIGN(NoHeapGrowthControlScope); | 323 DISALLOW_COPY_AND_ASSIGN(NoHeapGrowthControlScope); |
328 }; | 324 }; |
329 | 325 |
330 } // namespace dart | 326 } // namespace dart |
331 | 327 |
332 #endif // VM_HEAP_H_ | 328 #endif // VM_HEAP_H_ |
OLD | NEW |