| 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.source_loader; | 5 library fasta.source_loader; |
| 6 | 6 |
| 7 import 'dart:async' show Future; | 7 import 'dart:async' show Future; |
| 8 | 8 |
| 9 import 'dart:typed_data' show Uint8List; | 9 import 'dart:typed_data' show Uint8List; |
| 10 | 10 |
| 11 import 'package:front_end/file_system.dart'; | 11 import 'package:front_end/file_system.dart'; |
| 12 import 'package:front_end/src/base/instrumentation.dart' show Instrumentation; | 12 import 'package:front_end/src/base/instrumentation.dart' show Instrumentation; |
| 13 | 13 |
| 14 import 'package:front_end/src/fasta/kernel/kernel_shadow_ast.dart' | 14 import 'package:front_end/src/fasta/kernel/kernel_shadow_ast.dart' |
| 15 show KernelTypeInferenceEngine; | 15 show KernelTypeInferenceEngine; |
| 16 | 16 |
| 17 import 'package:front_end/src/fasta/kernel/kernel_target.dart' | 17 import 'package:front_end/src/fasta/kernel/kernel_target.dart' |
| 18 show KernelTarget; | 18 show KernelTarget; |
| 19 | 19 |
| 20 import 'package:front_end/src/fasta/type_inference/type_inference_engine.dart' | 20 import 'package:front_end/src/fasta/type_inference/type_inference_engine.dart' |
| 21 show TypeInferenceEngine; | 21 show TypeInferenceEngine; |
| 22 | 22 |
| 23 import 'package:kernel/ast.dart' show Program; | 23 import 'package:kernel/ast.dart' show Program; |
| 24 | 24 |
| 25 import 'package:kernel/class_hierarchy.dart' | 25 import 'package:kernel/class_hierarchy.dart' show ClassHierarchy; |
| 26 show ClassHierarchy, ClosedWorldClassHierarchy; | |
| 27 | 26 |
| 28 import 'package:kernel/core_types.dart' show CoreTypes; | 27 import 'package:kernel/core_types.dart' show CoreTypes; |
| 29 | 28 |
| 29 import 'package:kernel/src/incremental_class_hierarchy.dart' |
| 30 show IncrementalClassHierarchy; |
| 31 |
| 30 import '../builder/builder.dart' | 32 import '../builder/builder.dart' |
| 31 show | 33 show |
| 32 Builder, | 34 Builder, |
| 33 ClassBuilder, | 35 ClassBuilder, |
| 34 EnumBuilder, | 36 EnumBuilder, |
| 35 LibraryBuilder, | 37 LibraryBuilder, |
| 36 NamedTypeBuilder, | 38 NamedTypeBuilder, |
| 37 TypeBuilder; | 39 TypeBuilder; |
| 38 | 40 |
| 39 import '../compiler_context.dart' show CompilerContext; | 41 import '../compiler_context.dart' show CompilerContext; |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 void buildProgram() { | 436 void buildProgram() { |
| 435 builders.forEach((Uri uri, LibraryBuilder library) { | 437 builders.forEach((Uri uri, LibraryBuilder library) { |
| 436 if (library is SourceLibraryBuilder) { | 438 if (library is SourceLibraryBuilder) { |
| 437 libraries.add(library.build(coreLibrary)); | 439 libraries.add(library.build(coreLibrary)); |
| 438 } | 440 } |
| 439 }); | 441 }); |
| 440 ticker.logMs("Built program"); | 442 ticker.logMs("Built program"); |
| 441 } | 443 } |
| 442 | 444 |
| 443 void computeHierarchy(Program program) { | 445 void computeHierarchy(Program program) { |
| 444 hierarchy = new ClosedWorldClassHierarchy(program); | 446 hierarchy = new IncrementalClassHierarchy(); |
| 445 ticker.logMs("Computed class hierarchy"); | 447 ticker.logMs("Computed class hierarchy"); |
| 446 coreTypes = new CoreTypes(program); | 448 coreTypes = new CoreTypes(program); |
| 447 ticker.logMs("Computed core types"); | 449 ticker.logMs("Computed core types"); |
| 448 } | 450 } |
| 449 | 451 |
| 450 void checkOverrides(List<SourceClassBuilder> sourceClasses) { | 452 void checkOverrides(List<SourceClassBuilder> sourceClasses) { |
| 451 assert(hierarchy != null); | 453 assert(hierarchy != null); |
| 452 for (SourceClassBuilder builder in sourceClasses) { | 454 for (SourceClassBuilder builder in sourceClasses) { |
| 453 builder.checkOverrides(hierarchy); | 455 builder.checkOverrides(hierarchy); |
| 454 } | 456 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 477 /// Performs the second phase of top level initializer inference, which is to | 479 /// Performs the second phase of top level initializer inference, which is to |
| 478 /// visit fields and top level variables in topologically-sorted order and | 480 /// visit fields and top level variables in topologically-sorted order and |
| 479 /// assign their types. | 481 /// assign their types. |
| 480 void performInitializerInference() { | 482 void performInitializerInference() { |
| 481 typeInferenceEngine.finishTopLevel(); | 483 typeInferenceEngine.finishTopLevel(); |
| 482 ticker.logMs("Performed initializer inference"); | 484 ticker.logMs("Performed initializer inference"); |
| 483 } | 485 } |
| 484 | 486 |
| 485 List<Uri> getDependencies() => sourceBytes.keys.toList(); | 487 List<Uri> getDependencies() => sourceBytes.keys.toList(); |
| 486 } | 488 } |
| OLD | NEW |