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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 RawInstructions* FindObjectInStubCodeSpace(FindObjectVisitor* visitor); | 110 RawInstructions* FindObjectInStubCodeSpace(FindObjectVisitor* visitor); |
111 | 111 |
112 void CollectGarbage(Space space); | 112 void CollectGarbage(Space space); |
113 void CollectGarbage(Space space, ApiCallbacks api_callbacks); | 113 void CollectGarbage(Space space, ApiCallbacks api_callbacks); |
114 void CollectAllGarbage(); | 114 void CollectAllGarbage(); |
115 | 115 |
116 // Enables growth control on the page space heaps. This should be | 116 // Enables growth control on the page space heaps. This should be |
117 // called before any user code is executed. | 117 // called before any user code is executed. |
118 void EnableGrowthControl(); | 118 void EnableGrowthControl(); |
119 | 119 |
| 120 // Protect access to the heap. |
| 121 void Protect(VirtualMemory::Protection mode); |
| 122 |
120 // Accessors for inlined allocation in generated code. | 123 // Accessors for inlined allocation in generated code. |
121 uword TopAddress(); | 124 uword TopAddress(); |
122 uword EndAddress(); | 125 uword EndAddress(); |
123 static intptr_t new_space_offset() { return OFFSET_OF(Heap, new_space_); } | 126 static intptr_t new_space_offset() { return OFFSET_OF(Heap, new_space_); } |
124 | 127 |
125 // Initialize the heap and register it with the isolate. | 128 // Initialize the heap and register it with the isolate. |
126 static void Init(Isolate* isolate); | 129 static void Init(Isolate* isolate); |
127 | 130 |
128 // Verify that all pointers in the heap point to the heap. | 131 // Verify that all pointers in the heap point to the heap. |
129 bool Verify() const; | 132 bool Verify() const; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 public: | 172 public: |
170 NoGCScope() {} | 173 NoGCScope() {} |
171 private: | 174 private: |
172 DISALLOW_COPY_AND_ASSIGN(NoGCScope); | 175 DISALLOW_COPY_AND_ASSIGN(NoGCScope); |
173 }; | 176 }; |
174 #endif // defined(DEBUG) | 177 #endif // defined(DEBUG) |
175 | 178 |
176 } // namespace dart | 179 } // namespace dart |
177 | 180 |
178 #endif // VM_HEAP_H_ | 181 #endif // VM_HEAP_H_ |
OLD | NEW |