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 b5a458c26db567032d40e9211aa509d3b8752ee9..7891c82e10259cc415b7e88292951c7bb9c341b6 100644 |
| --- a/pkg/compiler/lib/src/ssa/builder_kernel.dart |
| +++ b/pkg/compiler/lib/src/ssa/builder_kernel.dart |
| @@ -86,6 +86,9 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder { |
| LoopHandler<ir.Node> loopHandler; |
| TypeBuilder typeBuilder; |
| + final Map<ir.VariableDeclaration, HInstruction> letBindings = |
| + <ir.VariableDeclaration, HInstruction>{}; |
| + |
| KernelSsaBuilder( |
| this.targetElement, |
| this.resolvedAst, |
| @@ -939,11 +942,29 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder { |
| @override |
| void visitVariableGet(ir.VariableGet variableGet) { |
| + ir.VariableDeclaration variable = variableGet.variable; |
| + HInstruction letBinding = letBindings[variable]; |
| + if (letBinding != null) { |
| + stack.add(letBinding); |
| + return; |
| + } |
| + |
| Local local = astAdapter.getLocal(variableGet.variable); |
| stack.add(localsHandler.readLocal(local)); |
| } |
| @override |
| + void visitPropertySet(ir.PropertySet propertySet) { |
| + propertySet.receiver.accept(this); |
| + HInstruction receiver = pop(); |
| + propertySet.value.accept(this); |
| + HInstruction value = pop(); |
| + |
| + _pushDynamicInvocation(propertySet, astAdapter.typeOfSet(propertySet), |
| + <HInstruction>[receiver, value]); |
|
asgerf
2016/11/24 09:44:32
PropertySet should evaluate to its right-hand side
sra1
2016/11/24 23:53:52
Done.
|
| + } |
| + |
| + @override |
| void visitVariableSet(ir.VariableSet variableSet) { |
| variableSet.value.accept(this); |
| HInstruction value = pop(); |
| @@ -984,6 +1005,16 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder { |
| value, astAdapter.getDartType(variable.type))); |
| } |
| + @override |
| + void visitLet(ir.Let let) { |
| + ir.VariableDeclaration variable = let.variable; |
| + variable.initializer.accept(this); |
| + HInstruction initializedValue = pop(); |
| + // TODO(sra): Apply inferred type information. |
| + letBindings[variable] = initializedValue; |
| + let.body.accept(this); |
| + } |
| + |
| // TODO(het): Also extract type arguments |
| /// Extracts the list of instructions for the expressions in the arguments. |
| List<HInstruction> _visitArguments(ir.Arguments arguments) { |
| @@ -1453,6 +1484,8 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder { |
| // TODO(het): Decide when to inline |
| @override |
| void visitMethodInvocation(ir.MethodInvocation invocation) { |
| + print('visitMethodInvocation ${invocation}'); |
|
asgerf
2016/11/24 09:44:32
Stray print
sra1
2016/11/24 23:53:52
Done.
|
| + |
| invocation.receiver.accept(this); |
| HInstruction receiver = pop(); |