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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « frog/tests/leg_only/nan_negate_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/ssa/codegen.dart
diff --git a/lib/compiler/implementation/ssa/codegen.dart b/lib/compiler/implementation/ssa/codegen.dart
index b486e0c62e1453be31363255855eb58daf207840..bf6eb3051a1168a2d1aef664774948953634b8ed 100644
--- a/lib/compiler/implementation/ssa/codegen.dart
+++ b/lib/compiler/implementation/ssa/codegen.dart
@@ -1689,7 +1689,14 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
use(input.inputs[0], JSPrecedence.EQUALITY_PRECEDENCE);
buffer.add(' !== true');
endExpression(JSPrecedence.EQUALITY_PRECEDENCE);
- } else if (isBuiltinRelational(input) && isGenerateAtUseSite(input)) {
+ } else if (isBuiltinRelational(input) &&
+ isGenerateAtUseSite(input) &&
+ input.inputs[0].propagatedType.isUseful() &&
+ !input.inputs[0].isDouble() &&
+ input.inputs[1].propagatedType.isUseful() &&
+ !input.inputs[1].isDouble()) {
+ // This optimization doesn't work for NaN, so we only do it if the
+ // type is known to be non-Double.
Map<String, String> inverseOperator = const <String>{
"==" : "!=",
"!=" : "==",
« 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