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

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

Issue 1416723008: dart2js cps: Propagate container types for lists. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Remove unreachable handling of list constructor in type propagation Created 5 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/cps_ir/cps_ir_nodes.dart
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
index 9c56c480ae815a023748b54acf05c05ec7d02c53..50e84bdfec263e44e83d33db2ab1904f3cc69187 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
@@ -590,12 +590,20 @@ class InvokeConstructor extends CallExpression {
final Selector selector;
final SourceInformation sourceInformation;
+ /// If non-null, this is an allocation site-specific type that is potentially
+ /// better than the inferred return type of [target].
+ ///
+ /// In particular, container type masks depend on the allocation site and
+ /// can therefore not be inferred solely based on the call target.
+ TypeMask allocationSiteType;
+
InvokeConstructor(this.dartType,
this.target,
this.selector,
List<Primitive> args,
Continuation cont,
- this.sourceInformation)
+ this.sourceInformation,
+ {this.allocationSiteType})
: arguments = _referenceList(args),
continuation = new Reference<Continuation>(cont);
@@ -1337,7 +1345,11 @@ class LiteralList extends Primitive {
final InterfaceType dartType;
final List<Reference<Primitive>> values;
- LiteralList(this.dartType, List<Primitive> values)
+ /// If non-null, this is an allocation site-specific type for the list
+ /// created here.
+ TypeMask allocationSiteType;
+
+ LiteralList(this.dartType, List<Primitive> values, {this.allocationSiteType})
: this.values = _referenceList(values);
accept(Visitor visitor) => visitor.visitLiteralList(this);
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart ('k') | pkg/compiler/lib/src/cps_ir/type_mask_system.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698