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

Unified Diff: sdk/lib/_internal/compiler/implementation/inferrer/type_graph_nodes.dart

Issue 216673003: Allow use of [keys] from a map by using different bailout strategy. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Karl's comments and some further fixes Created 6 years, 9 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/inferrer/type_graph_nodes.dart
diff --git a/sdk/lib/_internal/compiler/implementation/inferrer/type_graph_nodes.dart b/sdk/lib/_internal/compiler/implementation/inferrer/type_graph_nodes.dart
index 2c45b4a7cfb26310f3db12553878459ff31f7d63..a7e9501072b383fe69b2bf639a294b1072314590 100644
--- a/sdk/lib/_internal/compiler/implementation/inferrer/type_graph_nodes.dart
+++ b/sdk/lib/_internal/compiler/implementation/inferrer/type_graph_nodes.dart
@@ -1102,18 +1102,11 @@ class MapTypeInformation extends TypeInformation {
}
TypeMask toTypeMask(TypeGraphInferrerEngine inferrer) {
- Map<String, TypeMask> mappings;
if (isDictionary) {
- mappings = new Map<String, TypeMask>();
+ Map<String, TypeMask> mappings = new Map<String, TypeMask>();
for (var key in typeInfoMap.keys) {
- // We strip out entries that contain no information
- if (!typeInfoMap[key].type.containsAll(inferrer.compiler) ||
- !typeInfoMap[key].type.isNullable) {
- mappings[key] = typeInfoMap[key].type;
- }
+ mappings[key] = typeInfoMap[key].type;
}
- }
- if (mappings != null && !mappings.isEmpty) {
return new DictionaryTypeMask(initialType.forwardTo,
initialType.allocationNode,
initialType.allocationElement,
@@ -1130,9 +1123,9 @@ class MapTypeInformation extends TypeInformation {
}
TypeMask refine(TypeGraphInferrerEngine inferrer) {
- if (type.isDictionary != isDictionary) {
+ if (!bailedOut && type.isDictionary != isDictionary) {
return toTypeMask(inferrer);
- } else if (type.isDictionary) {
+ } else if (!bailedOut && type.isDictionary) {
DictionaryTypeMask mask = type;
for (var key in typeInfoMap.keys) {
TypeInformation value = typeInfoMap[key];

Powered by Google App Engine
This is Rietveld 408576698