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

Unified Diff: pkg/compiler/lib/src/js_backend/kernel_task.dart

Issue 2324213003: build kernel for the entire program after resolution (Closed)
Patch Set: Created 4 years, 3 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: pkg/compiler/lib/src/js_backend/kernel_task.dart
diff --git a/pkg/compiler/lib/src/js_backend/kernel_task.dart b/pkg/compiler/lib/src/js_backend/kernel_task.dart
new file mode 100644
index 0000000000000000000000000000000000000000..6361ccbca0979d0b7b48e0380d67f11778d55a89
--- /dev/null
+++ b/pkg/compiler/lib/src/js_backend/kernel_task.dart
@@ -0,0 +1,25 @@
+// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import '../compiler.dart';
+import '../kernel/kernel.dart';
+
+import 'backend.dart';
+
+/// Visits the compiler main function and builds the kernel representation.
+///
+/// This creates a mapping from kernel nodes to AST nodes to be used later.
+class KernelTask {
+ final Compiler _compiler;
+ final Kernel kernel;
+
+ KernelTask(JavaScriptBackend backend)
+ : this._compiler = backend.compiler,
+ this.kernel = new Kernel(backend.compiler);
+
+ void onQueueEmpty() {
+ kernel.functionToIr(_compiler.mainFunction);
+ kernel.processWorkQueue();
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698