| 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, IOSink; | 9 import 'dart:io' show File, IOSink; |
| 10 | 10 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 import 'package:kernel/text/ast_to_text.dart' show Printer; | 44 import 'package:kernel/text/ast_to_text.dart' show Printer; |
| 45 | 45 |
| 46 import 'package:kernel/transformations/erasure.dart' show Erasure; | 46 import 'package:kernel/transformations/erasure.dart' show Erasure; |
| 47 | 47 |
| 48 import 'package:kernel/transformations/continuation.dart' as transformAsync; | 48 import 'package:kernel/transformations/continuation.dart' as transformAsync; |
| 49 | 49 |
| 50 import 'package:kernel/transformations/mixin_full_resolution.dart' | 50 import 'package:kernel/transformations/mixin_full_resolution.dart' |
| 51 show MixinFullResolution; | 51 show MixinFullResolution; |
| 52 | 52 |
| 53 import 'package:kernel/transformations/setup_builtin_library.dart' | |
| 54 as setup_builtin_library; | |
| 55 | |
| 56 import 'package:kernel/type_algebra.dart' show substitute; | 53 import 'package:kernel/type_algebra.dart' show substitute; |
| 57 | 54 |
| 58 import '../source/source_loader.dart' show SourceLoader; | 55 import '../source/source_loader.dart' show SourceLoader; |
| 59 | 56 |
| 60 import '../source/source_class_builder.dart' show SourceClassBuilder; | 57 import '../source/source_class_builder.dart' show SourceClassBuilder; |
| 61 | 58 |
| 62 import '../target_implementation.dart' show TargetImplementation; | 59 import '../target_implementation.dart' show TargetImplementation; |
| 63 | 60 |
| 64 import '../translate_uri.dart' show TranslateUri; | 61 import '../translate_uri.dart' show TranslateUri; |
| 65 | 62 |
| (...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 672 constructor.initializers.insert(0, initializer); | 669 constructor.initializers.insert(0, initializer); |
| 673 } | 670 } |
| 674 } | 671 } |
| 675 }); | 672 }); |
| 676 } | 673 } |
| 677 | 674 |
| 678 /// Run all transformations that are needed when building a program for the | 675 /// Run all transformations that are needed when building a program for the |
| 679 /// first time. | 676 /// first time. |
| 680 void runBuildTransformations() { | 677 void runBuildTransformations() { |
| 681 transformMixinApplications(); | 678 transformMixinApplications(); |
| 682 // TODO(ahe): Don't call this from two different places. | |
| 683 setup_builtin_library.transformProgram(program); | |
| 684 otherTransformations(); | 679 otherTransformations(); |
| 685 } | 680 } |
| 686 | 681 |
| 687 /// Run all transformations that are needed when linking a program. | 682 /// Run all transformations that are needed when linking a program. |
| 688 void runLinkTransformations(Program program) { | 683 void runLinkTransformations(Program program) {} |
| 689 setup_builtin_library.transformProgram(program); | |
| 690 } | |
| 691 | 684 |
| 692 void transformMixinApplications() { | 685 void transformMixinApplications() { |
| 693 new MixinFullResolution().transform(program); | 686 new MixinFullResolution().transform(program); |
| 694 ticker.logMs("Transformed mixin applications"); | 687 ticker.logMs("Transformed mixin applications"); |
| 695 } | 688 } |
| 696 | 689 |
| 697 void otherTransformations() { | 690 void otherTransformations() { |
| 698 // TODO(ahe): Don't generate type variables in the first place. | 691 // TODO(ahe): Don't generate type variables in the first place. |
| 699 program.accept(new Erasure()); | 692 program.accept(new Erasure()); |
| 700 ticker.logMs("Erased type variables in generic methods"); | 693 ticker.logMs("Erased type variables in generic methods"); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 729 } | 722 } |
| 730 for (Constructor constructor in superclass.constructors) { | 723 for (Constructor constructor in superclass.constructors) { |
| 731 if (constructor.name.name.isEmpty) { | 724 if (constructor.name.name.isEmpty) { |
| 732 return constructor.function.requiredParameterCount == 0 | 725 return constructor.function.requiredParameterCount == 0 |
| 733 ? constructor | 726 ? constructor |
| 734 : null; | 727 : null; |
| 735 } | 728 } |
| 736 } | 729 } |
| 737 return null; | 730 return null; |
| 738 } | 731 } |
| OLD | NEW |