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

Unified Diff: pkg/compiler/lib/src/ssa/optimize.dart

Issue 1913843003: Revert "Fix for issue 26243 - illegal motion of assignments in instruction merging" (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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/ssa/codegen_helpers.dart ('k') | tests/compiler/dart2js_extra/26243_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/optimize.dart
diff --git a/pkg/compiler/lib/src/ssa/optimize.dart b/pkg/compiler/lib/src/ssa/optimize.dart
index 588da36b028031aab775e846f70cc39492fbe733..7d01871e1befa0753253491e701a2bc977c196fb 100644
--- a/pkg/compiler/lib/src/ssa/optimize.dart
+++ b/pkg/compiler/lib/src/ssa/optimize.dart
@@ -247,13 +247,14 @@ class SsaInstructionSimplifier extends HBaseVisitor
}
HInstruction visitParameterValue(HParameterValue node) {
- // HParameterValue is either the parameter value, or the local variable
- // containing the parameter value. If the parameter is used as a mutable
- // variable we cannot replace the variable with a value.
- bool userIsLocalAccess(HInstruction user) {
- return user is HLocalGet || (user is HLocalSet && user.local == node);
+ // It is possible for the parameter value to be assigned to in the function
+ // body. If that happens then we should not forward the constant value to
+ // its uses since since the uses reachable from the assignment may have
+ // values in addition to the constant passed to the function.
+ if (node.usedBy
+ .any((user) => user is HLocalSet && identical(user.local, node))) {
+ return node;
}
- if (node.usedBy.any(userIsLocalAccess)) return node;
propagateConstantValueToUses(node);
return node;
}
« no previous file with comments | « pkg/compiler/lib/src/ssa/codegen_helpers.dart ('k') | tests/compiler/dart2js_extra/26243_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698