| 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_SCAVENGER_H_ | 5 #ifndef VM_SCAVENGER_H_ |
| 6 #define VM_SCAVENGER_H_ | 6 #define VM_SCAVENGER_H_ |
| 7 | 7 |
| 8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 #include "platform/utils.h" | 9 #include "platform/utils.h" |
| 10 #include "vm/dart.h" | 10 #include "vm/dart.h" |
| 11 #include "vm/flags.h" | 11 #include "vm/flags.h" |
| 12 #include "vm/globals.h" | 12 #include "vm/globals.h" |
| 13 #include "vm/raw_object.h" | 13 #include "vm/raw_object.h" |
| 14 #include "vm/ring_buffer.h" | 14 #include "vm/ring_buffer.h" |
| 15 #include "vm/spaces.h" | 15 #include "vm/spaces.h" |
| 16 #include "vm/virtual_memory.h" | 16 #include "vm/virtual_memory.h" |
| 17 #include "vm/visitor.h" | 17 #include "vm/visitor.h" |
| 18 | 18 |
| 19 namespace dart { | 19 namespace dart { |
| 20 | 20 |
| 21 // Forward declarations. | 21 // Forward declarations. |
| 22 class Heap; | 22 class Heap; |
| 23 class Isolate; | 23 class Isolate; |
| 24 class JSONObject; | 24 class JSONObject; |
| 25 class ScavengerVisitor; | 25 class ScavengerVisitor; |
| 26 | 26 |
| 27 DECLARE_FLAG(bool, gc_at_alloc); | |
| 28 | |
| 29 | |
| 30 // Wrapper around VirtualMemory that adds caching and handles the empty case. | 27 // Wrapper around VirtualMemory that adds caching and handles the empty case. |
| 31 class SemiSpace { | 28 class SemiSpace { |
| 32 public: | 29 public: |
| 33 static void InitOnce(); | 30 static void InitOnce(); |
| 34 | 31 |
| 35 // Get a space of the given size. Returns NULL on out of memory. If size is 0, | 32 // Get a space of the given size. Returns NULL on out of memory. If size is 0, |
| 36 // returns an empty space: pointer(), start() and end() all return NULL. | 33 // returns an empty space: pointer(), start() and end() all return NULL. |
| 37 static SemiSpace* New(intptr_t size_in_words); | 34 static SemiSpace* New(intptr_t size_in_words); |
| 38 | 35 |
| 39 // Hand back an unused space. | 36 // Hand back an unused space. |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 | 302 |
| 306 friend class ScavengerVisitor; | 303 friend class ScavengerVisitor; |
| 307 friend class ScavengerWeakVisitor; | 304 friend class ScavengerWeakVisitor; |
| 308 | 305 |
| 309 DISALLOW_COPY_AND_ASSIGN(Scavenger); | 306 DISALLOW_COPY_AND_ASSIGN(Scavenger); |
| 310 }; | 307 }; |
| 311 | 308 |
| 312 } // namespace dart | 309 } // namespace dart |
| 313 | 310 |
| 314 #endif // VM_SCAVENGER_H_ | 311 #endif // VM_SCAVENGER_H_ |
| OLD | NEW |