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 RUNTIME_VM_HEAP_H_ | 5 #ifndef RUNTIME_VM_HEAP_H_ |
6 #define RUNTIME_VM_HEAP_H_ | 6 #define RUNTIME_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 29 matching lines...) Expand all Loading... |
40 #endif | 40 #endif |
41 kObjectIds, | 41 kObjectIds, |
42 kNumWeakSelectors | 42 kNumWeakSelectors |
43 }; | 43 }; |
44 | 44 |
45 enum GCReason { | 45 enum GCReason { |
46 kNewSpace, | 46 kNewSpace, |
47 kPromotion, | 47 kPromotion, |
48 kOldSpace, | 48 kOldSpace, |
49 kFull, | 49 kFull, |
| 50 kIdle, |
50 kGCAtAlloc, | 51 kGCAtAlloc, |
51 kGCTestCase, | 52 kGCTestCase, |
52 }; | 53 }; |
53 | 54 |
54 // Pattern for unused new space and swept old space. | 55 // Pattern for unused new space and swept old space. |
55 static const uint8_t kZapByte = 0xf3; | 56 static const uint8_t kZapByte = 0xf3; |
56 | 57 |
57 ~Heap(); | 58 ~Heap(); |
58 | 59 |
59 Scavenger* new_space() { return &new_space_; } | 60 Scavenger* new_space() { return &new_space_; } |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 // object is found, traversal through the heap space stops at that | 98 // object is found, traversal through the heap space stops at that |
98 // point. | 99 // point. |
99 // The 'visitor' function should return false if the object is not found, | 100 // The 'visitor' function should return false if the object is not found, |
100 // traversal through the heap space continues. | 101 // traversal through the heap space continues. |
101 // Returns null object if nothing is found. | 102 // Returns null object if nothing is found. |
102 RawInstructions* FindObjectInCodeSpace(FindObjectVisitor* visitor) const; | 103 RawInstructions* FindObjectInCodeSpace(FindObjectVisitor* visitor) const; |
103 RawObject* FindOldObject(FindObjectVisitor* visitor) const; | 104 RawObject* FindOldObject(FindObjectVisitor* visitor) const; |
104 RawObject* FindNewObject(FindObjectVisitor* visitor) const; | 105 RawObject* FindNewObject(FindObjectVisitor* visitor) const; |
105 RawObject* FindObject(FindObjectVisitor* visitor) const; | 106 RawObject* FindObject(FindObjectVisitor* visitor) const; |
106 | 107 |
| 108 void NotifyIdle(int64_t deadline); |
| 109 |
107 void CollectGarbage(Space space); | 110 void CollectGarbage(Space space); |
108 void CollectGarbage(Space space, GCReason reason); | 111 void CollectGarbage(Space space, GCReason reason); |
109 void CollectAllGarbage(); | 112 void CollectAllGarbage(); |
110 bool NeedsGarbageCollection() const { | 113 bool NeedsGarbageCollection() const { |
111 return old_space_.NeedsGarbageCollection(); | 114 return old_space_.NeedsGarbageCollection(); |
112 } | 115 } |
113 | 116 |
114 void WaitForSweeperTasks(Thread* thread); | 117 void WaitForSweeperTasks(Thread* thread); |
115 | 118 |
116 // Enables growth control on the page space heaps. This should be | 119 // Enables growth control on the page space heaps. This should be |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 // Note: During this scope, the code pages are non-executable. | 402 // Note: During this scope, the code pages are non-executable. |
400 class WritableVMIsolateScope : StackResource { | 403 class WritableVMIsolateScope : StackResource { |
401 public: | 404 public: |
402 explicit WritableVMIsolateScope(Thread* thread); | 405 explicit WritableVMIsolateScope(Thread* thread); |
403 ~WritableVMIsolateScope(); | 406 ~WritableVMIsolateScope(); |
404 }; | 407 }; |
405 | 408 |
406 } // namespace dart | 409 } // namespace dart |
407 | 410 |
408 #endif // RUNTIME_VM_HEAP_H_ | 411 #endif // RUNTIME_VM_HEAP_H_ |
OLD | NEW |