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

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

Issue 2798423003: Redo "dart2js: Insert HTypeKnown refinement nodes on dominated edges of HPhi nodes." (Closed)
Patch Set: remove unused field, reuse computed uses Created 3 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/optimize.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/ssa/types_propagation.dart
diff --git a/pkg/compiler/lib/src/ssa/types_propagation.dart b/pkg/compiler/lib/src/ssa/types_propagation.dart
index 49aa6f99cf3d19f255376d32cdcc2a7465b6ea71..7db5f0521277a5914cb8028552fd1d8f315427c1 100644
--- a/pkg/compiler/lib/src/ssa/types_propagation.dart
+++ b/pkg/compiler/lib/src/ssa/types_propagation.dart
@@ -397,7 +397,12 @@ class SsaTypePropagator extends HBaseVisitor implements OptimizationPhase {
addDependentInstructionsToWorkList(next);
}
} else {
- bool hasCandidates() => receiver.dominatedUsers(instruction).length > 1;
+ DominatedUses uses;
+ bool hasCandidates() {
+ uses =
+ DominatedUses.of(receiver, instruction, excludeDominator: true);
+ return uses.isNotEmpty;
+ }
if ((receiver.usedBy.length <= _MAX_QUICK_USERS)
? (hasCandidates() && computeNewType() != receiverType)
@@ -407,7 +412,7 @@ class SsaTypePropagator extends HBaseVisitor implements OptimizationPhase {
HTypeKnown converted =
new HTypeKnown.witnessed(newType, receiver, instruction);
instruction.block.addBefore(instruction.next, converted);
- receiver.replaceAllUsersDominatedBy(converted.next, converted);
+ uses.replaceWith(converted);
addDependentInstructionsToWorkList(converted);
}
}
« no previous file with comments | « pkg/compiler/lib/src/ssa/optimize.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698