| 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 "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 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 601 if (!callbacks.Contains(callback)) { | 601 if (!callbacks.Contains(callback)) { |
| 602 return Api::NewError( | 602 return Api::NewError( |
| 603 "%s expects 'callback' to be present in the epilogue callback list.", | 603 "%s expects 'callback' to be present in the epilogue callback list.", |
| 604 CURRENT_FUNC); | 604 CURRENT_FUNC); |
| 605 } | 605 } |
| 606 callbacks.Remove(callback); | 606 callbacks.Remove(callback); |
| 607 return Api::Success(isolate); | 607 return Api::Success(isolate); |
| 608 } | 608 } |
| 609 | 609 |
| 610 | 610 |
| 611 DART_EXPORT Dart_Handle Dart_HeapProfile(Dart_HeapProfileWriteCallback callback, |
| 612 void* stream) { |
| 613 Isolate* isolate = Isolate::Current(); |
| 614 CHECK_ISOLATE(isolate); |
| 615 if (callback == NULL) { |
| 616 return Api::NewError("%s expects argument 'callback' to be non-null.", |
| 617 CURRENT_FUNC); |
| 618 } |
| 619 isolate->heap()->Profile(callback, stream); |
| 620 return Api::Success(isolate); |
| 621 } |
| 622 |
| 611 // --- Initialization and Globals --- | 623 // --- Initialization and Globals --- |
| 612 | 624 |
| 613 | 625 |
| 614 DART_EXPORT bool Dart_Initialize(Dart_IsolateCreateCallback create, | 626 DART_EXPORT bool Dart_Initialize(Dart_IsolateCreateCallback create, |
| 615 Dart_IsolateInterruptCallback interrupt) { | 627 Dart_IsolateInterruptCallback interrupt) { |
| 616 return Dart::InitOnce(create, interrupt); | 628 return Dart::InitOnce(create, interrupt); |
| 617 } | 629 } |
| 618 | 630 |
| 619 DART_EXPORT bool Dart_SetVMFlags(int argc, const char** argv) { | 631 DART_EXPORT bool Dart_SetVMFlags(int argc, const char** argv) { |
| 620 return Flags::ProcessCommandLineFlags(argc, argv); | 632 return Flags::ProcessCommandLineFlags(argc, argv); |
| (...skipping 2773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3394 *buffer = NULL; | 3406 *buffer = NULL; |
| 3395 } | 3407 } |
| 3396 delete debug_region; | 3408 delete debug_region; |
| 3397 } else { | 3409 } else { |
| 3398 *buffer = NULL; | 3410 *buffer = NULL; |
| 3399 *buffer_size = 0; | 3411 *buffer_size = 0; |
| 3400 } | 3412 } |
| 3401 } | 3413 } |
| 3402 | 3414 |
| 3403 } // namespace dart | 3415 } // namespace dart |
| OLD | NEW |