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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 void SetGrowthControlState(bool state); | 128 void SetGrowthControlState(bool state); |
129 bool GrowthControlState(); | 129 bool GrowthControlState(); |
130 | 130 |
131 // Protect access to the heap. Note: Code pages are made | 131 // Protect access to the heap. Note: Code pages are made |
132 // executable/non-executable when 'read_only' is true/false, respectively. | 132 // executable/non-executable when 'read_only' is true/false, respectively. |
133 void WriteProtect(bool read_only); | 133 void WriteProtect(bool read_only); |
134 void WriteProtectCode(bool read_only) { | 134 void WriteProtectCode(bool read_only) { |
135 old_space_.WriteProtectCode(read_only); | 135 old_space_.WriteProtectCode(read_only); |
136 } | 136 } |
137 | 137 |
138 // Accessors for inlined allocation in generated code. | |
139 static intptr_t TopOffset(Space space); | |
140 static intptr_t EndOffset(Space space); | |
141 | |
142 // Initialize the heap and register it with the isolate. | 138 // Initialize the heap and register it with the isolate. |
143 static void Init(Isolate* isolate, | 139 static void Init(Isolate* isolate, |
144 intptr_t max_new_gen_words, | 140 intptr_t max_new_gen_words, |
145 intptr_t max_old_gen_words, | 141 intptr_t max_old_gen_words, |
146 intptr_t max_external_words); | 142 intptr_t max_external_words); |
147 | 143 |
148 // Writes a suitable name for a VM region in the heap into the buffer `name`. | 144 // Writes a suitable name for a VM region in the heap into the buffer `name`. |
149 static void RegionName(Heap* heap, | 145 static void RegionName(Heap* heap, |
150 Space space, | 146 Space space, |
151 char* name, | 147 char* name, |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 bool BeginNewSpaceGC(Thread* thread); | 332 bool BeginNewSpaceGC(Thread* thread); |
337 void EndNewSpaceGC(); | 333 void EndNewSpaceGC(); |
338 bool BeginOldSpaceGC(Thread* thread); | 334 bool BeginOldSpaceGC(Thread* thread); |
339 void EndOldSpaceGC(); | 335 void EndOldSpaceGC(); |
340 | 336 |
341 void AddRegionsToObjectSet(ObjectSet* set) const; | 337 void AddRegionsToObjectSet(ObjectSet* set) const; |
342 | 338 |
343 Isolate* isolate_; | 339 Isolate* isolate_; |
344 | 340 |
345 // The different spaces used for allocation. | 341 // The different spaces used for allocation. |
346 ALIGN8 Scavenger new_space_; | 342 Scavenger new_space_; |
347 PageSpace old_space_; | 343 PageSpace old_space_; |
348 | 344 |
349 WeakTable* new_weak_tables_[kNumWeakSelectors]; | 345 WeakTable* new_weak_tables_[kNumWeakSelectors]; |
350 WeakTable* old_weak_tables_[kNumWeakSelectors]; | 346 WeakTable* old_weak_tables_[kNumWeakSelectors]; |
351 | 347 |
352 Monitor* barrier_; | 348 Monitor* barrier_; |
353 Monitor* barrier_done_; | 349 Monitor* barrier_done_; |
354 | 350 |
355 // GC stats collection. | 351 // GC stats collection. |
356 GCStats stats_; | 352 GCStats stats_; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 // Note: During this scope, the code pages are non-executable. | 400 // Note: During this scope, the code pages are non-executable. |
405 class WritableVMIsolateScope : StackResource { | 401 class WritableVMIsolateScope : StackResource { |
406 public: | 402 public: |
407 explicit WritableVMIsolateScope(Thread* thread); | 403 explicit WritableVMIsolateScope(Thread* thread); |
408 ~WritableVMIsolateScope(); | 404 ~WritableVMIsolateScope(); |
409 }; | 405 }; |
410 | 406 |
411 } // namespace dart | 407 } // namespace dart |
412 | 408 |
413 #endif // RUNTIME_VM_HEAP_H_ | 409 #endif // RUNTIME_VM_HEAP_H_ |
OLD | NEW |