| 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 visitNodeList(NodeList node) { | 166 visitNodeList(NodeList node) { |
| 167 for (Link<Node> link = node.nodes; !link.isEmpty(); link = link.tail) { | 167 for (Link<Node> link = node.nodes; !link.isEmpty(); link = link.tail) { |
| 168 visit(link.head); | 168 visit(link.head); |
| 169 } | 169 } |
| 170 } | 170 } |
| 171 | 171 |
| 172 visitOperator(Operator node) { | 172 visitOperator(Operator node) { |
| 173 compiler.unimplemented("SsaBuilder.visitOperator"); | 173 compiler.unimplemented("SsaBuilder.visitOperator"); |
| 174 } | 174 } |
| 175 | 175 |
| 176 visitParameter(Parameter node) { | |
| 177 compiler.unimplemented("SsaBuilder.visitParameter"); | |
| 178 } | |
| 179 | |
| 180 visitReturn(Return node) { | 176 visitReturn(Return node) { |
| 181 visit(node.expression); | 177 visit(node.expression); |
| 182 var value = pop(); | 178 var value = pop(); |
| 183 add(new HReturn(value)); | 179 add(new HReturn(value)); |
| 184 graph.setSuccessors(block, <HBasicBlock>[graph.exit]); | 180 graph.setSuccessors(block, <HBasicBlock>[graph.exit]); |
| 185 } | 181 } |
| 186 | 182 |
| 187 visitTypeAnnotation(TypeAnnotation node) { | 183 visitTypeAnnotation(TypeAnnotation node) { |
| 188 // We currently ignore type annotations for generating code. | 184 // We currently ignore type annotations for generating code. |
| 189 } | 185 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 203 Identifier id = init.receiver; | 199 Identifier id = init.receiver; |
| 204 Link<Node> link = init.arguments; | 200 Link<Node> link = init.arguments; |
| 205 assert(!link.isEmpty() && link.tail.isEmpty()); | 201 assert(!link.isEmpty() && link.tail.isEmpty()); |
| 206 visit(link.head); | 202 visit(link.head); |
| 207 HInstruction initialValue = pop(); | 203 HInstruction initialValue = pop(); |
| 208 definitions[elements[id]] = initialValue; | 204 definitions[elements[id]] = initialValue; |
| 209 } | 205 } |
| 210 } | 206 } |
| 211 } | 207 } |
| 212 } | 208 } |
| OLD | NEW |