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

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

Issue 1407743002: dart2js cps: Narrow the receiver mask on InvokeMethod. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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/cps_ir/type_mask_system.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/cps_ir/type_propagation.dart
diff --git a/pkg/compiler/lib/src/cps_ir/type_propagation.dart b/pkg/compiler/lib/src/cps_ir/type_propagation.dart
index 5784d3ddf1e613cd186ca88c6cc0b17efe3c56a3..39f33b43de50abd20cfd40031c3834ccac1384e3 100644
--- a/pkg/compiler/lib/src/cps_ir/type_propagation.dart
+++ b/pkg/compiler/lib/src/cps_ir/type_propagation.dart
@@ -1718,6 +1718,9 @@ class TransformingVisitor extends DeepRecursiveVisitor {
if (specializeSingleUseClosureCall(node)) return;
if (specializeClosureCall(node)) return;
+ node.mask =
+ typeSystem.intersection(node.mask, getValue(getDartReceiver(node)).type);
+
AbstractValue receiver = getValue(node.receiver.definition);
if (node.receiverIsIntercepted &&
@@ -2743,9 +2746,9 @@ class TypePropagationVisitor implements Visitor {
case AbstractBool.Maybe:
setReachable(cont);
// Narrow type of output to those that survive the cast.
- TypeMask type = input.type.intersection(
- typeSystem.subtypesOf(node.dartType),
- classWorld);
+ TypeMask type = typeSystem.intersection(
+ input.type,
+ typeSystem.subtypesOf(node.dartType));
setValue(cont.parameters.single, nonConstant(type));
break;
}
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/type_mask_system.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698