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

Unified Diff: pkg/compiler/lib/src/ssa/builder_kernel.dart

Issue 2378113004: Some kernel->ssa cleanups. (Closed)
Patch Set: fix import 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
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder.dart ('k') | pkg/compiler/lib/src/ssa/graph_builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/builder_kernel.dart
diff --git a/pkg/compiler/lib/src/ssa/builder_kernel.dart b/pkg/compiler/lib/src/ssa/builder_kernel.dart
index 807c1fcfaf80b62144225e8d3a6c3b962f29c827..a309e3911e9bcdfa4f59b3942ccca4d25a70a8b8 100644
--- a/pkg/compiler/lib/src/ssa/builder_kernel.dart
+++ b/pkg/compiler/lib/src/ssa/builder_kernel.dart
@@ -53,8 +53,10 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder {
final ResolvedAst resolvedAst;
final CodegenRegistry registry;
+ @override
JavaScriptBackend get backend => compiler.backend;
+ @override
TreeElements get elements => resolvedAst.elements;
SourceInformationBuilder sourceInformationBuilder;
@@ -98,13 +100,7 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder {
} else if (target is ir.Field) {
buildField(target);
} else if (target is ir.Constructor) {
- // TODO(het): Actually handle this correctly
- HBasicBlock block = graph.addNewBlock();
- open(graph.entry);
- close(new HGoto()).addSuccessor(block);
- open(block);
- closeAndGotoExit(new HGoto());
- graph.finalize();
+ buildConstructor(target);
}
assert(graph.isValid());
return graph;
@@ -127,12 +123,14 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder {
return result;
}
- // TODO(het): This implementation is shared with [SsaBuilder]. Should we just
- // allow [GraphBuilder] to access `compiler`?
- @override
- pushCheckNull(HInstruction expression) {
- push(new HIdentity(
- expression, graph.addConstantNull(compiler), null, backend.boolType));
+ void buildConstructor(ir.Constructor constructor) {
+ // TODO(het): Actually handle this correctly
+ HBasicBlock block = graph.addNewBlock();
+ open(graph.entry);
+ close(new HGoto()).addSuccessor(block);
+ open(block);
+ closeAndGotoExit(new HGoto());
+ graph.finalize();
}
/// Builds a SSA graph for [procedure].
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder.dart ('k') | pkg/compiler/lib/src/ssa/graph_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698