| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 #include "include/dart_mirrors_api.h" | 6 #include "include/dart_mirrors_api.h" |
| 7 #include "include/dart_native_api.h" | 7 #include "include/dart_native_api.h" |
| 8 | 8 |
| 9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
| 10 #include "vm/bigint_operations.h" | 10 #include "vm/bigint_operations.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 #include "vm/version.h" | 37 #include "vm/version.h" |
| 38 | 38 |
| 39 namespace dart { | 39 namespace dart { |
| 40 | 40 |
| 41 DECLARE_FLAG(bool, print_class_table); | 41 DECLARE_FLAG(bool, print_class_table); |
| 42 DECLARE_FLAG(bool, verify_handles); | 42 DECLARE_FLAG(bool, verify_handles); |
| 43 DEFINE_FLAG(bool, check_function_fingerprints, false, | 43 DEFINE_FLAG(bool, check_function_fingerprints, false, |
| 44 "Check function fingerprints"); | 44 "Check function fingerprints"); |
| 45 DEFINE_FLAG(bool, trace_api, false, | 45 DEFINE_FLAG(bool, trace_api, false, |
| 46 "Trace invocation of API calls (debug mode only)"); | 46 "Trace invocation of API calls (debug mode only)"); |
| 47 DEFINE_FLAG(bool, load_async, true, "load source code asynchronously"); |
| 47 | 48 |
| 48 ThreadLocalKey Api::api_native_key_ = Thread::kUnsetThreadLocalKey; | 49 ThreadLocalKey Api::api_native_key_ = Thread::kUnsetThreadLocalKey; |
| 49 Dart_Handle Api::true_handle_ = NULL; | 50 Dart_Handle Api::true_handle_ = NULL; |
| 50 Dart_Handle Api::false_handle_ = NULL; | 51 Dart_Handle Api::false_handle_ = NULL; |
| 51 Dart_Handle Api::null_handle_ = NULL; | 52 Dart_Handle Api::null_handle_ = NULL; |
| 52 | 53 |
| 53 | 54 |
| 54 const char* CanonicalFunction(const char* func) { | 55 const char* CanonicalFunction(const char* func) { |
| 55 if (strncmp(func, "dart::", 6) == 0) { | 56 if (strncmp(func, "dart::", 6) == 0) { |
| 56 return func + 6; | 57 return func + 6; |
| (...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 982 return true; | 983 return true; |
| 983 } | 984 } |
| 984 | 985 |
| 985 | 986 |
| 986 DART_EXPORT bool Dart_SetVMFlags(int argc, const char** argv) { | 987 DART_EXPORT bool Dart_SetVMFlags(int argc, const char** argv) { |
| 987 return Flags::ProcessCommandLineFlags(argc, argv); | 988 return Flags::ProcessCommandLineFlags(argc, argv); |
| 988 } | 989 } |
| 989 | 990 |
| 990 | 991 |
| 991 DART_EXPORT bool Dart_IsVMFlagSet(const char* flag_name) { | 992 DART_EXPORT bool Dart_IsVMFlagSet(const char* flag_name) { |
| 992 if (Flags::Lookup(flag_name) != NULL) { | 993 return Flags::IsSet(flag_name); |
| 993 return true; | |
| 994 } | |
| 995 return false; | |
| 996 } | 994 } |
| 997 | 995 |
| 998 | 996 |
| 999 // --- Isolates --- | 997 // --- Isolates --- |
| 1000 | 998 |
| 1001 static char* BuildIsolateName(const char* script_uri, | 999 static char* BuildIsolateName(const char* script_uri, |
| 1002 const char* main) { | 1000 const char* main) { |
| 1003 if (script_uri == NULL) { | 1001 if (script_uri == NULL) { |
| 1004 // Just use the main as the name. | 1002 // Just use the main as the name. |
| 1005 if (main == NULL) { | 1003 if (main == NULL) { |
| (...skipping 3777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4783 | 4781 |
| 4784 | 4782 |
| 4785 DART_EXPORT void Dart_RegisterRootServiceRequestCallback( | 4783 DART_EXPORT void Dart_RegisterRootServiceRequestCallback( |
| 4786 const char* name, | 4784 const char* name, |
| 4787 Dart_ServiceRequestCallback callback, | 4785 Dart_ServiceRequestCallback callback, |
| 4788 void* user_data) { | 4786 void* user_data) { |
| 4789 Service::RegisterRootEmbedderCallback(name, callback, user_data); | 4787 Service::RegisterRootEmbedderCallback(name, callback, user_data); |
| 4790 } | 4788 } |
| 4791 | 4789 |
| 4792 } // namespace dart | 4790 } // namespace dart |
| OLD | NEW |