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

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

Issue 1182913003: Split TypedSelector into Selector and TypeMask. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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
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 71abe6c3ed5bfa4df8dbb65ad9df38538f69b6fe..85564723d9a72109ea6bf4906b45663d38e90e0a 100644
--- a/pkg/compiler/lib/src/ssa/types_propagation.dart
+++ b/pkg/compiler/lib/src/ssa/types_propagation.dart
@@ -252,7 +252,8 @@ class SsaTypePropagator extends HBaseVisitor implements OptimizationPhase {
return true;
} else if (instruction.element == null) {
Iterable<Element> targets =
- compiler.world.allFunctions.filter(instruction.selector);
+ compiler.world.allFunctions.filter(
+ instruction.selector, instruction.mask);
if (targets.length == 1) {
Element target = targets.first;
ClassElement cls = target.enclosingClass;
@@ -335,7 +336,8 @@ class SsaTypePropagator extends HBaseVisitor implements OptimizationPhase {
if (checkReceiver(instruction)) {
addAllUsersBut(instruction, instruction.inputs[1]);
}
- if (!selector.isUnaryOperator && checkArgument(instruction)) {
+ if (!selector.isUnaryOperator &&
+ checkArgument(instruction)) {
addAllUsersBut(instruction, instruction.inputs[2]);
}
}
@@ -344,14 +346,13 @@ class SsaTypePropagator extends HBaseVisitor implements OptimizationPhase {
HInstruction receiver = instruction.getDartReceiver(compiler);
TypeMask receiverType = receiver.instructionType;
- Selector selector =
- new TypedSelector(receiverType, instruction.selector, classWorld);
- instruction.selector = selector;
+ instruction.mask = receiverType;
// Try to specialize the receiver after this call.
if (receiver.dominatedUsers(instruction).length != 1
- && !selector.isClosureCall) {
- TypeMask newType = compiler.world.allFunctions.receiverType(selector);
+ && !instruction.selector.isClosureCall) {
+ TypeMask newType = compiler.world.allFunctions.receiverType(
+ instruction.selector, instruction.mask);
newType = newType.intersection(receiverType, classWorld);
var next = instruction.next;
if (next is HTypeKnown && next.checkedInput == receiver) {

Powered by Google App Engine
This is Rietveld 408576698