| 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 111 |
| 112 // Initialize the heap and register it with the isolate. | 112 // Initialize the heap and register it with the isolate. |
| 113 static void Init(Isolate* isolate); | 113 static void Init(Isolate* isolate); |
| 114 | 114 |
| 115 // Verify that all pointers in the heap point to the heap. | 115 // Verify that all pointers in the heap point to the heap. |
| 116 bool Verify() const; | 116 bool Verify() const; |
| 117 | 117 |
| 118 // Print heap sizes. | 118 // Print heap sizes. |
| 119 void PrintSizes() const; | 119 void PrintSizes() const; |
| 120 | 120 |
| 121 // Generates a profile of the current and VM isolate heaps. |
| 122 void Profile(Dart_HeapProfileWriteCallback callback, void* stream) const; |
| 123 |
| 121 private: | 124 private: |
| 122 Heap(); | 125 Heap(); |
| 123 | 126 |
| 124 uword AllocateNew(intptr_t size); | 127 uword AllocateNew(intptr_t size); |
| 125 uword AllocateOld(intptr_t size); | 128 uword AllocateOld(intptr_t size); |
| 126 uword AllocateCode(PageSpace* space, intptr_t size); | 129 uword AllocateCode(PageSpace* space, intptr_t size); |
| 127 | 130 |
| 128 // The different spaces used for allocation. | 131 // The different spaces used for allocation. |
| 129 Scavenger* new_space_; | 132 Scavenger* new_space_; |
| 130 PageSpace* old_space_; | 133 PageSpace* old_space_; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 147 public: | 150 public: |
| 148 NoGCScope() {} | 151 NoGCScope() {} |
| 149 private: | 152 private: |
| 150 DISALLOW_COPY_AND_ASSIGN(NoGCScope); | 153 DISALLOW_COPY_AND_ASSIGN(NoGCScope); |
| 151 }; | 154 }; |
| 152 #endif // defined(DEBUG) | 155 #endif // defined(DEBUG) |
| 153 | 156 |
| 154 } // namespace dart | 157 } // namespace dart |
| 155 | 158 |
| 156 #endif // VM_HEAP_H_ | 159 #endif // VM_HEAP_H_ |
| OLD | NEW |