| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 ssa; | 5 part of ssa; |
| 6 | 6 |
| 7 class SsaCodeGeneratorTask extends CompilerTask { | 7 class SsaCodeGeneratorTask extends CompilerTask { |
| 8 | 8 |
| 9 final JavaScriptBackend backend; | 9 final JavaScriptBackend backend; |
| 10 | 10 |
| (...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 788 expressions = sequence.expressions; | 788 expressions = sequence.expressions; |
| 789 } else { | 789 } else { |
| 790 expressions = <js.Expression>[jsInitialization]; | 790 expressions = <js.Expression>[jsInitialization]; |
| 791 } | 791 } |
| 792 bool canTransformToVariableDeclaration = true; | 792 bool canTransformToVariableDeclaration = true; |
| 793 for (js.Expression expression in expressions) { | 793 for (js.Expression expression in expressions) { |
| 794 bool expressionIsVariableAssignment = false; | 794 bool expressionIsVariableAssignment = false; |
| 795 if (expression is js.Assignment) { | 795 if (expression is js.Assignment) { |
| 796 js.Assignment assignment = expression; | 796 js.Assignment assignment = expression; |
| 797 if (assignment.leftHandSide is js.VariableUse && | 797 if (assignment.leftHandSide is js.VariableUse && |
| 798 assignment.compoundTarget == null) { | 798 !assignment.isCompound) { |
| 799 expressionIsVariableAssignment = true; | 799 expressionIsVariableAssignment = true; |
| 800 } | 800 } |
| 801 } | 801 } |
| 802 if (!expressionIsVariableAssignment) { | 802 if (!expressionIsVariableAssignment) { |
| 803 canTransformToVariableDeclaration = false; | 803 canTransformToVariableDeclaration = false; |
| 804 break; | 804 break; |
| 805 } | 805 } |
| 806 } | 806 } |
| 807 if (canTransformToVariableDeclaration) { | 807 if (canTransformToVariableDeclaration) { |
| 808 List<js.VariableInitialization> inits = | 808 List<js.VariableInitialization> inits = |
| (...skipping 1872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2681 js.PropertyAccess accessHelper(String name) { | 2681 js.PropertyAccess accessHelper(String name) { |
| 2682 Element helper = compiler.findHelper(name); | 2682 Element helper = compiler.findHelper(name); |
| 2683 if (helper == null) { | 2683 if (helper == null) { |
| 2684 // For mocked-up tests. | 2684 // For mocked-up tests. |
| 2685 return js.js('(void 0).$name'); | 2685 return js.js('(void 0).$name'); |
| 2686 } | 2686 } |
| 2687 world.registerStaticUse(helper); | 2687 world.registerStaticUse(helper); |
| 2688 return backend.namer.elementAccess(helper); | 2688 return backend.namer.elementAccess(helper); |
| 2689 } | 2689 } |
| 2690 } | 2690 } |
| OLD | NEW |