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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 intptr_t max_old_gen_words, | 151 intptr_t max_old_gen_words, |
152 intptr_t max_external_words); | 152 intptr_t max_external_words); |
153 | 153 |
154 // Verify that all pointers in the heap point to the heap. | 154 // Verify that all pointers in the heap point to the heap. |
155 bool Verify(MarkExpectation mark_expectation = kForbidMarked) const; | 155 bool Verify(MarkExpectation mark_expectation = kForbidMarked) const; |
156 | 156 |
157 // Print heap sizes. | 157 // Print heap sizes. |
158 void PrintSizes() const; | 158 void PrintSizes() const; |
159 | 159 |
160 // Return amount of memory used and capacity in a space, excluding external. | 160 // Return amount of memory used and capacity in a space, excluding external. |
161 intptr_t UsedInWords(Space space) const; | 161 int64_t UsedInWords(Space space) const; |
162 intptr_t CapacityInWords(Space space) const; | 162 int64_t CapacityInWords(Space space) const; |
163 intptr_t ExternalInWords(Space space) const; | 163 int64_t ExternalInWords(Space space) const; |
164 // Return the amount of GCing in microseconds. | 164 // Return the amount of GCing in microseconds. |
165 int64_t GCTimeInMicros(Space space) const; | 165 int64_t GCTimeInMicros(Space space) const; |
166 | 166 |
167 intptr_t Collections(Space space) const; | 167 intptr_t Collections(Space space) const; |
168 | 168 |
169 ObjectSet* CreateAllocatedObjectSet(MarkExpectation mark_expectation) const; | 169 ObjectSet* CreateAllocatedObjectSet(MarkExpectation mark_expectation) const; |
170 | 170 |
171 static const char* GCReasonToString(GCReason gc_reason); | 171 static const char* GCReasonToString(GCReason gc_reason); |
172 | 172 |
173 // Associate a peer with an object. A non-existent peer is equal to NULL. | 173 // Associate a peer with an object. A non-existent peer is equal to NULL. |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 stats_.times_[id] = micros; | 215 stats_.times_[id] = micros; |
216 } | 216 } |
217 | 217 |
218 void RecordData(int id, intptr_t value) { | 218 void RecordData(int id, intptr_t value) { |
219 ASSERT((id >= 0) && (id < GCStats::kDataEntries)); | 219 ASSERT((id >= 0) && (id < GCStats::kDataEntries)); |
220 stats_.data_[id] = value; | 220 stats_.data_[id] = value; |
221 } | 221 } |
222 | 222 |
223 bool gc_in_progress(); | 223 bool gc_in_progress(); |
224 | 224 |
| 225 void UpdateGlobalMaxUsed(); |
| 226 |
225 static bool IsAllocatableInNewSpace(intptr_t size) { | 227 static bool IsAllocatableInNewSpace(intptr_t size) { |
226 return size <= kNewAllocatableSize; | 228 return size <= kNewAllocatableSize; |
227 } | 229 } |
228 | 230 |
229 void PrintToJSONObject(Space space, JSONObject* object) const; | 231 void PrintToJSONObject(Space space, JSONObject* object) const; |
230 | 232 |
231 // The heap map contains the sizes and class ids for the objects in each page. | 233 // The heap map contains the sizes and class ids for the objects in each page. |
232 void PrintHeapMapToJSONStream(Isolate* isolate, JSONStream* stream) { | 234 void PrintHeapMapToJSONStream(Isolate* isolate, JSONStream* stream) { |
233 return old_space_.PrintHeapMapToJSONStream(isolate, stream); | 235 return old_space_.PrintHeapMapToJSONStream(isolate, stream); |
234 } | 236 } |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 // Note: During this scope, the code pages are non-executable. | 365 // Note: During this scope, the code pages are non-executable. |
364 class WritableVMIsolateScope : StackResource { | 366 class WritableVMIsolateScope : StackResource { |
365 public: | 367 public: |
366 explicit WritableVMIsolateScope(Thread* thread); | 368 explicit WritableVMIsolateScope(Thread* thread); |
367 ~WritableVMIsolateScope(); | 369 ~WritableVMIsolateScope(); |
368 }; | 370 }; |
369 | 371 |
370 } // namespace dart | 372 } // namespace dart |
371 | 373 |
372 #endif // VM_HEAP_H_ | 374 #endif // VM_HEAP_H_ |
OLD | NEW |