| 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 SsaCodeGeneratorTask extends CompilerTask { | 5 class SsaCodeGeneratorTask extends CompilerTask { |
| 6 SsaCodeGeneratorTask(Compiler compiler) : super(compiler); | 6 SsaCodeGeneratorTask(Compiler compiler) : super(compiler); |
| 7 String get name() => 'SSA code generator'; | 7 String get name() => 'SSA code generator'; |
| 8 | 8 |
| 9 String generate(FunctionElement function, HGraph graph) { | 9 String generate(FunctionElement function, HGraph graph) { |
| 10 return measure(() { | 10 return measure(() { |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 visitBitOr(HBitOr node) => visitInvokeBinary(node, '|'); | 229 visitBitOr(HBitOr node) => visitInvokeBinary(node, '|'); |
| 230 visitBitXor(HBitXor node) => visitInvokeBinary(node, '^'); | 230 visitBitXor(HBitXor node) => visitInvokeBinary(node, '^'); |
| 231 visitShiftRight(HShiftRight node) => visitInvokeBinary(node, '>>'); | 231 visitShiftRight(HShiftRight node) => visitInvokeBinary(node, '>>'); |
| 232 | 232 |
| 233 // Shift left cannot be mapped to the native operator (different semantics). | 233 // Shift left cannot be mapped to the native operator (different semantics). |
| 234 visitShiftLeft(HShiftLeft node) => visitInvokeStatic(node); | 234 visitShiftLeft(HShiftLeft node) => visitInvokeStatic(node); |
| 235 | 235 |
| 236 visitNegate(HNegate node) => visitInvokeUnary(node, '-'); | 236 visitNegate(HNegate node) => visitInvokeUnary(node, '-'); |
| 237 | 237 |
| 238 visitEquals(HEquals node) => visitInvokeBinary(node, '==='); | 238 visitEquals(HEquals node) => visitInvokeBinary(node, '==='); |
| 239 visitIdentity(HIdentity node) => visitInvokeBinary(node, '==='); |
| 239 visitLess(HLess node) => visitInvokeBinary(node, '<'); | 240 visitLess(HLess node) => visitInvokeBinary(node, '<'); |
| 240 visitLessEqual(HLessEqual node) => visitInvokeBinary(node, '<='); | 241 visitLessEqual(HLessEqual node) => visitInvokeBinary(node, '<='); |
| 241 visitGreater(HGreater node) => visitInvokeBinary(node, '>'); | 242 visitGreater(HGreater node) => visitInvokeBinary(node, '>'); |
| 242 visitGreaterEqual(HGreaterEqual node) => visitInvokeBinary(node, '>='); | 243 visitGreaterEqual(HGreaterEqual node) => visitInvokeBinary(node, '>='); |
| 243 | 244 |
| 244 visitLogicalOperator(HLogicalOperator node) { | 245 visitLogicalOperator(HLogicalOperator node) { |
| 245 buffer.add("(("); | 246 buffer.add("(("); |
| 246 use(node.left); | 247 use(node.left); |
| 247 buffer.add(")${node.operation}("); | 248 buffer.add(")${node.operation}("); |
| 248 use(node.right); | 249 use(node.right); |
| (...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 857 secondBlock.last.tryGenerateAtUseSite(); | 858 secondBlock.last.tryGenerateAtUseSite(); |
| 858 } | 859 } |
| 859 | 860 |
| 860 void visitBasicBlock(HBasicBlock block) { | 861 void visitBasicBlock(HBasicBlock block) { |
| 861 if (!block.phis.isEmpty() && | 862 if (!block.phis.isEmpty() && |
| 862 block.phis.first == block.phis.last) { | 863 block.phis.first == block.phis.last) { |
| 863 detectLogicControlFlow(block.phis.first); | 864 detectLogicControlFlow(block.phis.first); |
| 864 } | 865 } |
| 865 } | 866 } |
| 866 } | 867 } |
| OLD | NEW |