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 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 (DartType typeLiteral in worldImpact.typeLiterals) { |
363 if (typeLiteral.isInterfaceType) { | 363 if (typeLiteral.isInterfaceType) { |
364 backend.usedTypeLiterals.add(typeLiteral.element); | 364 backend.usedTypeLiterals.add(typeLiteral.element); |
365 } | 365 } |
366 } | 366 } |
367 for (InterfaceType instantiatedType in worldImpact.instantiatedTypes) { | 367 for (TypeUse typeUse in worldImpact.typeUses) { |
368 // TODO(johnniwinther): Remove this when dependency tracking is done on | 368 if (typeUse.kind == TypeUseKind.INSTANTIATION) { |
369 // the world impact itself. | 369 backend.registerPlatformMembers(typeUse.type, |
370 transformed.registerInstantiatedType(instantiatedType); | 370 registerUse: transformed.registerDynamicUse); |
371 backend.registerPlatformMembers(instantiatedType, | 371 } |
372 registerUse: transformed.registerDynamicUse); | |
373 } | 372 } |
374 return transformed; | 373 return transformed; |
375 } | 374 } |
376 } | 375 } |
377 | 376 |
378 class EmitterUnparser extends Unparser { | 377 class EmitterUnparser extends Unparser { |
379 final Map<Node, String> renames; | 378 final Map<Node, String> renames; |
380 | 379 |
381 EmitterUnparser(this.renames, {bool minify, bool stripTypes}) | 380 EmitterUnparser(this.renames, {bool minify, bool stripTypes}) |
382 : super(minify: minify, stripTypes: stripTypes); | 381 : super(minify: minify, stripTypes: stripTypes); |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 } | 548 } |
550 | 549 |
551 // TODO(johnniwinther): Remove this when values are computed from the | 550 // TODO(johnniwinther): Remove this when values are computed from the |
552 // expressions. | 551 // expressions. |
553 @override | 552 @override |
554 void copyConstantValues(DartConstantTask task) { | 553 void copyConstantValues(DartConstantTask task) { |
555 constantCompiler.constantValueMap.addAll( | 554 constantCompiler.constantValueMap.addAll( |
556 task.constantCompiler.constantValueMap); | 555 task.constantCompiler.constantValueMap); |
557 } | 556 } |
558 } | 557 } |
OLD | NEW |