| 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 fasta.kernel_target; | 5 library fasta.kernel_target; |
| 6 | 6 |
| 7 import 'dart:async' show Future; | 7 import 'dart:async' show Future; |
| 8 | 8 |
| 9 import 'dart:io' show File; | 9 import 'dart:io' show File; |
| 10 | 10 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 TypeParameter, | 38 TypeParameter, |
| 39 VariableDeclaration, | 39 VariableDeclaration, |
| 40 VariableGet, | 40 VariableGet, |
| 41 VoidType; | 41 VoidType; |
| 42 | 42 |
| 43 import 'package:kernel/core_types.dart' show CoreTypes; | 43 import 'package:kernel/core_types.dart' show CoreTypes; |
| 44 import 'package:kernel/transformations/erasure.dart' show Erasure; | 44 import 'package:kernel/transformations/erasure.dart' show Erasure; |
| 45 | 45 |
| 46 import 'package:kernel/transformations/continuation.dart' as transformAsync; | 46 import 'package:kernel/transformations/continuation.dart' as transformAsync; |
| 47 | 47 |
| 48 import 'package:kernel/transformations/mixin_full_resolution.dart' | 48 import 'package:kernel/transformations/mixin_full_resolution.dart' as mix; |
| 49 show MixinFullResolution; | |
| 50 | 49 |
| 51 import 'package:kernel/type_algebra.dart' show substitute; | 50 import 'package:kernel/type_algebra.dart' show substitute; |
| 52 | 51 |
| 53 import '../source/source_loader.dart' show SourceLoader; | 52 import '../source/source_loader.dart' show SourceLoader; |
| 54 | 53 |
| 55 import '../source/source_class_builder.dart' show SourceClassBuilder; | 54 import '../source/source_class_builder.dart' show SourceClassBuilder; |
| 56 | 55 |
| 57 import '../target_implementation.dart' show TargetImplementation; | 56 import '../target_implementation.dart' show TargetImplementation; |
| 58 | 57 |
| 59 import '../translate_uri.dart' show TranslateUri; | 58 import '../translate_uri.dart' show TranslateUri; |
| (...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 655 } | 654 } |
| 656 | 655 |
| 657 /// Run all transformations that are needed when building a program for the | 656 /// Run all transformations that are needed when building a program for the |
| 658 /// first time. | 657 /// first time. |
| 659 void runBuildTransformations() { | 658 void runBuildTransformations() { |
| 660 transformMixinApplications(); | 659 transformMixinApplications(); |
| 661 otherTransformations(); | 660 otherTransformations(); |
| 662 } | 661 } |
| 663 | 662 |
| 664 void transformMixinApplications() { | 663 void transformMixinApplications() { |
| 665 new MixinFullResolution(backendTarget).transform(_program); | 664 mix.transformLibraries(backendTarget, loader.libraries); |
| 666 ticker.logMs("Transformed mixin applications"); | 665 ticker.logMs("Transformed mixin applications"); |
| 667 } | 666 } |
| 668 | 667 |
| 669 void otherTransformations() { | 668 void otherTransformations() { |
| 670 // TODO(ahe): Don't generate type variables in the first place. | 669 // TODO(ahe): Don't generate type variables in the first place. |
| 671 if (!strongMode) { | 670 if (!strongMode) { |
| 672 _program.accept(new Erasure()); | 671 _program.accept(new Erasure()); |
| 673 ticker.logMs("Erased type variables in generic methods"); | 672 ticker.logMs("Erased type variables in generic methods"); |
| 674 } | 673 } |
| 675 var coreTypes = new CoreTypes(_program); | 674 var coreTypes = new CoreTypes(_program); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 722 } | 721 } |
| 723 for (Constructor constructor in superclass.constructors) { | 722 for (Constructor constructor in superclass.constructors) { |
| 724 if (constructor.name.name.isEmpty) { | 723 if (constructor.name.name.isEmpty) { |
| 725 return constructor.function.requiredParameterCount == 0 | 724 return constructor.function.requiredParameterCount == 0 |
| 726 ? constructor | 725 ? constructor |
| 727 : null; | 726 : null; |
| 728 } | 727 } |
| 729 } | 728 } |
| 730 return null; | 729 return null; |
| 731 } | 730 } |
| OLD | NEW |