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

Unified Diff: lib/compiler/implementation/ssa/codegen.dart

Issue 11065007: Use the correct inputs when checking if inverse operator can be used. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Use the right inputs. Created 8 years, 2 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
Index: lib/compiler/implementation/ssa/codegen.dart
diff --git a/lib/compiler/implementation/ssa/codegen.dart b/lib/compiler/implementation/ssa/codegen.dart
index db2c5005505abe97003b41478f0f41ecaa7b6768..d77dcf61a3686247c4d082912cbc1b73b107f3ad 100644
--- a/lib/compiler/implementation/ssa/codegen.dart
+++ b/lib/compiler/implementation/ssa/codegen.dart
@@ -1800,10 +1800,10 @@ abstract class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
push(new js.Binary("!==", pop(), new js.LiteralBool(true)), input);
} else if (isBuiltinRelational(input) &&
isGenerateAtUseSite(input) &&
- types[input.inputs[0]].isUseful() &&
- !input.inputs[0].isDouble(types) &&
types[input.inputs[1]].isUseful() &&
floitsch 2012/10/04 11:35:26 I really think we should make this input.left, inp
- !input.inputs[1].isDouble(types)) {
+ !input.inputs[1].isDouble(types) &&
+ types[input.inputs[2]].isUseful() &&
+ !input.inputs[2].isDouble(types)) {
// 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, String>{
@@ -1817,9 +1817,8 @@ abstract class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
">=" : "<"
};
HRelational relational = input;
-
- visitInvokeBinary(input,
- inverseOperator[relational.operation.name.stringValue]);
+ BinaryOperation operation = relational.operation(backend.constantSystem);
+ visitInvokeBinary(input, inverseOperator[operation.name.stringValue]);
} else {
use(input);
push(new js.Prefix("!", pop()));
« no previous file with comments | « no previous file | tests/compiler/dart2js/inverse_operator_test.dart » ('j') | tests/compiler/dart2js/inverse_operator_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698