| 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 library dart2js.mirrors_handler; | 5 library dart2js.mirrors_handler; |
| 6 | 6 |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../common/resolution.dart'; | 8 import '../common/resolution.dart'; |
| 9 import '../compiler.dart'; | 9 import '../compiler.dart'; |
| 10 import '../constants/values.dart'; | 10 import '../constants/values.dart'; |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 | 303 |
| 304 /// Enqueue the constructor [ctor] if it is required for reflection. | 304 /// Enqueue the constructor [ctor] if it is required for reflection. |
| 305 /// | 305 /// |
| 306 /// [enclosingWasIncluded] provides a hint whether the enclosing element was | 306 /// [enclosingWasIncluded] provides a hint whether the enclosing element was |
| 307 /// needed for reflection. | 307 /// needed for reflection. |
| 308 void _enqueueReflectiveConstructor(ConstructorElement constructor, | 308 void _enqueueReflectiveConstructor(ConstructorElement constructor, |
| 309 {bool enclosingWasIncluded}) { | 309 {bool enclosingWasIncluded}) { |
| 310 assert(constructor.isDeclaration); | 310 assert(constructor.isDeclaration); |
| 311 if (_shouldIncludeElementDueToMirrors(constructor, | 311 if (_shouldIncludeElementDueToMirrors(constructor, |
| 312 includedEnclosing: enclosingWasIncluded)) { | 312 includedEnclosing: enclosingWasIncluded)) { |
| 313 if (constructor.isFromEnvironmentConstructor) return; |
| 313 _logEnqueueReflectiveAction(constructor); | 314 _logEnqueueReflectiveAction(constructor); |
| 314 ClassElement cls = constructor.enclosingClass; | 315 ClassElement cls = constructor.enclosingClass; |
| 315 impactBuilder | 316 impactBuilder |
| 316 .registerTypeUse(new TypeUse.mirrorInstantiation(cls.rawType)); | 317 .registerTypeUse(new TypeUse.mirrorInstantiation(cls.rawType)); |
| 317 impactBuilder.registerStaticUse(new StaticUse.mirrorUse(constructor)); | 318 impactBuilder.registerStaticUse(new StaticUse.mirrorUse(constructor)); |
| 318 } | 319 } |
| 319 } | 320 } |
| 320 | 321 |
| 321 /// Enqueue the member [element] if it is required for reflection. | 322 /// Enqueue the member [element] if it is required for reflection. |
| 322 /// | 323 /// |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 | 477 |
| 477 /// Records that [constant] is used by the element behind [registry]. | 478 /// Records that [constant] is used by the element behind [registry]. |
| 478 class Dependency { | 479 class Dependency { |
| 479 final ConstantValue constant; | 480 final ConstantValue constant; |
| 480 final Element annotatedElement; | 481 final Element annotatedElement; |
| 481 | 482 |
| 482 const Dependency(this.constant, this.annotatedElement); | 483 const Dependency(this.constant, this.annotatedElement); |
| 483 | 484 |
| 484 String toString() => '$annotatedElement:${constant.toStructuredText()}'; | 485 String toString() => '$annotatedElement:${constant.toStructuredText()}'; |
| 485 } | 486 } |
| OLD | NEW |