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

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

Issue 1620873003: dart2js cps: Tolerate refinements in more cases. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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 | « no previous file | pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/cps_ir/redundant_phi.dart
diff --git a/pkg/compiler/lib/src/cps_ir/redundant_phi.dart b/pkg/compiler/lib/src/cps_ir/redundant_phi.dart
index 7f16af9cfea5f60f626c48cf7d0cb55ce02eda1c..f5d5423add3ea944f048b385858fdf303cc1bcfa 100644
--- a/pkg/compiler/lib/src/cps_ir/redundant_phi.dart
+++ b/pkg/compiler/lib/src/cps_ir/redundant_phi.dart
@@ -61,10 +61,10 @@ class RedundantPhiEliminator extends TrampolineRecursiveVisitor implements Pass
/// Returns the unique definition of parameter i if it exists and null
/// otherwise. A definition is unique if it is the only value used to
/// invoke the continuation, excluding feedback.
- Definition uniqueDefinitionOf(int i) {
- Definition value = null;
+ Primitive uniqueDefinitionOf(int i) {
+ Primitive value = null;
for (InvokeContinuation invoke in invokes) {
- Definition def = invoke.arguments[i].definition;
+ Primitive def = invoke.arguments[i].definition.effectiveDefinition;
if (cont.parameters[i] == def) {
// Invocation param == param in LetCont (i.e. a recursive call).
@@ -104,7 +104,7 @@ class RedundantPhiEliminator extends TrampolineRecursiveVisitor implements Pass
int dst = 0;
for (int src = 0; src < cont.parameters.length; src++) {
// Is the current phi redundant?
- Definition uniqueDefinition = uniqueDefinitionOf(src);
+ Primitive uniqueDefinition = uniqueDefinitionOf(src);
if (uniqueDefinition == null || !safeForHandlers(uniqueDefinition)) {
// Reorganize parameters and arguments in case of deletions.
if (src != dst) {
@@ -117,7 +117,7 @@ class RedundantPhiEliminator extends TrampolineRecursiveVisitor implements Pass
continue;
}
- Definition oldDefinition = cont.parameters[src];
+ Primitive oldDefinition = cont.parameters[src];
// Add continuations of about-to-be modified invokes to worklist since
// we might introduce new optimization opportunities.
« no previous file with comments | « no previous file | pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698