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 3177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3188 } | 3188 } |
3189 | 3189 |
3190 | 3190 |
3191 DART_EXPORT Dart_Handle Dart_Invoke(Dart_Handle target, | 3191 DART_EXPORT Dart_Handle Dart_Invoke(Dart_Handle target, |
3192 Dart_Handle name, | 3192 Dart_Handle name, |
3193 int number_of_arguments, | 3193 int number_of_arguments, |
3194 Dart_Handle* arguments) { | 3194 Dart_Handle* arguments) { |
3195 Isolate* isolate = Isolate::Current(); | 3195 Isolate* isolate = Isolate::Current(); |
3196 DARTSCOPE(isolate); | 3196 DARTSCOPE(isolate); |
3197 CHECK_CALLBACK_STATE(isolate); | 3197 CHECK_CALLBACK_STATE(isolate); |
| 3198 // TODO(turnidge): This is a bit simplistic. It overcounts when |
| 3199 // other operations (gc, compilation) are active. |
| 3200 TIMERSCOPE(time_dart_execution); |
3198 | 3201 |
3199 const String& function_name = Api::UnwrapStringHandle(isolate, name); | 3202 const String& function_name = Api::UnwrapStringHandle(isolate, name); |
3200 if (function_name.IsNull()) { | 3203 if (function_name.IsNull()) { |
3201 RETURN_TYPE_ERROR(isolate, name, String); | 3204 RETURN_TYPE_ERROR(isolate, name, String); |
3202 } | 3205 } |
3203 if (number_of_arguments < 0) { | 3206 if (number_of_arguments < 0) { |
3204 return Api::NewError( | 3207 return Api::NewError( |
3205 "%s expects argument 'number_of_arguments' to be non-negative.", | 3208 "%s expects argument 'number_of_arguments' to be non-negative.", |
3206 CURRENT_FUNC); | 3209 CURRENT_FUNC); |
3207 } | 3210 } |
(...skipping 1319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4527 } | 4530 } |
4528 | 4531 |
4529 | 4532 |
4530 // --- Service support --- | 4533 // --- Service support --- |
4531 | 4534 |
4532 DART_EXPORT Dart_Isolate Dart_GetServiceIsolate(void* callback_data) { | 4535 DART_EXPORT Dart_Isolate Dart_GetServiceIsolate(void* callback_data) { |
4533 return Api::CastIsolate(Service::GetServiceIsolate(callback_data)); | 4536 return Api::CastIsolate(Service::GetServiceIsolate(callback_data)); |
4534 } | 4537 } |
4535 | 4538 |
4536 } // namespace dart | 4539 } // namespace dart |
OLD | NEW |