| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 part of tree_ir.optimization; | 5 part of tree_ir.optimization; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Performs the following transformations on the tree: | 8 * Performs the following transformations on the tree: |
| 9 * - Assignment propagation | 9 * - Assignment propagation |
| 10 * - If-to-conditional conversion | 10 * - If-to-conditional conversion |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 } | 185 } |
| 186 | 186 |
| 187 Expression visitInvokeMethod(InvokeMethod node) { | 187 Expression visitInvokeMethod(InvokeMethod node) { |
| 188 for (int i = node.arguments.length - 1; i >= 0; --i) { | 188 for (int i = node.arguments.length - 1; i >= 0; --i) { |
| 189 node.arguments[i] = visitExpression(node.arguments[i]); | 189 node.arguments[i] = visitExpression(node.arguments[i]); |
| 190 } | 190 } |
| 191 node.receiver = visitExpression(node.receiver); | 191 node.receiver = visitExpression(node.receiver); |
| 192 return node; | 192 return node; |
| 193 } | 193 } |
| 194 | 194 |
| 195 Expression visitInvokeSuperMethod(InvokeSuperMethod node) { | 195 Expression visitInvokeMethodDirectly(InvokeMethodDirectly node) { |
| 196 for (int i = node.arguments.length - 1; i >= 0; --i) { | 196 for (int i = node.arguments.length - 1; i >= 0; --i) { |
| 197 node.arguments[i] = visitExpression(node.arguments[i]); | 197 node.arguments[i] = visitExpression(node.arguments[i]); |
| 198 } | 198 } |
| 199 node.receiver = visitExpression(node.receiver); |
| 199 return node; | 200 return node; |
| 200 } | 201 } |
| 201 | 202 |
| 202 Expression visitInvokeConstructor(InvokeConstructor node) { | 203 Expression visitInvokeConstructor(InvokeConstructor node) { |
| 203 for (int i = node.arguments.length - 1; i >= 0; --i) { | 204 for (int i = node.arguments.length - 1; i >= 0; --i) { |
| 204 node.arguments[i] = visitExpression(node.arguments[i]); | 205 node.arguments[i] = visitExpression(node.arguments[i]); |
| 205 } | 206 } |
| 206 return node; | 207 return node; |
| 207 } | 208 } |
| 208 | 209 |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 } | 590 } |
| 590 | 591 |
| 591 Expression makeCondition(Expression e, bool polarity) { | 592 Expression makeCondition(Expression e, bool polarity) { |
| 592 return polarity ? e : new Not(e); | 593 return polarity ? e : new Not(e); |
| 593 } | 594 } |
| 594 | 595 |
| 595 Statement getBranch(If node, bool polarity) { | 596 Statement getBranch(If node, bool polarity) { |
| 596 return polarity ? node.thenStatement : node.elseStatement; | 597 return polarity ? node.thenStatement : node.elseStatement; |
| 597 } | 598 } |
| 598 } | 599 } |
| OLD | NEW |