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

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

Issue 1316163004: dart2js cps: Check strictness flag in redundant join eliminator. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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 | « pkg/compiler/lib/src/cps_ir/optimizers.dart ('k') | 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/redundant_join.dart
diff --git a/pkg/compiler/lib/src/cps_ir/redundant_join.dart b/pkg/compiler/lib/src/cps_ir/redundant_join.dart
index 4acb2ef438b834dbe6a7924d8c9a6c895ecd679f..9b0de68e048770528c6db935515d491372028c3a 100644
--- a/pkg/compiler/lib/src/cps_ir/redundant_join.dart
+++ b/pkg/compiler/lib/src/cps_ir/redundant_join.dart
@@ -109,12 +109,12 @@ class RedundantJoinEliminator extends RecursiveVisitor implements Pass {
Primitive argument = invoke.arguments[parameterIndex].definition;
if (argument is! Constant) return; // Branching condition is unknown.
Constant constant = argument;
- if (isFalsyConstant(constant.value)) {
- ++falseHits;
- falseCall = invoke;
- } else {
+ if (isTruthyConstant(constant.value, strict: branch.isStrictCheck)) {
++trueHits;
trueCall = invoke;
+ } else {
+ ++falseHits;
+ falseCall = invoke;
}
}
@@ -182,10 +182,10 @@ class RedundantJoinEliminator extends RecursiveVisitor implements Pass {
Reference reference = branchCont.firstRef;
InvokeContinuation invoke = branchCont.firstRef.parent;
Constant condition = invoke.arguments[parameterIndex].definition;
- if (isFalsyConstant(condition.value)) {
- invoke.continuation.changeTo(falseCont);
- } else {
+ if (isTruthyConstant(condition.value, strict: branch.isStrictCheck)) {
invoke.continuation.changeTo(trueCont);
+ } else {
+ invoke.continuation.changeTo(falseCont);
}
assert(branchCont.firstRef != reference);
}
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/optimizers.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698