| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 * This library is capable of producing linked summaries from unlinked | 6 * This library is capable of producing linked summaries from unlinked |
| 7 * ones (or prelinked ones). It functions by building a miniature | 7 * ones (or prelinked ones). It functions by building a miniature |
| 8 * element model to represent the contents of the summaries, and then | 8 * element model to represent the contents of the summaries, and then |
| 9 * scanning the element model to gather linked information and adding | 9 * scanning the element model to gather linked information and adding |
| 10 * it to the summary data structures. | 10 * it to the summary data structures. |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 with ReferenceableElementForLink | 347 with ReferenceableElementForLink |
| 348 implements AbstractClassElementImpl { | 348 implements AbstractClassElementImpl { |
| 349 Map<String, ReferenceableElementForLink> _containedNames; | 349 Map<String, ReferenceableElementForLink> _containedNames; |
| 350 | 350 |
| 351 @override | 351 @override |
| 352 final CompilationUnitElementForLink enclosingElement; | 352 final CompilationUnitElementForLink enclosingElement; |
| 353 | 353 |
| 354 /// TODO(brianwilkerson) This appears to be unused and might be removable. | 354 /// TODO(brianwilkerson) This appears to be unused and might be removable. |
| 355 bool hasBeenInferred; | 355 bool hasBeenInferred; |
| 356 | 356 |
| 357 bool hasInferredInstanceMethods = false; | |
| 358 | |
| 359 ClassElementForLink(CompilationUnitElementForLink enclosingElement) | 357 ClassElementForLink(CompilationUnitElementForLink enclosingElement) |
| 360 : enclosingElement = enclosingElement, | 358 : enclosingElement = enclosingElement, |
| 361 hasBeenInferred = !enclosingElement.isInBuildUnit; | 359 hasBeenInferred = !enclosingElement.isInBuildUnit; |
| 362 | 360 |
| 363 @override | 361 @override |
| 364 List<PropertyAccessorElementForLink> get accessors; | 362 List<PropertyAccessorElementForLink> get accessors; |
| 365 | 363 |
| 366 @override | 364 @override |
| 367 ClassElementForLink get asClass => this; | 365 ClassElementForLink get asClass => this; |
| 368 | 366 |
| (...skipping 913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1282 throw new StateError( | 1280 throw new StateError( |
| 1283 'Linker tried to access linked type from current build unit'); | 1281 'Linker tried to access linked type from current build unit'); |
| 1284 } | 1282 } |
| 1285 | 1283 |
| 1286 /** | 1284 /** |
| 1287 * Perform type inference and const cycle detection on this | 1285 * Perform type inference and const cycle detection on this |
| 1288 * compilation unit. | 1286 * compilation unit. |
| 1289 */ | 1287 */ |
| 1290 void link() { | 1288 void link() { |
| 1291 if (library._linker.strongMode) { | 1289 if (library._linker.strongMode) { |
| 1292 var inferrer = new InstanceMemberInferrer( | 1290 new InstanceMemberInferrer(enclosingElement._linker.typeProvider, |
| 1293 enclosingElement._linker.typeProvider, | 1291 enclosingElement.inheritanceManager) |
| 1294 enclosingElement.inheritanceManager); | 1292 .inferCompilationUnit(this); |
| 1295 inferrer.inferInstanceMethods(this); | |
| 1296 inferrer.inferCompilationUnit(this); | |
| 1297 for (TopLevelVariableElementForLink variable in topLevelVariables) { | 1293 for (TopLevelVariableElementForLink variable in topLevelVariables) { |
| 1298 variable.link(this); | 1294 variable.link(this); |
| 1299 } | 1295 } |
| 1300 } | 1296 } |
| 1301 for (ClassElementForLink classElement in types) { | 1297 for (ClassElementForLink classElement in types) { |
| 1302 classElement.link(this); | 1298 classElement.link(this); |
| 1303 } | 1299 } |
| 1304 } | 1300 } |
| 1305 | 1301 |
| 1306 /** | 1302 /** |
| (...skipping 3835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5142 * there are no type parameters in scope. | 5138 * there are no type parameters in scope. |
| 5143 */ | 5139 */ |
| 5144 TypeParameterizedElementMixin get _typeParameterContext; | 5140 TypeParameterizedElementMixin get _typeParameterContext; |
| 5145 | 5141 |
| 5146 @override | 5142 @override |
| 5147 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); | 5143 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); |
| 5148 | 5144 |
| 5149 @override | 5145 @override |
| 5150 String toString() => '$enclosingElement.$name'; | 5146 String toString() => '$enclosingElement.$name'; |
| 5151 } | 5147 } |
| OLD | NEW |