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/class_finalizer.h" | 10 #include "vm/class_finalizer.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 | 40 |
41 namespace dart { | 41 namespace dart { |
42 | 42 |
43 DECLARE_FLAG(bool, print_class_table); | 43 DECLARE_FLAG(bool, print_class_table); |
44 DECLARE_FLAG(bool, verify_handles); | 44 DECLARE_FLAG(bool, verify_handles); |
45 DEFINE_FLAG(bool, check_function_fingerprints, false, | 45 DEFINE_FLAG(bool, check_function_fingerprints, false, |
46 "Check function fingerprints"); | 46 "Check function fingerprints"); |
47 DEFINE_FLAG(bool, trace_api, false, | 47 DEFINE_FLAG(bool, trace_api, false, |
48 "Trace invocation of API calls (debug mode only)"); | 48 "Trace invocation of API calls (debug mode only)"); |
49 | 49 |
50 ThreadLocalKey Api::api_native_key_ = Thread::kUnsetThreadLocalKey; | 50 ThreadLocalKey Api::api_native_key_ = OSThread::kUnsetThreadLocalKey; |
51 Dart_Handle Api::true_handle_ = NULL; | 51 Dart_Handle Api::true_handle_ = NULL; |
52 Dart_Handle Api::false_handle_ = NULL; | 52 Dart_Handle Api::false_handle_ = NULL; |
53 Dart_Handle Api::null_handle_ = NULL; | 53 Dart_Handle Api::null_handle_ = NULL; |
54 Dart_Handle Api::empty_string_handle_ = NULL; | 54 Dart_Handle Api::empty_string_handle_ = NULL; |
55 | 55 |
56 | 56 |
57 const char* CanonicalFunction(const char* func) { | 57 const char* CanonicalFunction(const char* func) { |
58 if (strncmp(func, "dart::", 6) == 0) { | 58 if (strncmp(func, "dart::", 6) == 0) { |
59 return func + 6; | 59 return func + 6; |
60 } else { | 60 } else { |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 ASSERT(isolate != NULL); | 431 ASSERT(isolate != NULL); |
432 ApiState* state = isolate->api_state(); | 432 ApiState* state = isolate->api_state(); |
433 ASSERT(state != NULL); | 433 ASSERT(state != NULL); |
434 ApiLocalScope* scope = state->top_scope(); | 434 ApiLocalScope* scope = state->top_scope(); |
435 ASSERT(scope != NULL); | 435 ASSERT(scope != NULL); |
436 return scope; | 436 return scope; |
437 } | 437 } |
438 | 438 |
439 | 439 |
440 void Api::InitOnce() { | 440 void Api::InitOnce() { |
441 ASSERT(api_native_key_ == Thread::kUnsetThreadLocalKey); | 441 ASSERT(api_native_key_ == OSThread::kUnsetThreadLocalKey); |
442 api_native_key_ = Thread::CreateThreadLocal(); | 442 api_native_key_ = OSThread::CreateThreadLocal(); |
443 ASSERT(api_native_key_ != Thread::kUnsetThreadLocalKey); | 443 ASSERT(api_native_key_ != OSThread::kUnsetThreadLocalKey); |
444 } | 444 } |
445 | 445 |
446 | 446 |
447 void Api::InitHandles() { | 447 void Api::InitHandles() { |
448 Isolate* isolate = Isolate::Current(); | 448 Isolate* isolate = Isolate::Current(); |
449 ASSERT(isolate != NULL); | 449 ASSERT(isolate != NULL); |
450 ASSERT(isolate == Dart::vm_isolate()); | 450 ASSERT(isolate == Dart::vm_isolate()); |
451 ApiState* state = isolate->api_state(); | 451 ApiState* state = isolate->api_state(); |
452 ASSERT(state != NULL); | 452 ASSERT(state != NULL); |
453 ASSERT(true_handle_ == NULL); | 453 ASSERT(true_handle_ == NULL); |
(...skipping 4970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5424 | 5424 |
5425 | 5425 |
5426 DART_EXPORT void Dart_RegisterRootServiceRequestCallback( | 5426 DART_EXPORT void Dart_RegisterRootServiceRequestCallback( |
5427 const char* name, | 5427 const char* name, |
5428 Dart_ServiceRequestCallback callback, | 5428 Dart_ServiceRequestCallback callback, |
5429 void* user_data) { | 5429 void* user_data) { |
5430 Service::RegisterRootEmbedderCallback(name, callback, user_data); | 5430 Service::RegisterRootEmbedderCallback(name, callback, user_data); |
5431 } | 5431 } |
5432 | 5432 |
5433 } // namespace dart | 5433 } // namespace dart |
OLD | NEW |