Chromium Code Reviews| 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 22 matching lines...) Expand all Loading... | |
| 33 Program, | 33 Program, |
| 34 Source, | 34 Source, |
| 35 StringLiteral, | 35 StringLiteral, |
| 36 SuperInitializer, | 36 SuperInitializer, |
| 37 Throw, | 37 Throw, |
| 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'; | |
|
ahe
2017/05/24 12:15:55
Please use show.
scheglov
2017/05/24 22:45:50
Done.
| |
| 43 import 'package:kernel/transformations/erasure.dart' show Erasure; | 44 import 'package:kernel/transformations/erasure.dart' show Erasure; |
| 44 | 45 |
| 45 import 'package:kernel/transformations/continuation.dart' as transformAsync; | 46 import 'package:kernel/transformations/continuation.dart' as transformAsync; |
| 46 | 47 |
| 47 import 'package:kernel/transformations/mixin_full_resolution.dart' | 48 import 'package:kernel/transformations/mixin_full_resolution.dart' |
| 48 show MixinFullResolution; | 49 show MixinFullResolution; |
| 49 | 50 |
| 50 import 'package:kernel/type_algebra.dart' show substitute; | 51 import 'package:kernel/type_algebra.dart' show substitute; |
| 51 | 52 |
| 52 import '../source/source_loader.dart' show SourceLoader; | 53 import '../source/source_loader.dart' show SourceLoader; |
| (...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 663 new MixinFullResolution(backendTarget).transform(_program); | 664 new MixinFullResolution(backendTarget).transform(_program); |
| 664 ticker.logMs("Transformed mixin applications"); | 665 ticker.logMs("Transformed mixin applications"); |
| 665 } | 666 } |
| 666 | 667 |
| 667 void otherTransformations() { | 668 void otherTransformations() { |
| 668 // TODO(ahe): Don't generate type variables in the first place. | 669 // TODO(ahe): Don't generate type variables in the first place. |
| 669 if (!strongMode) { | 670 if (!strongMode) { |
| 670 _program.accept(new Erasure()); | 671 _program.accept(new Erasure()); |
| 671 ticker.logMs("Erased type variables in generic methods"); | 672 ticker.logMs("Erased type variables in generic methods"); |
| 672 } | 673 } |
| 673 // TODO(kmillikin): Make this run on a per-method basis. | 674 var coreTypes = new CoreTypes(_program); |
|
ahe
2017/05/24 12:15:55
I think this TODO still applies.
scheglov
2017/05/24 22:45:50
Done.
| |
| 674 transformAsync.transformProgram(_program); | 675 transformAsync.transformLibraries(coreTypes, loader.libraries); |
| 675 ticker.logMs("Transformed async methods"); | 676 ticker.logMs("Transformed async methods"); |
| 676 } | 677 } |
| 677 | 678 |
| 678 void verify() { | 679 void verify() { |
| 679 var verifyErrors = verifyProgram(_program); | 680 var verifyErrors = verifyProgram(_program); |
| 680 errors.addAll(verifyErrors.map((error) => '$error')); | 681 errors.addAll(verifyErrors.map((error) => '$error')); |
| 681 ticker.logMs("Verified program"); | 682 ticker.logMs("Verified program"); |
| 682 } | 683 } |
| 683 | 684 |
| 684 /// Tree-shakes most code from the [dillTarget] by visiting all other | 685 /// Tree-shakes most code from the [dillTarget] by visiting all other |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 713 } | 714 } |
| 714 for (Constructor constructor in superclass.constructors) { | 715 for (Constructor constructor in superclass.constructors) { |
| 715 if (constructor.name.name.isEmpty) { | 716 if (constructor.name.name.isEmpty) { |
| 716 return constructor.function.requiredParameterCount == 0 | 717 return constructor.function.requiredParameterCount == 0 |
| 717 ? constructor | 718 ? constructor |
| 718 : null; | 719 : null; |
| 719 } | 720 } |
| 720 } | 721 } |
| 721 return null; | 722 return null; |
| 722 } | 723 } |
| OLD | NEW |