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

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

Issue 10452006: Implement a heap profiler for the Dart managed heap. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address final review comments Created 8 years, 6 months 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/include/dart_api.h ('k') | runtime/vm/heap.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 "include/dart_api.h" 5 #include "include/dart_api.h"
6 6
7 #include "vm/bigint_operations.h" 7 #include "vm/bigint_operations.h"
8 #include "vm/class_finalizer.h" 8 #include "vm/class_finalizer.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/dart.h" 10 #include "vm/dart.h"
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
663 if (!callbacks.Contains(callback)) { 663 if (!callbacks.Contains(callback)) {
664 return Api::NewError( 664 return Api::NewError(
665 "%s expects 'callback' to be present in the epilogue callback list.", 665 "%s expects 'callback' to be present in the epilogue callback list.",
666 CURRENT_FUNC); 666 CURRENT_FUNC);
667 } 667 }
668 callbacks.Remove(callback); 668 callbacks.Remove(callback);
669 return Api::Success(isolate); 669 return Api::Success(isolate);
670 } 670 }
671 671
672 672
673 DART_EXPORT Dart_Handle Dart_HeapProfile(Dart_HeapProfileWriteCallback callback,
674 void* stream) {
675 Isolate* isolate = Isolate::Current();
676 CHECK_ISOLATE(isolate);
677 if (callback == NULL) {
678 return Api::NewError("%s expects argument 'callback' to be non-null.",
679 CURRENT_FUNC);
680 }
681 isolate->heap()->Profile(callback, stream);
682 return Api::Success(isolate);
683 }
684
673 // --- Initialization and Globals --- 685 // --- Initialization and Globals ---
674 686
675 687
676 DART_EXPORT bool Dart_Initialize(Dart_IsolateCreateCallback create, 688 DART_EXPORT bool Dart_Initialize(Dart_IsolateCreateCallback create,
677 Dart_IsolateInterruptCallback interrupt) { 689 Dart_IsolateInterruptCallback interrupt) {
678 return Dart::InitOnce(create, interrupt); 690 return Dart::InitOnce(create, interrupt);
679 } 691 }
680 692
681 DART_EXPORT bool Dart_SetVMFlags(int argc, const char** argv) { 693 DART_EXPORT bool Dart_SetVMFlags(int argc, const char** argv) {
682 return Flags::ProcessCommandLineFlags(argc, argv); 694 return Flags::ProcessCommandLineFlags(argc, argv);
(...skipping 2953 matching lines...) Expand 10 before | Expand all | Expand 10 after
3636 *buffer_size = 0; 3648 *buffer_size = 0;
3637 } 3649 }
3638 } 3650 }
3639 3651
3640 3652
3641 DART_EXPORT void Dart_InitFlowGraphPrinting(FileWriterFunction function) { 3653 DART_EXPORT void Dart_InitFlowGraphPrinting(FileWriterFunction function) {
3642 Dart::set_flow_graph_writer(function); 3654 Dart::set_flow_graph_writer(function);
3643 } 3655 }
3644 3656
3645 } // namespace dart 3657 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/include/dart_api.h ('k') | runtime/vm/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698