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

Unified Diff: pkg/compiler/lib/src/kernel/kernel_strategy.dart

Issue 2899983003: Create KernelSsaBuilder from KernelSsaBuilderTask (Closed)
Patch Set: Updated cf. comments. Created 3 years, 7 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
« no previous file with comments | « pkg/compiler/lib/src/js_backend/element_strategy.dart ('k') | pkg/compiler/lib/src/ssa/builder_kernel.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/kernel/kernel_strategy.dart
diff --git a/pkg/compiler/lib/src/kernel/kernel_strategy.dart b/pkg/compiler/lib/src/kernel/kernel_strategy.dart
index 457f89639024eade683d564dc1719f2ffdd22de6..8176c97ea018a119ae6e8aeab64ba95fbf6fcf9a 100644
--- a/pkg/compiler/lib/src/kernel/kernel_strategy.dart
+++ b/pkg/compiler/lib/src/kernel/kernel_strategy.dart
@@ -31,10 +31,12 @@ import '../js_backend/native_data.dart';
import '../js_backend/no_such_method_registry.dart';
import '../js_backend/runtime_types.dart';
import '../js_emitter/sorter.dart';
+import '../kernel/element_map.dart';
import '../library_loader.dart';
import '../native/resolver.dart';
import '../serialization/task.dart';
import '../ssa/builder_kernel.dart';
+import '../ssa/nodes.dart';
import '../ssa/ssa.dart';
import '../patch_parser.dart';
import '../resolved_uri_translator.dart';
@@ -283,7 +285,7 @@ class KernelBackendStrategy implements BackendStrategy {
@override
SsaBuilderTask createSsaBuilderTask(JavaScriptBackend backend,
SourceInformationStrategy sourceInformationStrategy) {
- return new KernelSsaBuilderTask(backend.compiler.measurer);
+ return new KernelSsaBuilderTask(backend.compiler);
}
}
@@ -326,3 +328,28 @@ class KernelCodegenWorkItem extends CodegenWorkItem {
return _backend.codegen(this, _closedWorld);
}
}
+
+/// Task for building SSA from kernel IR loaded from .dill.
+class KernelSsaBuilderTask extends CompilerTask implements SsaBuilderTask {
+ final Compiler _compiler;
+
+ KernelSsaBuilderTask(this._compiler) : super(_compiler.measurer);
+
+ KernelToElementMap get _elementMap {
+ KernelFrontEndStrategy frontEndStrategy = _compiler.frontEndStrategy;
+ return frontEndStrategy.elementMap;
+ }
+
+ @override
+ HGraph build(CodegenWorkItem work, ClosedWorld closedWorld) {
+ KernelSsaBuilder builder = new KernelSsaBuilder(
+ work.element,
+ _compiler,
+ _elementMap,
+ closedWorld,
+ work.registry,
+ const SourceInformationBuilder(),
+ null);
+ return builder.build();
+ }
+}
« no previous file with comments | « pkg/compiler/lib/src/js_backend/element_strategy.dart ('k') | pkg/compiler/lib/src/ssa/builder_kernel.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698