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

Unified Diff: pkg/compiler/lib/src/cps_ir/type_propagation.dart

Issue 1476303003: dart2js cps: Disable a bad optimization. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Rebase Created 5 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/cps_ir/type_propagation.dart
diff --git a/pkg/compiler/lib/src/cps_ir/type_propagation.dart b/pkg/compiler/lib/src/cps_ir/type_propagation.dart
index aa8c972bdda6e298e288589a8a6a6b6ca5837dd4..1f34ad7bfb6ac8b72f96761a293e81b009c8fe5a 100644
--- a/pkg/compiler/lib/src/cps_ir/type_propagation.dart
+++ b/pkg/compiler/lib/src/cps_ir/type_propagation.dart
@@ -940,44 +940,6 @@ class TransformingVisitor extends DeepRecursiveVisitor {
push(invoke);
return;
}
-
- if (condition is ApplyBuiltinOperator &&
- (condition.operator == BuiltinOperator.LooseEq ||
- condition.operator == BuiltinOperator.StrictEq)) {
- Primitive leftArg = condition.arguments[0].definition;
- Primitive rightArg = condition.arguments[1].definition;
- AbstractValue left = getValue(leftArg);
- AbstractValue right = getValue(rightArg);
- if (right.isNullConstant &&
- lattice.isDefinitelyNotNumStringBool(left)) {
- // Rewrite:
- // if (x == null) S1 else S2
- // =>
- // if (x) S2 else S1 (note the swapped branches)
- Branch branch = new Branch.loose(leftArg, falseCont, trueCont);
- replaceSubtree(node, branch);
- return;
- } else if (left.isNullConstant &&
- lattice.isDefinitelyNotNumStringBool(right)) {
- Branch branch = new Branch.loose(rightArg, falseCont, trueCont);
- replaceSubtree(node, branch);
- return;
- } else if (right.isTrueConstant &&
- lattice.isDefinitelyBool(left, allowNull: true)) {
- // Rewrite:
- // if (x == true) S1 else S2
- // =>
- // if (x) S1 else S2
- Branch branch = new Branch.loose(leftArg, trueCont, falseCont);
- replaceSubtree(node, branch);
- return;
- } else if (left.isTrueConstant &&
- lattice.isDefinitelyBool(right, allowNull: true)) {
- Branch branch = new Branch.loose(rightArg, trueCont, falseCont);
- replaceSubtree(node, branch);
- return;
- }
- }
}
void visitInvokeContinuation(InvokeContinuation node) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698