| 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 class SsaCodeGeneratorTask extends CompilerTask { | 5 class SsaCodeGeneratorTask extends CompilerTask { |
| 6 final JavaScriptBackend backend; | 6 final JavaScriptBackend backend; |
| 7 SsaCodeGeneratorTask(JavaScriptBackend backend) | 7 SsaCodeGeneratorTask(JavaScriptBackend backend) |
| 8 : this.backend = backend, | 8 : this.backend = backend, |
| 9 super(backend.compiler); | 9 super(backend.compiler); |
| 10 String get name() => 'SSA code generator'; | 10 String get name() => 'SSA code generator'; |
| (...skipping 1670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1681 } | 1681 } |
| 1682 | 1682 |
| 1683 visitFieldGet(HFieldGet node) { | 1683 visitFieldGet(HFieldGet node) { |
| 1684 if (!node.isFromActivation()) { | 1684 if (!node.isFromActivation()) { |
| 1685 String name = compiler.namer.getName(node.element); | 1685 String name = compiler.namer.getName(node.element); |
| 1686 beginExpression(JSPrecedence.MEMBER_PRECEDENCE); | 1686 beginExpression(JSPrecedence.MEMBER_PRECEDENCE); |
| 1687 use(node.receiver, JSPrecedence.MEMBER_PRECEDENCE); | 1687 use(node.receiver, JSPrecedence.MEMBER_PRECEDENCE); |
| 1688 buffer.add('.'); | 1688 buffer.add('.'); |
| 1689 buffer.add(name); | 1689 buffer.add(name); |
| 1690 beginExpression(JSPrecedence.MEMBER_PRECEDENCE); | 1690 beginExpression(JSPrecedence.MEMBER_PRECEDENCE); |
| 1691 Type type = node.receiver.propagatedType.computeType(compiler); | |
| 1692 assert(type !== null); | |
| 1693 world.registerFieldGetter(node.element.name, type); | |
| 1694 } else { | 1691 } else { |
| 1695 use(node.receiver, JSPrecedence.EXPRESSION_PRECEDENCE); | 1692 use(node.receiver, JSPrecedence.EXPRESSION_PRECEDENCE); |
| 1696 } | 1693 } |
| 1697 } | 1694 } |
| 1698 | 1695 |
| 1699 visitFieldSet(HFieldSet node) { | 1696 visitFieldSet(HFieldSet node) { |
| 1700 String name; | 1697 String name; |
| 1701 if (!node.isFromActivation()) { | 1698 if (!node.isFromActivation()) { |
| 1702 name = compiler.namer.getName(node.element); | 1699 name = compiler.namer.getName(node.element); |
| 1703 beginExpression(JSPrecedence.ASSIGNMENT_PRECEDENCE); | 1700 beginExpression(JSPrecedence.ASSIGNMENT_PRECEDENCE); |
| 1704 use(node.receiver, JSPrecedence.MEMBER_PRECEDENCE); | 1701 use(node.receiver, JSPrecedence.MEMBER_PRECEDENCE); |
| 1705 buffer.add('.'); | 1702 buffer.add('.'); |
| 1706 buffer.add(name); | 1703 buffer.add(name); |
| 1707 Type type = node.receiver.propagatedType.computeType(compiler); | |
| 1708 assert(type !== null); | |
| 1709 world.registerFieldSetter(node.element.name, type); | |
| 1710 } else { | 1704 } else { |
| 1711 declareInstruction(node.receiver); | 1705 declareInstruction(node.receiver); |
| 1712 } | 1706 } |
| 1713 buffer.add(' = '); | 1707 buffer.add(' = '); |
| 1714 use(node.value, JSPrecedence.ASSIGNMENT_PRECEDENCE); | 1708 use(node.value, JSPrecedence.ASSIGNMENT_PRECEDENCE); |
| 1715 if (node.receiver !== null) { | 1709 if (node.receiver !== null) { |
| 1716 endExpression(JSPrecedence.ASSIGNMENT_PRECEDENCE); | 1710 endExpression(JSPrecedence.ASSIGNMENT_PRECEDENCE); |
| 1717 } | 1711 } |
| 1718 } | 1712 } |
| 1719 | 1713 |
| (...skipping 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2784 startBailoutSwitch(); | 2778 startBailoutSwitch(); |
| 2785 } | 2779 } |
| 2786 } | 2780 } |
| 2787 | 2781 |
| 2788 void endLabeledBlock(HLabeledBlockInformation labeledBlockInfo) { | 2782 void endLabeledBlock(HLabeledBlockInformation labeledBlockInfo) { |
| 2789 if (labeledBlockInfo.body.start.hasGuards()) { | 2783 if (labeledBlockInfo.body.start.hasGuards()) { |
| 2790 endBailoutSwitch(); | 2784 endBailoutSwitch(); |
| 2791 } | 2785 } |
| 2792 } | 2786 } |
| 2793 } | 2787 } |
| OLD | NEW |