| 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 "lib/stacktrace.h" | 9 #include "lib/stacktrace.h" |
| 10 #include "platform/assert.h" | 10 #include "platform/assert.h" |
| (...skipping 5850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5861 #ifdef DART_PRECOMPILED_RUNTIME | 5861 #ifdef DART_PRECOMPILED_RUNTIME |
| 5862 Dart_KernelCompilationResult result; | 5862 Dart_KernelCompilationResult result; |
| 5863 result.status = Dart_KernelCompilationStatus_Unknown; | 5863 result.status = Dart_KernelCompilationStatus_Unknown; |
| 5864 result.error = strdup("Dart_CompileToKernel is unsupported."); | 5864 result.error = strdup("Dart_CompileToKernel is unsupported."); |
| 5865 return result; | 5865 return result; |
| 5866 #else | 5866 #else |
| 5867 return KernelIsolate::CompileToKernel(script_uri); | 5867 return KernelIsolate::CompileToKernel(script_uri); |
| 5868 #endif | 5868 #endif |
| 5869 } | 5869 } |
| 5870 | 5870 |
| 5871 static Dart_KernelCompilationResult CompileSourcesToKernel( |
| 5872 const char* script_uri, |
| 5873 int source_files_count, |
| 5874 Dart_SourceFile sources[], |
| 5875 bool incremental) { |
| 5876 #ifdef DART_PRECOMPILED_RUNTIME |
| 5877 Dart_KernelCompilationResult result; |
| 5878 result.status = Dart_KernelCompilationStatus_Unknown; |
| 5879 result.error = strdup("Dart_CompileSourcesToKernel is unsupported."); |
| 5880 return result; |
| 5881 #else |
| 5882 return KernelIsolate::CompileToKernel(script_uri, source_files_count, sources, |
| 5883 incremental); |
| 5884 #endif |
| 5885 } |
| 5886 |
| 5871 DART_EXPORT Dart_KernelCompilationResult | 5887 DART_EXPORT Dart_KernelCompilationResult |
| 5872 Dart_CompileSourcesToKernel(const char* script_uri, | 5888 Dart_CompileSourcesToKernel(const char* script_uri, |
| 5873 int source_files_count, | 5889 int source_files_count, |
| 5874 Dart_SourceFile sources[]) { | 5890 Dart_SourceFile sources[]) { |
| 5875 #ifdef DART_PRECOMPILED_RUNTIME | 5891 return CompileSourcesToKernel(script_uri, source_files_count, sources, |
| 5876 Dart_KernelCompilationResult result; | 5892 false /* incremental */); |
| 5877 result.status = Dart_KernelCompilationStatus_Unknown; | 5893 } |
| 5878 result.error = strdup("Dart_CompileSourcesToKernel is unsupported."); | 5894 |
| 5879 return result; | 5895 DART_EXPORT Dart_KernelCompilationResult |
| 5880 #else | 5896 Dart_IncrementallyCompileSourcesToKernel(const char* script_uri, |
| 5881 return KernelIsolate::CompileToKernel(script_uri, source_files_count, | 5897 int source_files_count, |
| 5882 sources); | 5898 Dart_SourceFile sources[]) { |
| 5883 #endif | 5899 return CompileSourcesToKernel(script_uri, source_files_count, sources, |
| 5900 true /* incremental */); |
| 5884 } | 5901 } |
| 5885 | 5902 |
| 5886 // --- Service support --- | 5903 // --- Service support --- |
| 5887 | 5904 |
| 5888 DART_EXPORT bool Dart_IsServiceIsolate(Dart_Isolate isolate) { | 5905 DART_EXPORT bool Dart_IsServiceIsolate(Dart_Isolate isolate) { |
| 5889 Isolate* iso = reinterpret_cast<Isolate*>(isolate); | 5906 Isolate* iso = reinterpret_cast<Isolate*>(isolate); |
| 5890 return ServiceIsolate::IsServiceIsolate(iso); | 5907 return ServiceIsolate::IsServiceIsolate(iso); |
| 5891 } | 5908 } |
| 5892 | 5909 |
| 5893 DART_EXPORT Dart_Port Dart_ServiceWaitForLoadPort() { | 5910 DART_EXPORT Dart_Port Dart_ServiceWaitForLoadPort() { |
| (...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6770 #endif | 6787 #endif |
| 6771 } | 6788 } |
| 6772 | 6789 |
| 6773 DART_EXPORT void Dart_DumpNativeStackTrace(void* context) { | 6790 DART_EXPORT void Dart_DumpNativeStackTrace(void* context) { |
| 6774 #ifndef PRODUCT | 6791 #ifndef PRODUCT |
| 6775 Profiler::DumpStackTrace(context); | 6792 Profiler::DumpStackTrace(context); |
| 6776 #endif | 6793 #endif |
| 6777 } | 6794 } |
| 6778 | 6795 |
| 6779 } // namespace dart | 6796 } // namespace dart |
| OLD | NEW |