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

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

Issue 24994003: Re-apply "Move the container tracer to the call graph inferrer.". (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 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_inferrer.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/inferrer/type_graph_inferrer.dart (revision 27995)
+++ sdk/lib/_internal/compiler/implementation/inferrer/type_graph_inferrer.dart (working copy)
@@ -7,7 +7,7 @@
import 'dart:collection' show Queue, LinkedHashSet, IterableBase, HashMap;
import '../dart_types.dart' show DartType, InterfaceType, TypeKind;
import '../elements/elements.dart';
-import '../tree/tree.dart' show Node;
+import '../tree/tree.dart' show LiteralList, Node;
import '../types/types.dart' show TypeMask, ContainerTypeMask, TypesInferrer;
import '../universe/universe.dart' show Selector, TypedSelector, SideEffects;
import '../dart2jslib.dart' show Compiler, SourceString, TreeElementMapping;
@@ -18,6 +18,7 @@
import '../dart2jslib.dart' show invariant;
part 'type_graph_nodes.dart';
+part 'container_tracer.dart';
/**
* A set of selector names that [List] implements, that we know return
@@ -249,7 +250,11 @@
Element enclosing,
[TypeInformation elementType, int length]) {
ContainerTypeMask mask = new ContainerTypeMask(type.type, node, enclosing);
- mask.elementType = elementType == null ? null : elementType.type;
+ // Set the element type now for const lists, so that the inferrer
+ // can use it.
+ mask.elementType = (type.type == compiler.typesTask.constListType)
+ ? elementType.type
+ : null;
mask.length = length;
TypeInformation element =
new ElementInContainerTypeInformation(elementType, mask);
@@ -460,6 +465,7 @@
}
processLoopInformation();
+ types.allocatedContainers.values.forEach(analyzeContainer);
}
void processLoopInformation() {
@@ -498,6 +504,11 @@
}
}
+ void analyzeContainer(ContainerTypeInformation info) {
+ if (info.elementType.isInConstContainer) return;
+ new ContainerTracerVisitor(info, this).run();
+ }
+
void buildWorkQueue() {
workQueue.addAll(types.typeInformations.values);
workQueue.addAll(types.allocatedTypes);
@@ -506,7 +517,7 @@
/**
* Update the assignments to parameters in the graph. [remove] tells
- * wheter assignments must be added or removed. If [init] is true,
+ * wheter assignments must be added or removed. If [init] is false,
* parameters are added to the work queue.
*/
void updateParameterAssignments(TypeInformation caller,

Powered by Google App Engine
This is Rietveld 408576698