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

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

Issue 808553004: Revert "cps-ir: Add support for intercepted calls." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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/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 fb01e04b05b55fd9bdb9e11fdf84f81756d9bd0b..fc6376a440ce820ab76330914d013e984b62ef0a 100644
--- a/pkg/compiler/lib/src/cps_ir/type_propagation.dart
+++ b/pkg/compiler/lib/src/cps_ir/type_propagation.dart
@@ -53,10 +53,17 @@ class TypeMaskSystem implements TypeSystem<TypeMask> {
TypeMask get listType => inferrer.listType;
TypeMask get mapType => inferrer.mapType;
+ // TODO(karlklose): the map should be per continuation.
+ Map<Node, TypeMask> map = <Node, TypeMask>{};
+
TypeMaskSystem(dart2js.Compiler compiler)
: inferrer = compiler.typesTask,
classWorld = compiler.world;
+ TypeMask getType(Node node) => map[node];
+
+ setType(Primitive node, TypeMask type) => map[node] = type;
+
TypeMask getParameterType(ParameterElement parameter) {
return inferrer.getGuaranteedTypeOfElement(parameter);
}
@@ -118,7 +125,7 @@ class TypePropagator<T> extends Pass {
// Analyze. In this phase, the entire term is analyzed for reachability
// and the abstract value of each expression.
- _TypePropagationVisitor<T> analyzer = new _TypePropagationVisitor<T>(
+ _ConstPropagationVisitor<T> analyzer = new _ConstPropagationVisitor<T>(
_constantSystem,
_typeSystem,
_types,
@@ -300,7 +307,7 @@ class _TransformingVisitor extends RecursiveVisitor {
* const-ness as well as reachability, both of which are used in the subsequent
* transformation pass.
*/
-class _TypePropagationVisitor<T> extends Visitor {
+class _ConstPropagationVisitor<T> extends Visitor {
// The node worklist stores nodes that are both reachable and need to be
// processed, but have not been processed yet. Using a worklist avoids deep
// recursion.
@@ -348,7 +355,7 @@ class _TypePropagationVisitor<T> extends Visitor {
// Access through [getValue] and [setValue].
final Map<Node, _AbstractValue> values;
- _TypePropagationVisitor(this.constantSystem, TypeSystem<T> typeSystem,
+ _ConstPropagationVisitor(this.constantSystem, TypeSystem typeSystem,
this.values,
this.internalError, this.compiler)
: this.unknownDynamic = new _AbstractValue.unknown(typeSystem.dynamicType),
@@ -424,7 +431,7 @@ class _TypePropagationVisitor<T> extends Visitor {
void visitNode(Node node) {
internalError(NO_LOCATION_SPANNABLE,
- "_TypePropagationVisitor is stale, add missing visit overrides");
+ "_ConstPropagationVisitor is stale, add missing visit overrides");
}
void visitFunctionDefinition(FunctionDefinition node) {
@@ -723,10 +730,7 @@ class _TypePropagationVisitor<T> extends Visitor {
}
void visitParameter(Parameter node) {
- Entity source = node.hint;
- // TODO(karlklose): remove reference to the element model.
- T type = (source is ParameterElement) ? typeSystem.getParameterType(source)
- : typeSystem.dynamicType;
+ T type = typeSystem.getParameterType(node.hint);
if (node.parent is FunctionDefinition) {
// Functions may escape and thus their parameters must be initialized to
// NonConst.
@@ -787,10 +791,6 @@ class _TypePropagationVisitor<T> extends Visitor {
setValue(node, new _AbstractValue(result, typeSystem.boolType));
}
}
-
- void visitInterceptor(Interceptor node) {
- setReachable(node.input.definition);
- }
}
/// Represents the abstract value of a primitive value at some point in the
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart ('k') | pkg/compiler/lib/src/dart_backend/backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698