| 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 bool BeginNewSpaceGC(Thread* thread); | 331 bool BeginNewSpaceGC(Thread* thread); |
| 336 void EndNewSpaceGC(); | 332 void EndNewSpaceGC(); |
| 337 bool BeginOldSpaceGC(Thread* thread); | 333 bool BeginOldSpaceGC(Thread* thread); |
| 338 void EndOldSpaceGC(); | 334 void EndOldSpaceGC(); |
| 339 | 335 |
| 340 void AddRegionsToObjectSet(ObjectSet* set) const; | 336 void AddRegionsToObjectSet(ObjectSet* set) const; |
| 341 | 337 |
| 342 Isolate* isolate_; | 338 Isolate* isolate_; |
| 343 | 339 |
| 344 // The different spaces used for allocation. | 340 // The different spaces used for allocation. |
| 345 ALIGN8 Scavenger new_space_; | 341 Scavenger new_space_; |
| 346 PageSpace old_space_; | 342 PageSpace old_space_; |
| 347 | 343 |
| 348 WeakTable* new_weak_tables_[kNumWeakSelectors]; | 344 WeakTable* new_weak_tables_[kNumWeakSelectors]; |
| 349 WeakTable* old_weak_tables_[kNumWeakSelectors]; | 345 WeakTable* old_weak_tables_[kNumWeakSelectors]; |
| 350 | 346 |
| 351 Monitor* barrier_; | 347 Monitor* barrier_; |
| 352 Monitor* barrier_done_; | 348 Monitor* barrier_done_; |
| 353 | 349 |
| 354 // GC stats collection. | 350 // GC stats collection. |
| 355 GCStats stats_; | 351 GCStats stats_; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 // Note: During this scope, the code pages are non-executable. | 396 // Note: During this scope, the code pages are non-executable. |
| 401 class WritableVMIsolateScope : StackResource { | 397 class WritableVMIsolateScope : StackResource { |
| 402 public: | 398 public: |
| 403 explicit WritableVMIsolateScope(Thread* thread); | 399 explicit WritableVMIsolateScope(Thread* thread); |
| 404 ~WritableVMIsolateScope(); | 400 ~WritableVMIsolateScope(); |
| 405 }; | 401 }; |
| 406 | 402 |
| 407 } // namespace dart | 403 } // namespace dart |
| 408 | 404 |
| 409 #endif // RUNTIME_VM_HEAP_H_ | 405 #endif // RUNTIME_VM_HEAP_H_ |
| OLD | NEW |