Chromium Code Reviews| 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 45f6914ae8e806bf84ee0bebfa1787bfee4f91b3..c4936864a013d00b42f097feaadb43364c084019 100644 |
| --- a/pkg/compiler/lib/src/ssa/builder_kernel.dart |
| +++ b/pkg/compiler/lib/src/ssa/builder_kernel.dart |
| @@ -141,6 +141,9 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder { |
| } else if (target is ir.FunctionExpression) { |
| target = (target as ir.FunctionExpression).function; |
| buildFunctionNode(target); |
| + } else if (target is ir.FunctionDeclaration) { |
| + target = (target as ir.FunctionDeclaration).function; |
| + buildFunctionNode(target); |
|
sra1
2016/12/06 23:26:15
why not:
buildFunctionNode(target.function);
you
|
| } else { |
| throw 'No case implemented to handle $target'; |
| } |
| @@ -1650,8 +1653,8 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder { |
| } |
| @override |
| - void visitFunctionExpression(ir.FunctionExpression funcExpression) { |
| - LocalFunctionElement methodElement = astAdapter.getElement(funcExpression); |
| + visitFunctionNode(ir.FunctionNode node) { |
| + LocalFunctionElement methodElement = astAdapter.getElement(node); |
| ClosureClassMap nestedClosureData = compiler.closureToClassMapper |
| .getClosureToClassMapping(methodElement.resolvedAst); |
| assert(nestedClosureData != null); |
| @@ -1680,6 +1683,22 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder { |
| registry?.registerInstantiatedClosure(methodElement); |
| } |
| + @override |
| + visitFunctionDeclaration(ir.FunctionDeclaration declaration) { |
| + assert(isReachable); |
| + declaration.function.accept(this); |
| + LocalFunctionElement localFunction = astAdapter.getElement( |
| + declaration.function); |
| + //LocalFunctionElement localFunction = |
| + // elements.getFunctionDefinition(declaration.function); |
|
sra1
2016/12/06 23:26:15
comment
|
| + localsHandler.updateLocal(localFunction, pop()); |
| + } |
| + |
| + @override |
| + void visitFunctionExpression(ir.FunctionExpression funcExpression) { |
| + funcExpression.function.accept(this); |
| + } |
| + |
| // TODO(het): Decide when to inline |
| @override |
| void visitMethodInvocation(ir.MethodInvocation invocation) { |