OLD | NEW |
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 library compiler.src.inferrer.closure_tracer; | 5 library compiler.src.inferrer.closure_tracer; |
6 | 6 |
7 import '../common/names.dart' show Names; | 7 import '../common/names.dart' show Names; |
8 import '../elements/elements.dart'; | 8 import '../elements/elements.dart'; |
9 import '../elements/entities.dart'; | 9 import '../elements/entities.dart'; |
10 import '../js_backend/backend.dart' show JavaScriptBackend; | 10 import '../js_backend/backend.dart' show JavaScriptBackend; |
(...skipping 14 matching lines...) Expand all Loading... |
25 : super(tracedType, inferrer); | 25 : super(tracedType, inferrer); |
26 | 26 |
27 ApplyableTypeInformation get tracedType => super.tracedType; | 27 ApplyableTypeInformation get tracedType => super.tracedType; |
28 | 28 |
29 void run() { | 29 void run() { |
30 analyze(); | 30 analyze(); |
31 if (!continueAnalyzing) return; | 31 if (!continueAnalyzing) return; |
32 _callsToAnalyze.forEach(_analyzeCall); | 32 _callsToAnalyze.forEach(_analyzeCall); |
33 for (MethodElement element in tracedElements) { | 33 for (MethodElement element in tracedElements) { |
34 MethodElement implementation = element.implementation; | 34 MethodElement implementation = element.implementation; |
35 implementation.functionSignature.forEachParameter((Element parameter) { | 35 implementation.functionSignature |
| 36 .forEachParameter((FormalElement _parameter) { |
| 37 ParameterElement parameter = _parameter; |
36 ElementTypeInformation info = | 38 ElementTypeInformation info = |
37 inferrer.types.getInferredTypeOfParameter(parameter); | 39 inferrer.types.getInferredTypeOfParameter(parameter); |
38 info.disableInferenceForClosures = false; | 40 info.disableInferenceForClosures = false; |
39 }); | 41 }); |
40 } | 42 } |
41 } | 43 } |
42 | 44 |
43 void _tagAsFunctionApplyTarget([String reason]) { | 45 void _tagAsFunctionApplyTarget([String reason]) { |
44 tracedType.mightBePassedToFunctionApply = true; | 46 tracedType.mightBePassedToFunctionApply = true; |
45 if (debug.VERBOSE) { | 47 if (debug.VERBOSE) { |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 @override | 139 @override |
138 visitStaticCallSiteTypeInformation(StaticCallSiteTypeInformation info) { | 140 visitStaticCallSiteTypeInformation(StaticCallSiteTypeInformation info) { |
139 super.visitStaticCallSiteTypeInformation(info); | 141 super.visitStaticCallSiteTypeInformation(info); |
140 if (info.calledElement == tracedElements.first && | 142 if (info.calledElement == tracedElements.first && |
141 info.selector != null && | 143 info.selector != null && |
142 info.selector.isGetter) { | 144 info.selector.isGetter) { |
143 addNewEscapeInformation(info); | 145 addNewEscapeInformation(info); |
144 } | 146 } |
145 } | 147 } |
146 } | 148 } |
OLD | NEW |