Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(299)

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 2993013002: Introduce IKG into kernel-service to support incremental compilation. (Closed)
Patch Set: Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: runtime/vm/dart_api_impl.cc
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index 4bc1125f23058b732b486cee122f850f03dd89db..f02da77da38680860a5659751abef9f341ded32f 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -5868,21 +5868,38 @@ Dart_CompileToKernel(const char* script_uri) {
#endif
}
-DART_EXPORT Dart_KernelCompilationResult
-Dart_CompileSourcesToKernel(const char* script_uri,
- int source_files_count,
- Dart_SourceFile sources[]) {
+static Dart_KernelCompilationResult CompileSourcesToKernel(
+ const char* script_uri,
+ int source_files_count,
+ Dart_SourceFile sources[],
+ bool incremental) {
#ifdef DART_PRECOMPILED_RUNTIME
Dart_KernelCompilationResult result;
result.status = Dart_KernelCompilationStatus_Unknown;
result.error = strdup("Dart_CompileSourcesToKernel is unsupported.");
return result;
#else
- return KernelIsolate::CompileToKernel(script_uri, source_files_count,
- sources);
+ return KernelIsolate::CompileToKernel(script_uri, source_files_count, sources,
+ incremental);
#endif
}
+DART_EXPORT Dart_KernelCompilationResult
+Dart_CompileSourcesToKernel(const char* script_uri,
+ int source_files_count,
+ Dart_SourceFile sources[]) {
+ return CompileSourcesToKernel(script_uri, source_files_count, sources,
+ false /* incremental */);
+}
+
+DART_EXPORT Dart_KernelCompilationResult
+Dart_IncrementallyCompileSourcesToKernel(const char* script_uri,
+ int source_files_count,
+ Dart_SourceFile sources[]) {
+ return CompileSourcesToKernel(script_uri, source_files_count, sources,
+ true /* incremental */);
+}
+
// --- Service support ---
DART_EXPORT bool Dart_IsServiceIsolate(Dart_Isolate isolate) {

Powered by Google App Engine
This is Rietveld 408576698