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

Unified Diff: pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart

Issue 1276223004: Revert "dart2js: Also trace instances of Function as closures." (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart
diff --git a/pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart b/pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart
index 10d331f99ee7a9c4236f4978bf634848da8a7530..c25d8d7ad4c292832168b1f559c97bc0c2c19534 100644
--- a/pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart
+++ b/pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart
@@ -683,7 +683,6 @@ class TypeGraphInferrerEngine
// Trace closures to potentially infer argument types.
types.allocatedClosures.forEach((info) {
-
void trace(Iterable<FunctionElement> elements,
ClosureTracerVisitor tracer) {
tracer.run();
@@ -717,26 +716,16 @@ class TypeGraphInferrerEngine
}
});
}
-
if (info is ClosureTypeInformation) {
Iterable<FunctionElement> elements = [info.element];
trace(elements, new ClosureTracerVisitor(elements, info, this));
- } else if (info is DynamicCallSiteTypeInformation) {
+ } else if (info is CallSiteTypeInformation) {
// We only are interested in functions here, as other targets
// of this closure call are not a root to trace but an intermediate
// for some other function.
Iterable<FunctionElement> elements = info.callees
.where((e) => e.isFunction);
trace(elements, new ClosureTracerVisitor(elements, info, this));
- } else if (info is StaticCallSiteTypeInformation) {
- // This is a constructor call to a class with a call method. So we
- // need to trace the call method here.
- assert(info.calledElement.isConstructor);
- ClassElement cls = info.calledElement.enclosingClass;
- FunctionElement callMethod =
- cls.lookupMember(Compiler.CALL_OPERATOR_NAME);
- Iterable<FunctionElement> elements = [callMethod];
- trace(elements, new ClosureTracerVisitor(elements, info, this));
} else {
assert(info is ElementTypeInformation);
trace([info.element],
@@ -788,11 +777,6 @@ class TypeGraphInferrerEngine
print('${types.getInferredTypeOf(target).type} for ${target}');
}
}
- } else if (info is StaticCallSiteTypeInformation) {
- ClassElement cls = info.calledElement.enclosingClass;
- FunctionElement callMethod =
- cls.lookupMember(Compiler.CALL_OPERATOR_NAME);
- print('${types.getInferredSignatureOf(callMethod)} for ${cls}');
} else {
print('${info.type} for some unknown kind of closure');
}
@@ -1127,14 +1111,6 @@ class TypeGraphInferrerEngine
CallSiteTypeInformation info = new StaticCallSiteTypeInformation(
types.currentMember, node, caller, callee, selector, mask, arguments,
inLoop);
- // If this class has a 'call' method then we have essentially created a
- // closure here. Register it as such so that it is traced.
- if (selector != null && selector.isCall && callee.isConstructor) {
- ClassElement cls = callee.enclosingClass.declaration;
- if (cls.callType != null) {
- types.allocatedClosures.add(info);
- }
- }
info.addToGraph(this);
allocatedCalls.add(info);
updateSideEffects(sideEffects, selector, callee);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698