Chromium Code Reviews| 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].isDouble() && | |
| 1695 !input.inputs[0].isTypeUnknown()) { | |
|
ngeoffray
2012/05/10 10:41:13
I think this will cover 'conflicting'. What you sh
| |
| 1696 // This optimization doesn't work for NaN, so we don't do it if the | |
| 1697 // type isn't known to be non-Double. | |
| 1693 Map<String, String> inverseOperator = const <String>{ | 1698 Map<String, String> inverseOperator = const <String>{ |
| 1694 "==" : "!=", | 1699 "==" : "!=", |
| 1695 "!=" : "==", | 1700 "!=" : "==", |
| 1696 "===": "!==", | 1701 "===": "!==", |
| 1697 "!==": "===", | 1702 "!==": "===", |
| 1698 "<" : ">=", | 1703 "<" : ">=", |
| 1699 "<=" : ">", | 1704 "<=" : ">", |
| 1700 ">" : "<=", | 1705 ">" : "<=", |
| 1701 ">=" : "<" | 1706 ">=" : "<" |
| 1702 }; | 1707 }; |
| (...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2598 startBailoutSwitch(); | 2603 startBailoutSwitch(); |
| 2599 } | 2604 } |
| 2600 } | 2605 } |
| 2601 | 2606 |
| 2602 void endLabeledBlock(HLabeledBlockInformation labeledBlockInfo) { | 2607 void endLabeledBlock(HLabeledBlockInformation labeledBlockInfo) { |
| 2603 if (labeledBlockInfo.body.start.hasGuards()) { | 2608 if (labeledBlockInfo.body.start.hasGuards()) { |
| 2604 endBailoutSwitch(); | 2609 endBailoutSwitch(); |
| 2605 } | 2610 } |
| 2606 } | 2611 } |
| 2607 } | 2612 } |
| OLD | NEW |