Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(552)

Side by Side Diff: lib/compiler/implementation/ssa/codegen.dart

Issue 10332088: Undo optimization in cases where NaN might be involved. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Now with test. Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « frog/tests/leg_only/nan_negate_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « frog/tests/leg_only/nan_negate_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698