| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 SsaBuilderTask extends CompilerTask { | 5 class SsaBuilderTask extends CompilerTask { |
| 6 SsaBuilderTask(Compiler compiler) : super(compiler); | 6 SsaBuilderTask(Compiler compiler) : super(compiler); |
| 7 String get name() => 'SSA builder'; | 7 String get name() => 'SSA builder'; |
| 8 | 8 |
| 9 HGraph build(Node tree, Map<Node, Element> elements) { | 9 HGraph build(Node tree, Map<Node, Element> elements) { |
| 10 return measure(() { | 10 return measure(() { |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 void visitLiteralNull(LiteralNull node) { | 505 void visitLiteralNull(LiteralNull node) { |
| 506 push(new HLiteral(null)); | 506 push(new HLiteral(null)); |
| 507 } | 507 } |
| 508 | 508 |
| 509 visitNodeList(NodeList node) { | 509 visitNodeList(NodeList node) { |
| 510 for (Link<Node> link = node.nodes; !link.isEmpty(); link = link.tail) { | 510 for (Link<Node> link = node.nodes; !link.isEmpty(); link = link.tail) { |
| 511 visit(link.head); | 511 visit(link.head); |
| 512 } | 512 } |
| 513 } | 513 } |
| 514 | 514 |
| 515 void visitParenthesizedExpression(ParenthesizedExpression node) { |
| 516 visit(node.expression); |
| 517 } |
| 518 |
| 515 visitOperator(Operator node) { | 519 visitOperator(Operator node) { |
| 516 // Operators are intercepted in their surrounding Send nodes. | 520 // Operators are intercepted in their surrounding Send nodes. |
| 517 unreachable(); | 521 unreachable(); |
| 518 } | 522 } |
| 519 | 523 |
| 520 visitReturn(Return node) { | 524 visitReturn(Return node) { |
| 521 HInstruction value; | 525 HInstruction value; |
| 522 if (node.expression === null) { | 526 if (node.expression === null) { |
| 523 value = new HLiteral(null); | 527 value = new HLiteral(null); |
| 524 add(value); | 528 add(value); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 551 add(initialValue); | 555 add(initialValue); |
| 552 updateDefinition(definition, initialValue); | 556 updateDefinition(definition, initialValue); |
| 553 } else { | 557 } else { |
| 554 assert(definition is SendSet); | 558 assert(definition is SendSet); |
| 555 visitSendSet(definition); | 559 visitSendSet(definition); |
| 556 pop(); // Discard value. | 560 pop(); // Discard value. |
| 557 } | 561 } |
| 558 } | 562 } |
| 559 } | 563 } |
| 560 } | 564 } |
| OLD | NEW |