| 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 part of dart_backend; | 5 part of dart_backend; |
| 6 | 6 |
| 7 // TODO(ahe): This class is simply wrong. This backend should use | 7 // TODO(ahe): This class is simply wrong. This backend should use |
| 8 // elements when it can, not AST nodes. Perhaps a [Map<Element, | 8 // elements when it can, not AST nodes. Perhaps a [Map<Element, |
| 9 // TreeElements>] is what is needed. | 9 // TreeElements>] is what is needed. |
| 10 class ElementAst { | 10 class ElementAst { |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 | 352 |
| 353 class DartImpactTransformer extends ImpactTransformer { | 353 class DartImpactTransformer extends ImpactTransformer { |
| 354 final DartBackend backend; | 354 final DartBackend backend; |
| 355 | 355 |
| 356 DartImpactTransformer(this.backend); | 356 DartImpactTransformer(this.backend); |
| 357 | 357 |
| 358 @override | 358 @override |
| 359 WorldImpact transformResolutionImpact(ResolutionImpact worldImpact) { | 359 WorldImpact transformResolutionImpact(ResolutionImpact worldImpact) { |
| 360 TransformedWorldImpact transformed = | 360 TransformedWorldImpact transformed = |
| 361 new TransformedWorldImpact(worldImpact); | 361 new TransformedWorldImpact(worldImpact); |
| 362 for (DartType typeLiteral in worldImpact.typeLiterals) { | 362 for (TypeUse typeUse in worldImpact.typeUses) { |
| 363 if (typeLiteral.isInterfaceType) { | 363 if (typeUse.kind == TypeUseKind.TYPE_LITERAL && |
| 364 backend.usedTypeLiterals.add(typeLiteral.element); | 364 typeUse.type.isInterfaceType) { |
| 365 backend.usedTypeLiterals.add(typeUse.type.element); |
| 365 } | 366 } |
| 366 } | |
| 367 for (TypeUse typeUse in worldImpact.typeUses) { | |
| 368 if (typeUse.kind == TypeUseKind.INSTANTIATION) { | 367 if (typeUse.kind == TypeUseKind.INSTANTIATION) { |
| 369 backend.registerPlatformMembers(typeUse.type, | 368 backend.registerPlatformMembers(typeUse.type, |
| 370 registerUse: transformed.registerDynamicUse); | 369 registerUse: transformed.registerDynamicUse); |
| 371 } | 370 } |
| 372 } | 371 } |
| 373 return transformed; | 372 return transformed; |
| 374 } | 373 } |
| 375 } | 374 } |
| 376 | 375 |
| 377 class EmitterUnparser extends Unparser { | 376 class EmitterUnparser extends Unparser { |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 } | 547 } |
| 549 | 548 |
| 550 // TODO(johnniwinther): Remove this when values are computed from the | 549 // TODO(johnniwinther): Remove this when values are computed from the |
| 551 // expressions. | 550 // expressions. |
| 552 @override | 551 @override |
| 553 void copyConstantValues(DartConstantTask task) { | 552 void copyConstantValues(DartConstantTask task) { |
| 554 constantCompiler.constantValueMap.addAll( | 553 constantCompiler.constantValueMap.addAll( |
| 555 task.constantCompiler.constantValueMap); | 554 task.constantCompiler.constantValueMap); |
| 556 } | 555 } |
| 557 } | 556 } |
| OLD | NEW |