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

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

Issue 707493003: dart2js: Trust type annotations more often with --trust-type-annotation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase and improvements. Created 6 years, 1 month 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
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 eb21bb402cb70999d5514ab5e0ceea01109835e3..4f3e7eec8f94605553b1d5fb0e39d066f961fe10 100644
--- a/pkg/compiler/lib/src/ssa/types_propagation.dart
+++ b/pkg/compiler/lib/src/ssa/types_propagation.dart
@@ -183,13 +183,21 @@ class SsaTypePropagator extends HBaseVisitor implements OptimizationPhase {
}
}
}
+ if (inputType != outputType) {
+ input.replaceAllUsersDominatedBy(instruction.next, instruction);
+ }
return outputType;
}
TypeMask visitTypeKnown(HTypeKnown instruction) {
HInstruction input = instruction.checkedInput;
- return instruction.knownType.intersection(
- input.instructionType, classWorld);
+ TypeMask inputType = input.instructionType;
+ TypeMask outputType =
+ instruction.knownType.intersection(inputType, classWorld);
+ if (inputType != outputType) {
+ input.replaceAllUsersDominatedBy(instruction.next, instruction);
+ }
+ return outputType;
}
void convertInput(HInvokeDynamic instruction,

Powered by Google App Engine
This is Rietveld 408576698