| 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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 | 227 |
| 228 | 228 |
| 229 void Heap::Init(Isolate* isolate) { | 229 void Heap::Init(Isolate* isolate) { |
| 230 ASSERT(isolate->heap() == NULL); | 230 ASSERT(isolate->heap() == NULL); |
| 231 Heap* heap = new Heap(); | 231 Heap* heap = new Heap(); |
| 232 isolate->set_heap(heap); | 232 isolate->set_heap(heap); |
| 233 } | 233 } |
| 234 | 234 |
| 235 | 235 |
| 236 bool Heap::Verify() const { | 236 bool Heap::Verify() const { |
| 237 VerifyPointersVisitor visitor; | 237 VerifyPointersVisitor visitor(Isolate::Current()); |
| 238 new_space_->VisitObjectPointers(&visitor); | 238 new_space_->VisitObjectPointers(&visitor); |
| 239 old_space_->VisitObjectPointers(&visitor); | 239 old_space_->VisitObjectPointers(&visitor); |
| 240 code_space_->VisitObjectPointers(&visitor); | 240 code_space_->VisitObjectPointers(&visitor); |
| 241 stub_code_space_->VisitObjectPointers(&visitor); | 241 stub_code_space_->VisitObjectPointers(&visitor); |
| 242 // Only returning a value so that Heap::Validate can be called from an ASSERT. | 242 // Only returning a value so that Heap::Validate can be called from an ASSERT. |
| 243 return true; | 243 return true; |
| 244 } | 244 } |
| 245 | 245 |
| 246 | 246 |
| 247 #if defined(DEBUG) | 247 #if defined(DEBUG) |
| 248 NoGCScope::NoGCScope() : StackResource(Isolate::Current()) { | 248 NoGCScope::NoGCScope() : StackResource(Isolate::Current()) { |
| 249 isolate()->IncrementNoGCScopeDepth(); | 249 isolate()->IncrementNoGCScopeDepth(); |
| 250 } | 250 } |
| 251 | 251 |
| 252 | 252 |
| 253 NoGCScope::~NoGCScope() { | 253 NoGCScope::~NoGCScope() { |
| 254 isolate()->DecrementNoGCScopeDepth(); | 254 isolate()->DecrementNoGCScopeDepth(); |
| 255 } | 255 } |
| 256 #endif // defined(DEBUG) | 256 #endif // defined(DEBUG) |
| 257 | 257 |
| 258 } // namespace dart | 258 } // namespace dart |
| OLD | NEW |