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

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

Issue 119183003: Revert revision 31272, some unit tests fail. (Closed) Base URL: http://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
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/inferrer/type_graph_inferrer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/inferrer/closure_tracer.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/inferrer/closure_tracer.dart (revision 31272)
+++ sdk/lib/_internal/compiler/implementation/inferrer/closure_tracer.dart (working copy)
@@ -5,18 +5,17 @@
part of type_graph_inferrer;
class ClosureTracerVisitor extends TracerVisitor {
- final Element tracedElement;
+ ClosureTracerVisitor(tracedType, inferrer) : super(tracedType, inferrer);
- ClosureTracerVisitor(this.tracedElement, tracedType, inferrer)
- : super(tracedType, inferrer);
-
void run() {
- tracedElement.functionSignature.forEachParameter((Element parameter) {
+ ClosureTypeInformation closure = tracedType;
+ FunctionElement element = closure.element;
+ element.functionSignature.forEachParameter((Element parameter) {
ElementTypeInformation info = inferrer.types.getInferredTypeOf(parameter);
info.abandonInferencing = false;
});
analyze();
- tracedElement.functionSignature.forEachParameter((Element parameter) {
+ element.functionSignature.forEachParameter((Element parameter) {
ElementTypeInformation info = inferrer.types.getInferredTypeOf(parameter);
if (continueAnalyzing) {
info.disableHandleSpecialCases = true;
@@ -31,10 +30,12 @@
}
void analyzeCall(CallSiteTypeInformation info) {
+ ClosureTypeInformation closure = tracedType;
+ FunctionElement element = closure.element;
Selector selector = info.selector;
- if (!selector.signatureApplies(tracedElement, compiler)) return;
+ if (!selector.signatureApplies(element, compiler)) return;
inferrer.updateParameterAssignments(
- info, tracedElement, info.arguments, selector, remove: false,
+ info, element, info.arguments, selector, remove: false,
addToQueue: false);
}
@@ -50,16 +51,10 @@
visitStaticCallSiteTypeInformation(StaticCallSiteTypeInformation info) {
super.visitStaticCallSiteTypeInformation(info);
Element called = info.calledElement;
- if (called.isForeign(compiler)) {
- String name = called.name;
- if (name == 'JS' || name == 'DART_CLOSURE_TO_JS') {
- bailout('Used in JS ${info.call}');
- }
+ if (called.isForeign(compiler) && called.name == 'JS') {
+ bailout('Used in JS ${info.call}');
}
- if (called.isGetter()
- && info.selector != null
- && info.selector.isCall()
- && inferrer.types.getInferredTypeOf(called) == currentUser) {
+ if (inferrer.types.getInferredTypeOf(called) == currentUser) {
// This node can be a closure call as well. For example, `foo()`
// where `foo` is a getter.
analyzeCall(info);
@@ -82,17 +77,3 @@
}
}
}
-
-class StaticTearOffClosureTracerVisitor extends ClosureTracerVisitor {
- StaticTearOffClosureTracerVisitor(tracedElement, tracedType, inferrer)
- : super(tracedElement, tracedType, inferrer);
-
- visitStaticCallSiteTypeInformation(StaticCallSiteTypeInformation info) {
- super.visitStaticCallSiteTypeInformation(info);
- if (info.calledElement == tracedElement
- && info.selector != null
- && info.selector.isGetter()) {
- addNewEscapeInformation(info);
- }
- }
-}
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/inferrer/type_graph_inferrer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698