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 1489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1500 } | 1500 } |
1501 buffer.add('$className.prototype.$methodName.call'); | 1501 buffer.add('$className.prototype.$methodName.call'); |
1502 visitArguments(node.inputs); | 1502 visitArguments(node.inputs); |
1503 } | 1503 } |
1504 endExpression(JSPrecedence.CALL_PRECEDENCE); | 1504 endExpression(JSPrecedence.CALL_PRECEDENCE); |
1505 world.registerStaticUse(superMethod); | 1505 world.registerStaticUse(superMethod); |
1506 } | 1506 } |
1507 | 1507 |
1508 visitFieldGet(HFieldGet node) { | 1508 visitFieldGet(HFieldGet node) { |
1509 if (!node.isFromActivation()) { | 1509 if (!node.isFromActivation()) { |
1510 String name = | 1510 String name = compiler.namer.getName(node.element); |
1511 compiler.namer.instanceFieldName(currentLibrary, node.name); | |
1512 beginExpression(JSPrecedence.MEMBER_PRECEDENCE); | 1511 beginExpression(JSPrecedence.MEMBER_PRECEDENCE); |
1513 use(node.receiver, JSPrecedence.MEMBER_PRECEDENCE); | 1512 use(node.receiver, JSPrecedence.MEMBER_PRECEDENCE); |
1514 buffer.add('.'); | 1513 buffer.add('.'); |
1515 buffer.add(name); | 1514 buffer.add(name); |
1516 beginExpression(JSPrecedence.MEMBER_PRECEDENCE); | 1515 beginExpression(JSPrecedence.MEMBER_PRECEDENCE); |
1517 } else { | 1516 } else { |
1518 use(node.receiver, JSPrecedence.EXPRESSION_PRECEDENCE); | 1517 use(node.receiver, JSPrecedence.EXPRESSION_PRECEDENCE); |
1519 } | 1518 } |
1520 } | 1519 } |
1521 | 1520 |
1522 visitFieldSet(HFieldSet node) { | 1521 visitFieldSet(HFieldSet node) { |
1523 String name; | 1522 String name; |
1524 if (!node.isFromActivation()) { | 1523 if (!node.isFromActivation()) { |
1525 name = | 1524 name = compiler.namer.getName(node.element); |
1526 compiler.namer.instanceFieldName(currentLibrary, node.name); | |
1527 beginExpression(JSPrecedence.ASSIGNMENT_PRECEDENCE); | 1525 beginExpression(JSPrecedence.ASSIGNMENT_PRECEDENCE); |
1528 use(node.receiver, JSPrecedence.MEMBER_PRECEDENCE); | 1526 use(node.receiver, JSPrecedence.MEMBER_PRECEDENCE); |
1529 buffer.add('.'); | 1527 buffer.add('.'); |
1530 buffer.add(name); | 1528 buffer.add(name); |
1531 } else { | 1529 } else { |
1532 use(node.receiver, JSPrecedence.EXPRESSION_PRECEDENCE); | 1530 use(node.receiver, JSPrecedence.EXPRESSION_PRECEDENCE); |
1533 } | 1531 } |
1534 buffer.add(' = '); | 1532 buffer.add(' = '); |
1535 use(node.value, JSPrecedence.ASSIGNMENT_PRECEDENCE); | 1533 use(node.value, JSPrecedence.ASSIGNMENT_PRECEDENCE); |
1536 if (node.receiver !== null) { | 1534 if (node.receiver !== null) { |
(...skipping 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2575 startBailoutSwitch(); | 2573 startBailoutSwitch(); |
2576 } | 2574 } |
2577 } | 2575 } |
2578 | 2576 |
2579 void endLabeledBlock(HLabeledBlockInformation labeledBlockInfo) { | 2577 void endLabeledBlock(HLabeledBlockInformation labeledBlockInfo) { |
2580 if (labeledBlockInfo.body.start.hasGuards()) { | 2578 if (labeledBlockInfo.body.start.hasGuards()) { |
2581 endBailoutSwitch(); | 2579 endBailoutSwitch(); |
2582 } | 2580 } |
2583 } | 2581 } |
2584 } | 2582 } |
OLD | NEW |