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

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

Issue 116443002: Revert "Implement tracing for function expressions and statements, and infer types of parameters of… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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: sdk/lib/_internal/compiler/implementation/inferrer/simple_types_inferrer.dart
diff --git a/sdk/lib/_internal/compiler/implementation/inferrer/simple_types_inferrer.dart b/sdk/lib/_internal/compiler/implementation/inferrer/simple_types_inferrer.dart
index b54ae28c0967fabc99e66163b3a10574b37d50c8..29c46fa18505befe00c0ea942751842e66081982 100644
--- a/sdk/lib/_internal/compiler/implementation/inferrer/simple_types_inferrer.dart
+++ b/sdk/lib/_internal/compiler/implementation/inferrer/simple_types_inferrer.dart
@@ -111,10 +111,6 @@ class TypeMaskSystem implements TypeSystem<TypeMask> {
return type;
}
- TypeMask allocateClosure(Node node, Element element) {
- return functionType;
- }
-
Selector newTypedSelector(TypeMask receiver, Selector selector) {
return new TypedSelector(receiver, selector);
}
@@ -570,7 +566,10 @@ class SimpleTypeInferrerVisitor<T>
// Record the types of captured non-boxed variables. Types of
// these variables may already be there, because of an analysis of
- // a previous closure.
+ // a previous closure. Note that analyzing the same closure multiple
+ // times closure will refine the type of those variables, therefore
+ // [:inferrer.typeOf[variable]:] is not necessarilly null, nor the
+ // same as [newType].
ClosureClassMap nestedClosureData =
compiler.closureToClassMapper.getMappingForNestedFunction(node);
nestedClosureData.forEachCapturedVariable((variable, field) {
@@ -585,19 +584,7 @@ class SimpleTypeInferrerVisitor<T>
capturedVariables.add(variable);
});
- return inferrer.concreteTypes.putIfAbsent(node, () {
- return types.allocateClosure(node, element);
- });
- }
-
- T visitFunctionDeclaration(FunctionDeclaration node) {
- Element element = elements[node];
- T type = inferrer.concreteTypes.putIfAbsent(node.function, () {
- return types.allocateClosure(node.function, element);
- });
- locals.update(element, type, node);
- visit(node.function);
- return type;
+ return types.functionType;
}
T visitLiteralList(LiteralList node) {

Powered by Google App Engine
This is Rietveld 408576698