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

Unified Diff: pkg/compiler/lib/src/ssa/rasta_ssa_builder_task.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/ssa/builder_kernel.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/rasta_ssa_builder_task.dart
diff --git a/pkg/compiler/lib/src/ssa/rasta_ssa_builder_task.dart b/pkg/compiler/lib/src/ssa/rasta_ssa_builder_task.dart
new file mode 100644
index 0000000000000000000000000000000000000000..6968f0503900e3c5d65281f6f448f31d3f1be7a7
--- /dev/null
+++ b/pkg/compiler/lib/src/ssa/rasta_ssa_builder_task.dart
@@ -0,0 +1,64 @@
+// 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 '../elements/elements.dart';
+import '../io/source_information.dart';
+import '../js_backend/backend.dart' show JavaScriptBackend;
+import '../js_backend/element_strategy.dart' show ElementCodegenWorkItem;
+import '../kernel/kernel.dart';
+import '../world.dart';
+import 'builder.dart';
+import 'kernel_ast_adapter.dart';
+import 'nodes.dart';
+import 'builder_kernel.dart';
+
+/// Task for building SSA kernel IR generated from rasta.
+class RastaSsaBuilderTask extends SsaAstBuilderBase {
+ final SourceInformationStrategy sourceInformationFactory;
+
+ String get name => 'SSA kernel builder';
+
+ RastaSsaBuilderTask(JavaScriptBackend backend, this.sourceInformationFactory)
+ : super(backend);
+
+ HGraph build(ElementCodegenWorkItem work, ClosedWorld closedWorld) {
+ return measure(() {
+ if (handleConstantField(work)) {
+ // No code is generated for `work.element`.
+ return null;
+ }
+ MemberElement element = work.element.implementation;
+ ResolvedAst resolvedAst = work.resolvedAst;
+ Kernel kernel = backend.kernelTask.kernel;
+ KernelAstAdapter astAdapter = new KernelAstAdapter(kernel, backend,
+ work.resolvedAst, kernel.nodeToAst, kernel.nodeToElement);
+ KernelSsaBuilder builder = new KernelSsaBuilder(
+ element,
+ backend.compiler,
+ astAdapter,
+ closedWorld,
+ work.registry,
+ sourceInformationFactory.createBuilderForContext(resolvedAst),
+ resolvedAst.kind == ResolvedAstKind.PARSED ? resolvedAst.node : null);
+ HGraph graph = builder.build();
+
+ if (backend.tracer.isEnabled) {
+ String name;
+ if (element.isClassMember) {
+ String className = element.enclosingClass.name;
+ String memberName = element.name;
+ name = "$className.$memberName";
+ if (element.isGenerativeConstructorBody) {
+ name = "$name (body)";
+ }
+ } else {
+ name = "${element.name}";
+ }
+ backend.tracer.traceCompilation(name);
+ backend.tracer.traceGraph('builder', graph);
+ }
+
+ return graph;
+ });
+ }
+}
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder_kernel.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698