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]. |