| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 | 5 |
| 6 class MethodCallData { | 6 class MethodCallData { |
| 7 MethodData data; | 7 MethodData data; |
| 8 | 8 |
| 9 MethodMember method; | 9 MethodMember method; |
| 10 | 10 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 List<MethodCallData> _calls; | 40 List<MethodCallData> _calls; |
| 41 | 41 |
| 42 MethodData(this.baseMethod, [this.context]): _calls = [] { | 42 MethodData(this.baseMethod, [this.context]): _calls = [] { |
| 43 body = baseMethod.definition.body; | 43 body = baseMethod.definition.body; |
| 44 if (baseMethod.isConstructor) { | 44 if (baseMethod.isConstructor) { |
| 45 needsTypeParams = true; | 45 needsTypeParams = true; |
| 46 } | 46 } |
| 47 } | 47 } |
| 48 | 48 |
| 49 void analyze() { | 49 void analyze() { |
| 50 // TODO(jimhug): Is there really no analysis to do for a missing body? | |
| 51 if (body === null) return; | |
| 52 var ma = new MethodAnalyzer(baseMethod, body); | 50 var ma = new MethodAnalyzer(baseMethod, body); |
| 53 ma.analyze(context); | 51 ma.analyze(context); |
| 54 // TODO(jimhug): Add support for specializing on type parameters. | 52 // TODO(jimhug): Add support for specializing on type parameters. |
| 55 /* | 53 /* |
| 56 if (ma.hasTypeParams) { | 54 if (ma.hasTypeParams) { |
| 57 needsTypeParams = true; | 55 needsTypeParams = true; |
| 58 } | 56 } |
| 59 */ | 57 */ |
| 60 } | 58 } |
| 61 | 59 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 if (baseMethod.name != '') { | 140 if (baseMethod.name != '') { |
| 143 lambdaGen._popBlock(baseMethod.definition); | 141 lambdaGen._popBlock(baseMethod.definition); |
| 144 } | 142 } |
| 145 | 143 |
| 146 final writer = new CodeWriter(); | 144 final writer = new CodeWriter(); |
| 147 lambdaGen.writeDefinition(writer, node); | 145 lambdaGen.writeDefinition(writer, node); |
| 148 return new Value(baseMethod.functionType, writer.text, | 146 return new Value(baseMethod.functionType, writer.text, |
| 149 baseMethod.definition.span); | 147 baseMethod.definition.span); |
| 150 } | 148 } |
| 151 } | 149 } |
| OLD | NEW |