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

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

Issue 11428067: Merge the Merlin heap tracing to top-of-trunk. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: add yet another missing file 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
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 701 matching lines...) Expand 10 before | Expand all | Expand 10 after
712 if (!callbacks.Contains(callback)) { 712 if (!callbacks.Contains(callback)) {
713 return Api::NewError( 713 return Api::NewError(
714 "%s expects 'callback' to be present in the epilogue callback list.", 714 "%s expects 'callback' to be present in the epilogue callback list.",
715 CURRENT_FUNC); 715 CURRENT_FUNC);
716 } 716 }
717 callbacks.Remove(callback); 717 callbacks.Remove(callback);
718 return Api::Success(isolate); 718 return Api::Success(isolate);
719 } 719 }
720 720
721 721
722 DART_EXPORT Dart_Handle Dart_HeapProfile(Dart_HeapProfileWriteCallback callback, 722 DART_EXPORT Dart_Handle Dart_HeapProfile(Dart_FileWriteCallback callback,
723 void* stream) { 723 void* stream) {
724 Isolate* isolate = Isolate::Current(); 724 Isolate* isolate = Isolate::Current();
725 CHECK_ISOLATE(isolate); 725 CHECK_ISOLATE(isolate);
726 if (callback == NULL) { 726 if (callback == NULL) {
727 RETURN_NULL_ERROR(callback); 727 RETURN_NULL_ERROR(callback);
728 } 728 }
729 isolate->heap()->Profile(callback, stream); 729 isolate->heap()->Profile(callback, stream);
730 return Api::Success(isolate); 730 return Api::Success(isolate);
731 } 731 }
732 732
(...skipping 3671 matching lines...) Expand 10 before | Expand all | Expand 10 after
4404 *buffer = NULL; 4404 *buffer = NULL;
4405 } 4405 }
4406 delete debug_region; 4406 delete debug_region;
4407 } else { 4407 } else {
4408 *buffer = NULL; 4408 *buffer = NULL;
4409 *buffer_size = 0; 4409 *buffer_size = 0;
4410 } 4410 }
4411 } 4411 }
4412 4412
4413 4413
4414 DART_EXPORT void Dart_InitHeapTrace(Dart_FileOpenCallback open_function,
4415 Dart_FileWriteCallback write_function,
4416 Dart_FileCloseCallback close_function,
4417 const char* prefix) {
4418 HeapTrace::InitTracing(open_function, write_function, close_function, prefix);
4419 }
4420
4421
4414 DART_EXPORT void Dart_InitPerfEventsSupport(Dart_FileWriterFunction function) { 4422 DART_EXPORT void Dart_InitPerfEventsSupport(Dart_FileWriterFunction function) {
4415 Dart::set_perf_events_writer(function); 4423 Dart::set_perf_events_writer(function);
4416 } 4424 }
4417 4425
4418 4426
4419 // --- Peer support --- 4427 // --- Peer support ---
4420 4428
4421 4429
4422 DART_EXPORT Dart_Handle Dart_GetPeer(Dart_Handle object, void** peer) { 4430 DART_EXPORT Dart_Handle Dart_GetPeer(Dart_Handle object, void** peer) {
4423 if (peer == NULL) { 4431 if (peer == NULL) {
(...skipping 27 matching lines...) Expand all
4451 } 4459 }
4452 { 4460 {
4453 NoGCScope no_gc; 4461 NoGCScope no_gc;
4454 RawObject* raw_obj = obj.raw(); 4462 RawObject* raw_obj = obj.raw();
4455 isolate->heap()->SetPeer(raw_obj, peer); 4463 isolate->heap()->SetPeer(raw_obj, peer);
4456 } 4464 }
4457 return Api::Success(isolate); 4465 return Api::Success(isolate);
4458 } 4466 }
4459 4467
4460 } // namespace dart 4468 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698