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

Unified Diff: sdk/lib/_internal/compiler/implementation/types/union_type_mask.dart

Issue 17028011: Implement a list tracer phase, that tries to find element types in individual lists. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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: sdk/lib/_internal/compiler/implementation/types/union_type_mask.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/types/union_type_mask.dart (revision 24023)
+++ sdk/lib/_internal/compiler/implementation/types/union_type_mask.dart (working copy)
@@ -30,7 +30,13 @@
} else if (mask.isEmpty && !mask.isNullable) {
continue;
} else {
- FlatTypeMask flatMask = mask;
+ FlatTypeMask flatMask;
+ if (mask.isContainer) {
+ ContainerTypeMask container = mask;
+ flatMask = container.asFlat;
+ } else {
+ flatMask = mask;
+ }
assert(flatMask.base == null
|| flatMask.base.element != compiler.dynamicClass);
int inListIndex = -1;
@@ -140,6 +146,7 @@
}
TypeMask union(var other, Compiler compiler) {
+ if (other.isContainer) other = other.asFlat;
if (!other.isUnion && disjointMasks.contains(other)) return this;
List<FlatTypeMask> newList =
@@ -154,6 +161,7 @@
}
TypeMask intersection(var other, Compiler compiler) {
+ if (other.isContainer) other = other.asFlat;
if (!other.isUnion && disjointMasks.contains(other)) return other;
List<TypeMask> intersections = <TypeMask>[];
@@ -189,6 +197,7 @@
bool get isNullable => disjointMasks.any((e) => e.isNullable);
bool get isExact => false;
bool get isUnion => true;
+ bool get isContainer => false;
bool containsOnlyInt(Compiler compiler) => false;
bool containsOnlyDouble(Compiler compiler) => false;
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/types/types.dart ('k') | tests/compiler/dart2js/concrete_type_inference_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698