| 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 12 matching lines...) Expand all Loading... |
| 23 ClosureTracerVisitor(this.tracedElements, ApplyableTypeInformation tracedType, | 23 ClosureTracerVisitor(this.tracedElements, ApplyableTypeInformation tracedType, |
| 24 InferrerEngine inferrer) | 24 InferrerEngine inferrer) |
| 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 (FunctionEntity element in tracedElements) { |
| 34 MethodElement implementation = element.implementation; | 34 inferrer.types.strategy.forEachParameter(element, (Local parameter) { |
| 35 implementation.functionSignature | |
| 36 .forEachParameter((FormalElement _parameter) { | |
| 37 ParameterElement parameter = _parameter; | |
| 38 ElementTypeInformation info = | 35 ElementTypeInformation info = |
| 39 inferrer.types.getInferredTypeOfParameter(parameter); | 36 inferrer.types.getInferredTypeOfParameter(parameter); |
| 40 info.disableInferenceForClosures = false; | 37 info.disableInferenceForClosures = false; |
| 41 }); | 38 }); |
| 42 } | 39 } |
| 43 } | 40 } |
| 44 | 41 |
| 45 void _tagAsFunctionApplyTarget([String reason]) { | 42 void _tagAsFunctionApplyTarget([String reason]) { |
| 46 tracedType.mightBePassedToFunctionApply = true; | 43 tracedType.mightBePassedToFunctionApply = true; |
| 47 if (debug.VERBOSE) { | 44 if (debug.VERBOSE) { |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 @override | 136 @override |
| 140 visitStaticCallSiteTypeInformation(StaticCallSiteTypeInformation info) { | 137 visitStaticCallSiteTypeInformation(StaticCallSiteTypeInformation info) { |
| 141 super.visitStaticCallSiteTypeInformation(info); | 138 super.visitStaticCallSiteTypeInformation(info); |
| 142 if (info.calledElement == tracedElements.first && | 139 if (info.calledElement == tracedElements.first && |
| 143 info.selector != null && | 140 info.selector != null && |
| 144 info.selector.isGetter) { | 141 info.selector.isGetter) { |
| 145 addNewEscapeInformation(info); | 142 addNewEscapeInformation(info); |
| 146 } | 143 } |
| 147 } | 144 } |
| 148 } | 145 } |
| OLD | NEW |