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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/optimize.dart

Issue 155393002: Replace dead instructions with a constant with no type (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart b/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
index 96fe78738dc144d18a5e7e87e7e3f04b4a061ee3..894ef79ffa6c30b28f447ee55d340a5f23c5d460 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
@@ -894,9 +894,13 @@ class SsaDeadCodeEliminator extends HGraphVisitor implements OptimizationPhase {
HInstruction zapInstructionCache;
HInstruction get zapInstruction {
- return (zapInstructionCache == null)
- ? zapInstructionCache = analyzer.graph.addConstantInt(0, compiler)
- : zapInstructionCache;
+ if (zapInstructionCache == null) {
+ // A constant with no type does not pollute types at phi nodes.
+ Constant constant =
+ new DummyReceiverConstant(const TypeMask.nonNullEmpty());
+ zapInstructionCache = analyzer.graph.addConstant(constant, compiler);
+ }
+ return zapInstructionCache;
}
/// Returns whether the next throwing instruction that may have side
« 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