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

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

Issue 598493003: Give up tracing of a function if one of its closurizations escapes tracing. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Change test to pass the analyzer. Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/inferrer/type_graph_inferrer.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of type_graph_inferrer; 5 part of type_graph_inferrer;
6 6
7 class ClosureTracerVisitor extends TracerVisitor<ApplyableTypeInformation> { 7 class ClosureTracerVisitor extends TracerVisitor<ApplyableTypeInformation> {
8 final Iterable<FunctionElement> tracedElements; 8 final Iterable<FunctionElement> tracedElements;
9 final List<CallSiteTypeInformation> callsToAnalyze = 9 final List<CallSiteTypeInformation> callsToAnalyze =
10 new List<CallSiteTypeInformation>(); 10 new List<CallSiteTypeInformation>();
11 11
12 ClosureTracerVisitor(this.tracedElements, tracedType, inferrer) 12 ClosureTracerVisitor(this.tracedElements, tracedType, inferrer)
13 : super(tracedType, inferrer); 13 : super(tracedType, inferrer);
14 14
15 void run() { 15 void run() {
16 for (FunctionElement e in tracedElements) {
17 e.functionSignature.forEachParameter((Element parameter) {
18 ElementTypeInformation info =
19 inferrer.types.getInferredTypeOf(parameter);
20 info.maybeResume();
21 });
22 }
23 analyze(); 16 analyze();
24 if (!continueAnalyzing) return; 17 if (!continueAnalyzing) return;
25 callsToAnalyze.forEach(analyzeCall); 18 callsToAnalyze.forEach(analyzeCall);
26 for(FunctionElement e in tracedElements) { 19 for(FunctionElement e in tracedElements) {
27 e.functionSignature.forEachParameter((Element parameter) { 20 e.functionSignature.forEachParameter((Element parameter) {
28 ElementTypeInformation info = 21 ElementTypeInformation info =
29 inferrer.types.getInferredTypeOf(parameter); 22 inferrer.types.getInferredTypeOf(parameter);
30 info.disableInferenceForClosures = false; 23 info.disableInferenceForClosures = false;
31 }); 24 });
32 } 25 }
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 113
121 visitStaticCallSiteTypeInformation(StaticCallSiteTypeInformation info) { 114 visitStaticCallSiteTypeInformation(StaticCallSiteTypeInformation info) {
122 super.visitStaticCallSiteTypeInformation(info); 115 super.visitStaticCallSiteTypeInformation(info);
123 if (info.calledElement == tracedElements.first 116 if (info.calledElement == tracedElements.first
124 && info.selector != null 117 && info.selector != null
125 && info.selector.isGetter) { 118 && info.selector.isGetter) {
126 addNewEscapeInformation(info); 119 addNewEscapeInformation(info);
127 } 120 }
128 } 121 }
129 } 122 }
OLDNEW
« 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