Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Side by Side Diff: runtime/vm/heap.cc

Issue 11442024: Unify specification of file open, close, and write callbacks. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/heap.h ('k') | runtime/vm/heap_profiler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « runtime/vm/heap.h ('k') | runtime/vm/heap_profiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698