| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 import '../common.dart'; | 5 import '../common.dart'; |
| 6 import '../common/names.dart' show Identifiers, Names, Selectors; | 6 import '../common/names.dart' show Identifiers, Names, Selectors; |
| 7 import '../compiler.dart' show Compiler; | 7 import '../compiler.dart' show Compiler; |
| 8 import '../elements/elements.dart'; | 8 import '../elements/elements.dart'; |
| 9 import '../tree/tree.dart'; | 9 import '../tree/tree.dart'; |
| 10 import 'backend.dart'; | 10 import 'backend.dart'; |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 | 117 |
| 118 /// Returns [true] if the given element is a complex [noSuchMethod] | 118 /// Returns [true] if the given element is a complex [noSuchMethod] |
| 119 /// implementation. An implementation is complex if it falls into | 119 /// implementation. An implementation is complex if it falls into |
| 120 /// category D, as described above. | 120 /// category D, as described above. |
| 121 bool isComplex(FunctionElement element) { | 121 bool isComplex(FunctionElement element) { |
| 122 assert(element.name == Identifiers.noSuchMethod_); | 122 assert(element.name == Identifiers.noSuchMethod_); |
| 123 return otherImpls.contains(element); | 123 return otherImpls.contains(element); |
| 124 } | 124 } |
| 125 | 125 |
| 126 _subcategorizeOther(FunctionElement element) { | 126 _subcategorizeOther(FunctionElement element) { |
| 127 if (_compiler.globalInference.results.throwsAlways(element)) { | 127 if (_compiler.globalInference.results.resultOf(element).throwsAlways) { |
| 128 complexNoReturnImpls.add(element); | 128 complexNoReturnImpls.add(element); |
| 129 } else { | 129 } else { |
| 130 complexReturningImpls.add(element); | 130 complexReturningImpls.add(element); |
| 131 } | 131 } |
| 132 } | 132 } |
| 133 | 133 |
| 134 NsmCategory _categorizeImpl(FunctionElement element) { | 134 NsmCategory _categorizeImpl(FunctionElement element) { |
| 135 assert(element.name == Identifiers.noSuchMethod_); | 135 assert(element.name == Identifiers.noSuchMethod_); |
| 136 if (defaultImpls.contains(element)) { | 136 if (defaultImpls.contains(element)) { |
| 137 return NsmCategory.DEFAULT; | 137 return NsmCategory.DEFAULT; |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 if (body.statements.nodes.head is ExpressionStatement) { | 261 if (body.statements.nodes.head is ExpressionStatement) { |
| 262 ExpressionStatement stmt = body.statements.nodes.head; | 262 ExpressionStatement stmt = body.statements.nodes.head; |
| 263 return stmt.expression is Throw; | 263 return stmt.expression is Throw; |
| 264 } | 264 } |
| 265 } | 265 } |
| 266 return false; | 266 return false; |
| 267 } | 267 } |
| 268 } | 268 } |
| 269 | 269 |
| 270 enum NsmCategory { DEFAULT, THROWING, NOT_APPLICABLE, OTHER, } | 270 enum NsmCategory { DEFAULT, THROWING, NOT_APPLICABLE, OTHER, } |
| OLD | NEW |