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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
121 void SetGrowthControlState(bool state); | 121 void SetGrowthControlState(bool state); |
122 bool GrowthControlState(); | 122 bool GrowthControlState(); |
123 | 123 |
124 // Protect access to the heap. Note: Code pages are made | 124 // Protect access to the heap. Note: Code pages are made |
125 // executable/non-executable when 'read_only' is true/false, respectively. | 125 // executable/non-executable when 'read_only' is true/false, respectively. |
126 void WriteProtect(bool read_only); | 126 void WriteProtect(bool read_only); |
127 void WriteProtectCode(bool read_only) { | 127 void WriteProtectCode(bool read_only) { |
128 old_space_.WriteProtectCode(read_only); | 128 old_space_.WriteProtectCode(read_only); |
129 } | 129 } |
130 | 130 |
131 // Accessors for inlined allocation in generated code. | 131 // Accessors for inlined allocation in generated code. |
rmacnak
2017/07/05 17:39:52
Remove comment too.
danunez
2017/07/05 18:12:54
Done.
| |
132 static intptr_t TopOffset(Space space); | |
133 static intptr_t EndOffset(Space space); | |
134 | 132 |
135 // Initialize the heap and register it with the isolate. | 133 // Initialize the heap and register it with the isolate. |
136 static void Init(Isolate* isolate, | 134 static void Init(Isolate* isolate, |
137 intptr_t max_new_gen_words, | 135 intptr_t max_new_gen_words, |
138 intptr_t max_old_gen_words, | 136 intptr_t max_old_gen_words, |
139 intptr_t max_external_words); | 137 intptr_t max_external_words); |
140 | 138 |
141 // Writes a suitable name for a VM region in the heap into the buffer `name`. | 139 // Writes a suitable name for a VM region in the heap into the buffer `name`. |
142 static void RegionName(Heap* heap, | 140 static void RegionName(Heap* heap, |
143 Space space, | 141 Space space, |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
325 bool BeginNewSpaceGC(Thread* thread); | 323 bool BeginNewSpaceGC(Thread* thread); |
326 void EndNewSpaceGC(); | 324 void EndNewSpaceGC(); |
327 bool BeginOldSpaceGC(Thread* thread); | 325 bool BeginOldSpaceGC(Thread* thread); |
328 void EndOldSpaceGC(); | 326 void EndOldSpaceGC(); |
329 | 327 |
330 void AddRegionsToObjectSet(ObjectSet* set) const; | 328 void AddRegionsToObjectSet(ObjectSet* set) const; |
331 | 329 |
332 Isolate* isolate_; | 330 Isolate* isolate_; |
333 | 331 |
334 // The different spaces used for allocation. | 332 // The different spaces used for allocation. |
335 ALIGN8 Scavenger new_space_; | 333 ALIGN8 Scavenger new_space_; |
rmacnak
2017/07/05 17:39:52
This should no longer be accessed from generated c
danunez
2017/07/05 18:12:54
I will try this and see what happens. I think you
| |
336 PageSpace old_space_; | 334 PageSpace old_space_; |
337 | 335 |
338 WeakTable* new_weak_tables_[kNumWeakSelectors]; | 336 WeakTable* new_weak_tables_[kNumWeakSelectors]; |
339 WeakTable* old_weak_tables_[kNumWeakSelectors]; | 337 WeakTable* old_weak_tables_[kNumWeakSelectors]; |
340 | 338 |
341 Monitor* barrier_; | 339 Monitor* barrier_; |
342 Monitor* barrier_done_; | 340 Monitor* barrier_done_; |
343 | 341 |
344 // GC stats collection. | 342 // GC stats collection. |
345 GCStats stats_; | 343 GCStats stats_; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
393 // Note: During this scope, the code pages are non-executable. | 391 // Note: During this scope, the code pages are non-executable. |
394 class WritableVMIsolateScope : StackResource { | 392 class WritableVMIsolateScope : StackResource { |
395 public: | 393 public: |
396 explicit WritableVMIsolateScope(Thread* thread); | 394 explicit WritableVMIsolateScope(Thread* thread); |
397 ~WritableVMIsolateScope(); | 395 ~WritableVMIsolateScope(); |
398 }; | 396 }; |
399 | 397 |
400 } // namespace dart | 398 } // namespace dart |
401 | 399 |
402 #endif // RUNTIME_VM_HEAP_H_ | 400 #endif // RUNTIME_VM_HEAP_H_ |
OLD | NEW |