| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 "vm/allocation.h" | 8 #include "vm/allocation.h" |
| 9 #include "vm/assert.h" | 9 #include "vm/assert.h" |
| 10 #include "vm/flags.h" | 10 #include "vm/flags.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 switch (space) { | 60 switch (space) { |
| 61 case kNew: | 61 case kNew: |
| 62 return new_space_->TryAllocate(size); | 62 return new_space_->TryAllocate(size); |
| 63 case kOld: | 63 case kOld: |
| 64 return old_space_->TryAllocate(size); | 64 return old_space_->TryAllocate(size); |
| 65 case kExecutable: | 65 case kExecutable: |
| 66 return code_space_->TryAllocate(size); | 66 return code_space_->TryAllocate(size); |
| 67 default: | 67 default: |
| 68 UNREACHABLE(); | 68 UNREACHABLE(); |
| 69 } | 69 } |
| 70 return 0; |
| 70 } | 71 } |
| 71 | 72 |
| 72 // Heap contains the specified address. | 73 // Heap contains the specified address. |
| 73 bool Contains(uword addr) const; | 74 bool Contains(uword addr) const; |
| 74 bool CodeContains(uword addr) const; | 75 bool CodeContains(uword addr) const; |
| 75 | 76 |
| 76 // Visit all pointers in the space. | 77 // Visit all pointers in the space. |
| 77 void IterateNewPointers(ObjectPointerVisitor* visitor); | 78 void IterateNewPointers(ObjectPointerVisitor* visitor); |
| 78 void IterateOldPointers(ObjectPointerVisitor* visitor); | 79 void IterateOldPointers(ObjectPointerVisitor* visitor); |
| 79 void IterateCodePointers(ObjectPointerVisitor* visitor); | 80 void IterateCodePointers(ObjectPointerVisitor* visitor); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 public: | 122 public: |
| 122 NoGCScope() {} | 123 NoGCScope() {} |
| 123 private: | 124 private: |
| 124 DISALLOW_COPY_AND_ASSIGN(NoGCScope); | 125 DISALLOW_COPY_AND_ASSIGN(NoGCScope); |
| 125 }; | 126 }; |
| 126 #endif // defined(DEBUG) | 127 #endif // defined(DEBUG) |
| 127 | 128 |
| 128 } // namespace dart | 129 } // namespace dart |
| 129 | 130 |
| 130 #endif // VM_HEAP_H_ | 131 #endif // VM_HEAP_H_ |
| OLD | NEW |