| 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 "lib/stacktrace.h" | 10 #include "lib/stacktrace.h" |
| 11 #include "vm/class_finalizer.h" | 11 #include "vm/class_finalizer.h" |
| 12 #include "vm/clustered_snapshot.h" | 12 #include "vm/clustered_snapshot.h" |
| 13 #include "vm/compiler.h" | 13 #include "vm/compiler.h" |
| 14 #include "vm/dart.h" | 14 #include "vm/dart.h" |
| 15 #include "vm/dart_api_impl.h" | 15 #include "vm/dart_api_impl.h" |
| 16 #include "vm/dart_api_message.h" | 16 #include "vm/dart_api_message.h" |
| 17 #include "vm/dart_api_state.h" | 17 #include "vm/dart_api_state.h" |
| 18 #include "vm/dart_entry.h" | 18 #include "vm/dart_entry.h" |
| 19 #include "vm/debugger.h" | 19 #include "vm/debugger.h" |
| 20 #if !defined(DART_PRECOMPILED_RUNTIME) | 20 #if !defined(DART_PRECOMPILED_RUNTIME) |
| 21 #include "vm/kernel_reader.h" | 21 #include "vm/kernel_reader.h" |
| 22 #endif | 22 #endif |
| 23 #include "vm/exceptions.h" | 23 #include "vm/exceptions.h" |
| 24 #include "vm/flags.h" | 24 #include "vm/flags.h" |
| 25 #include "vm/growable_array.h" | 25 #include "vm/growable_array.h" |
| 26 #include "vm/lockers.h" | 26 #include "vm/lockers.h" |
| 27 #include "vm/isolate_reload.h" | 27 #include "vm/isolate_reload.h" |
| 28 #include "vm/kernel_isolate.h" | |
| 29 #include "vm/message.h" | 28 #include "vm/message.h" |
| 30 #include "vm/message_handler.h" | 29 #include "vm/message_handler.h" |
| 31 #include "vm/native_entry.h" | 30 #include "vm/native_entry.h" |
| 32 #include "vm/object.h" | 31 #include "vm/object.h" |
| 33 #include "vm/object_store.h" | 32 #include "vm/object_store.h" |
| 34 #include "vm/os_thread.h" | 33 #include "vm/os_thread.h" |
| 35 #include "vm/os.h" | 34 #include "vm/os.h" |
| 36 #include "vm/port.h" | 35 #include "vm/port.h" |
| 37 #include "vm/precompiler.h" | 36 #include "vm/precompiler.h" |
| 38 #include "vm/profiler.h" | 37 #include "vm/profiler.h" |
| (...skipping 5932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5971 } | 5970 } |
| 5972 { | 5971 { |
| 5973 NoSafepointScope no_safepoint; | 5972 NoSafepointScope no_safepoint; |
| 5974 RawObject* raw_obj = obj.raw(); | 5973 RawObject* raw_obj = obj.raw(); |
| 5975 thread->isolate()->heap()->SetPeer(raw_obj, peer); | 5974 thread->isolate()->heap()->SetPeer(raw_obj, peer); |
| 5976 } | 5975 } |
| 5977 return Api::Success(); | 5976 return Api::Success(); |
| 5978 } | 5977 } |
| 5979 | 5978 |
| 5980 | 5979 |
| 5981 // --- Dart Front-End (Kernel) support --- | |
| 5982 | |
| 5983 DART_EXPORT bool Dart_IsKernelIsolate(Dart_Isolate isolate) { | |
| 5984 #ifdef DART_PRECOMPILED_RUNTIME | |
| 5985 return false; | |
| 5986 #else | |
| 5987 Isolate* iso = reinterpret_cast<Isolate*>(isolate); | |
| 5988 return KernelIsolate::IsKernelIsolate(iso); | |
| 5989 #endif | |
| 5990 } | |
| 5991 | |
| 5992 | |
| 5993 DART_EXPORT bool Dart_KernelIsolateIsRunning() { | |
| 5994 #ifdef DART_PRECOMPILED_RUNTIME | |
| 5995 return false; | |
| 5996 #else | |
| 5997 return KernelIsolate::IsRunning(); | |
| 5998 #endif | |
| 5999 } | |
| 6000 | |
| 6001 | |
| 6002 DART_EXPORT Dart_Port Dart_ServiceWaitForKernelPort() { | |
| 6003 #ifdef DART_PRECOMPILED_RUNTIME | |
| 6004 return ILLEGAL_PORT; | |
| 6005 #else | |
| 6006 return KernelIsolate::WaitForKernelPort(); | |
| 6007 #endif | |
| 6008 } | |
| 6009 | |
| 6010 DART_EXPORT Dart_Port Dart_KernelPort() { | |
| 6011 #ifdef DART_PRECOMPILED_RUNTIME | |
| 6012 return false; | |
| 6013 #else | |
| 6014 return KernelIsolate::KernelPort(); | |
| 6015 #endif | |
| 6016 } | |
| 6017 | |
| 6018 | |
| 6019 // --- Service support --- | 5980 // --- Service support --- |
| 6020 | 5981 |
| 6021 DART_EXPORT bool Dart_IsServiceIsolate(Dart_Isolate isolate) { | 5982 DART_EXPORT bool Dart_IsServiceIsolate(Dart_Isolate isolate) { |
| 6022 Isolate* iso = reinterpret_cast<Isolate*>(isolate); | 5983 Isolate* iso = reinterpret_cast<Isolate*>(isolate); |
| 6023 return ServiceIsolate::IsServiceIsolate(iso); | 5984 return ServiceIsolate::IsServiceIsolate(iso); |
| 6024 } | 5985 } |
| 6025 | 5986 |
| 6026 | 5987 |
| 6027 DART_EXPORT Dart_Port Dart_ServiceWaitForLoadPort() { | 5988 DART_EXPORT Dart_Port Dart_ServiceWaitForLoadPort() { |
| 6028 return ServiceIsolate::WaitForLoadPort(); | 5989 return ServiceIsolate::WaitForLoadPort(); |
| (...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6711 } | 6672 } |
| 6712 | 6673 |
| 6713 | 6674 |
| 6714 DART_EXPORT void Dart_DumpNativeStackTrace(void* context) { | 6675 DART_EXPORT void Dart_DumpNativeStackTrace(void* context) { |
| 6715 #ifndef PRODUCT | 6676 #ifndef PRODUCT |
| 6716 Profiler::DumpStackTrace(context); | 6677 Profiler::DumpStackTrace(context); |
| 6717 #endif | 6678 #endif |
| 6718 } | 6679 } |
| 6719 | 6680 |
| 6720 } // namespace dart | 6681 } // namespace dart |
| OLD | NEW |