| 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 1552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1563 } | 1563 } |
| 1564 | 1564 |
| 1565 visitFieldGet(HFieldGet node) { | 1565 visitFieldGet(HFieldGet node) { |
| 1566 if (!node.isFromActivation()) { | 1566 if (!node.isFromActivation()) { |
| 1567 String name = compiler.namer.getName(node.element); | 1567 String name = compiler.namer.getName(node.element); |
| 1568 beginExpression(JSPrecedence.MEMBER_PRECEDENCE); | 1568 beginExpression(JSPrecedence.MEMBER_PRECEDENCE); |
| 1569 use(node.receiver, JSPrecedence.MEMBER_PRECEDENCE); | 1569 use(node.receiver, JSPrecedence.MEMBER_PRECEDENCE); |
| 1570 buffer.add('.'); | 1570 buffer.add('.'); |
| 1571 buffer.add(name); | 1571 buffer.add(name); |
| 1572 beginExpression(JSPrecedence.MEMBER_PRECEDENCE); | 1572 beginExpression(JSPrecedence.MEMBER_PRECEDENCE); |
| 1573 Type type = node.receiver.propagatedType.computeType(compiler); |
| 1574 assert(type !== null); |
| 1575 world.registerFieldGetter(node.element.name, type); |
| 1573 } else { | 1576 } else { |
| 1574 use(node.receiver, JSPrecedence.EXPRESSION_PRECEDENCE); | 1577 use(node.receiver, JSPrecedence.EXPRESSION_PRECEDENCE); |
| 1575 } | 1578 } |
| 1576 } | 1579 } |
| 1577 | 1580 |
| 1578 visitFieldSet(HFieldSet node) { | 1581 visitFieldSet(HFieldSet node) { |
| 1579 String name; | 1582 String name; |
| 1580 if (!node.isFromActivation()) { | 1583 if (!node.isFromActivation()) { |
| 1581 name = compiler.namer.getName(node.element); | 1584 name = compiler.namer.getName(node.element); |
| 1582 beginExpression(JSPrecedence.ASSIGNMENT_PRECEDENCE); | 1585 beginExpression(JSPrecedence.ASSIGNMENT_PRECEDENCE); |
| 1583 use(node.receiver, JSPrecedence.MEMBER_PRECEDENCE); | 1586 use(node.receiver, JSPrecedence.MEMBER_PRECEDENCE); |
| 1584 buffer.add('.'); | 1587 buffer.add('.'); |
| 1585 buffer.add(name); | 1588 buffer.add(name); |
| 1589 Type type = node.receiver.propagatedType.computeType(compiler); |
| 1590 assert(type !== null); |
| 1591 world.registerFieldSetter(node.element.name, type); |
| 1586 } else { | 1592 } else { |
| 1587 declareInstruction(node.receiver); | 1593 declareInstruction(node.receiver); |
| 1588 } | 1594 } |
| 1589 buffer.add(' = '); | 1595 buffer.add(' = '); |
| 1590 use(node.value, JSPrecedence.ASSIGNMENT_PRECEDENCE); | 1596 use(node.value, JSPrecedence.ASSIGNMENT_PRECEDENCE); |
| 1591 if (node.receiver !== null) { | 1597 if (node.receiver !== null) { |
| 1592 endExpression(JSPrecedence.ASSIGNMENT_PRECEDENCE); | 1598 endExpression(JSPrecedence.ASSIGNMENT_PRECEDENCE); |
| 1593 } | 1599 } |
| 1594 } | 1600 } |
| 1595 | 1601 |
| (...skipping 1105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2701 startBailoutSwitch(); | 2707 startBailoutSwitch(); |
| 2702 } | 2708 } |
| 2703 } | 2709 } |
| 2704 | 2710 |
| 2705 void endLabeledBlock(HLabeledBlockInformation labeledBlockInfo) { | 2711 void endLabeledBlock(HLabeledBlockInformation labeledBlockInfo) { |
| 2706 if (labeledBlockInfo.body.start.hasGuards()) { | 2712 if (labeledBlockInfo.body.start.hasGuards()) { |
| 2707 endBailoutSwitch(); | 2713 endBailoutSwitch(); |
| 2708 } | 2714 } |
| 2709 } | 2715 } |
| 2710 } | 2716 } |
| OLD | NEW |