| 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 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 | 9 |
| 10 String buildJavaScriptFunction(FunctionElement element, | 10 String buildJavaScriptFunction(FunctionElement element, |
| (...skipping 1671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1682 } | 1682 } |
| 1683 | 1683 |
| 1684 assert(node.inputs.length == 1); | 1684 assert(node.inputs.length == 1); |
| 1685 HInstruction input = node.inputs[0]; | 1685 HInstruction input = node.inputs[0]; |
| 1686 if (input is HBoolify && isGenerateAtUseSite(input)) { | 1686 if (input is HBoolify && isGenerateAtUseSite(input)) { |
| 1687 beginExpression(JSPrecedence.EQUALITY_PRECEDENCE); | 1687 beginExpression(JSPrecedence.EQUALITY_PRECEDENCE); |
| 1688 assert(node.inputs.length == 1); | 1688 assert(node.inputs.length == 1); |
| 1689 use(input.inputs[0], JSPrecedence.EQUALITY_PRECEDENCE); | 1689 use(input.inputs[0], JSPrecedence.EQUALITY_PRECEDENCE); |
| 1690 buffer.add(' !== true'); | 1690 buffer.add(' !== true'); |
| 1691 endExpression(JSPrecedence.EQUALITY_PRECEDENCE); | 1691 endExpression(JSPrecedence.EQUALITY_PRECEDENCE); |
| 1692 } else if (isBuiltinRelational(input) && isGenerateAtUseSite(input)) { | 1692 } else if (isBuiltinRelational(input) && |
| 1693 isGenerateAtUseSite(input) && |
| 1694 input.inputs[0].propagatedType.isUseful() && |
| 1695 !input.inputs[0].isDouble() && |
| 1696 input.inputs[1].propagatedType.isUseful() && |
| 1697 !input.inputs[1].isDouble()) { |
| 1698 // This optimization doesn't work for NaN, so we only do it if the |
| 1699 // type is known to be non-Double. |
| 1693 Map<String, String> inverseOperator = const <String>{ | 1700 Map<String, String> inverseOperator = const <String>{ |
| 1694 "==" : "!=", | 1701 "==" : "!=", |
| 1695 "!=" : "==", | 1702 "!=" : "==", |
| 1696 "===": "!==", | 1703 "===": "!==", |
| 1697 "!==": "===", | 1704 "!==": "===", |
| 1698 "<" : ">=", | 1705 "<" : ">=", |
| 1699 "<=" : ">", | 1706 "<=" : ">", |
| 1700 ">" : "<=", | 1707 ">" : "<=", |
| 1701 ">=" : "<" | 1708 ">=" : "<" |
| 1702 }; | 1709 }; |
| (...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2598 startBailoutSwitch(); | 2605 startBailoutSwitch(); |
| 2599 } | 2606 } |
| 2600 } | 2607 } |
| 2601 | 2608 |
| 2602 void endLabeledBlock(HLabeledBlockInformation labeledBlockInfo) { | 2609 void endLabeledBlock(HLabeledBlockInformation labeledBlockInfo) { |
| 2603 if (labeledBlockInfo.body.start.hasGuards()) { | 2610 if (labeledBlockInfo.body.start.hasGuards()) { |
| 2604 endBailoutSwitch(); | 2611 endBailoutSwitch(); |
| 2605 } | 2612 } |
| 2606 } | 2613 } |
| 2607 } | 2614 } |
| OLD | NEW |