| 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/flags.h" | 9 #include "vm/flags.h" |
| 10 #include "vm/heap_profiler.h" | 10 #include "vm/heap_profiler.h" |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 | 260 |
| 261 | 261 |
| 262 void Heap::PrintSizes() const { | 262 void Heap::PrintSizes() const { |
| 263 OS::PrintErr("New space (%"Pd"k of %"Pd"k) " | 263 OS::PrintErr("New space (%"Pd"k of %"Pd"k) " |
| 264 "Old space (%"Pd"k of %"Pd"k)\n", | 264 "Old space (%"Pd"k of %"Pd"k)\n", |
| 265 (new_space_->in_use() / KB), (new_space_->capacity() / KB), | 265 (new_space_->in_use() / KB), (new_space_->capacity() / KB), |
| 266 (old_space_->in_use() / KB), (old_space_->capacity() / KB)); | 266 (old_space_->in_use() / KB), (old_space_->capacity() / KB)); |
| 267 } | 267 } |
| 268 | 268 |
| 269 | 269 |
| 270 void Heap::Profile(Dart_HeapProfileWriteCallback callback, void* stream) const { | 270 void Heap::Profile(Dart_FileWriteCallback callback, void* stream) const { |
| 271 HeapProfiler profiler(callback, stream); | 271 HeapProfiler profiler(callback, stream); |
| 272 | 272 |
| 273 // Dump the root set. | 273 // Dump the root set. |
| 274 HeapProfilerRootVisitor root_visitor(&profiler); | 274 HeapProfilerRootVisitor root_visitor(&profiler); |
| 275 Isolate* isolate = Isolate::Current(); | 275 Isolate* isolate = Isolate::Current(); |
| 276 Isolate* vm_isolate = Dart::vm_isolate(); | 276 Isolate* vm_isolate = Dart::vm_isolate(); |
| 277 isolate->VisitObjectPointers(&root_visitor, false, | 277 isolate->VisitObjectPointers(&root_visitor, false, |
| 278 StackFrameIterator::kDontValidateFrames); | 278 StackFrameIterator::kDontValidateFrames); |
| 279 HeapProfilerWeakRootVisitor weak_root_visitor(&root_visitor); | 279 HeapProfilerWeakRootVisitor weak_root_visitor(&root_visitor); |
| 280 isolate->VisitWeakPersistentHandles(&weak_root_visitor, true); | 280 isolate->VisitWeakPersistentHandles(&weak_root_visitor, true); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 isolate()->IncrementNoGCScopeDepth(); | 338 isolate()->IncrementNoGCScopeDepth(); |
| 339 } | 339 } |
| 340 | 340 |
| 341 | 341 |
| 342 NoGCScope::~NoGCScope() { | 342 NoGCScope::~NoGCScope() { |
| 343 isolate()->DecrementNoGCScopeDepth(); | 343 isolate()->DecrementNoGCScopeDepth(); |
| 344 } | 344 } |
| 345 #endif // defined(DEBUG) | 345 #endif // defined(DEBUG) |
| 346 | 346 |
| 347 } // namespace dart | 347 } // namespace dart |
| OLD | NEW |