| 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 #include "vm/heap.h" | 5 #include "vm/heap.h" |
| 6 | 6 |
| 7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
| 8 #include "platform/utils.h" | 8 #include "platform/utils.h" |
| 9 #include "vm/compiler_stats.h" | 9 #include "vm/compiler_stats.h" |
| 10 #include "vm/flags.h" | 10 #include "vm/flags.h" |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 old_space_->VisitObjectPointers(visitor); | 123 old_space_->VisitObjectPointers(visitor); |
| 124 code_space_->VisitObjectPointers(visitor); | 124 code_space_->VisitObjectPointers(visitor); |
| 125 } | 125 } |
| 126 | 126 |
| 127 | 127 |
| 128 void Heap::IterateCodePointers(ObjectPointerVisitor* visitor) { | 128 void Heap::IterateCodePointers(ObjectPointerVisitor* visitor) { |
| 129 code_space_->VisitObjectPointers(visitor); | 129 code_space_->VisitObjectPointers(visitor); |
| 130 } | 130 } |
| 131 | 131 |
| 132 | 132 |
| 133 void Heap::IterateNewObjects(ObjectVisitor* visitor) { |
| 134 new_space_->VisitObjects(visitor); |
| 135 } |
| 136 |
| 137 |
| 138 void Heap::IterateOldObjects(ObjectVisitor* visitor) { |
| 139 old_space_->VisitObjects(visitor); |
| 140 code_space_->VisitObjects(visitor); |
| 141 } |
| 142 |
| 143 |
| 144 void Heap::IterateCodeObjects(ObjectVisitor* visitor) { |
| 145 code_space_->VisitObjects(visitor); |
| 146 } |
| 147 |
| 148 |
| 133 RawInstructions* Heap::FindObjectInCodeSpace(FindObjectVisitor* visitor) { | 149 RawInstructions* Heap::FindObjectInCodeSpace(FindObjectVisitor* visitor) { |
| 134 // The code heap can only have RawInstructions objects. | 150 // The code heap can only have RawInstructions objects. |
| 135 RawObject* raw_obj = code_space_->FindObject(visitor); | 151 RawObject* raw_obj = code_space_->FindObject(visitor); |
| 136 ASSERT((raw_obj == Object::null()) || | 152 ASSERT((raw_obj == Object::null()) || |
| 137 (raw_obj->GetClassId() == kInstructions)); | 153 (raw_obj->GetClassId() == kInstructions)); |
| 138 return reinterpret_cast<RawInstructions*>(raw_obj); | 154 return reinterpret_cast<RawInstructions*>(raw_obj); |
| 139 } | 155 } |
| 140 | 156 |
| 141 | 157 |
| 142 void Heap::CollectGarbage(Space space, ApiCallbacks api_callbacks) { | 158 void Heap::CollectGarbage(Space space, ApiCallbacks api_callbacks) { |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 isolate()->IncrementNoGCScopeDepth(); | 265 isolate()->IncrementNoGCScopeDepth(); |
| 250 } | 266 } |
| 251 | 267 |
| 252 | 268 |
| 253 NoGCScope::~NoGCScope() { | 269 NoGCScope::~NoGCScope() { |
| 254 isolate()->DecrementNoGCScopeDepth(); | 270 isolate()->DecrementNoGCScopeDepth(); |
| 255 } | 271 } |
| 256 #endif // defined(DEBUG) | 272 #endif // defined(DEBUG) |
| 257 | 273 |
| 258 } // namespace dart | 274 } // namespace dart |
| OLD | NEW |