| 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 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 Message, | 43 Message, |
| 44 templateCyclicClassHierarchy, | 44 templateCyclicClassHierarchy, |
| 45 templateExtendingEnum, | 45 templateExtendingEnum, |
| 46 templateExtendingRestricted, | 46 templateExtendingRestricted, |
| 47 templateIllegalMixin, | 47 templateIllegalMixin, |
| 48 templateIllegalMixinDueToConstructors, | 48 templateIllegalMixinDueToConstructors, |
| 49 templateIllegalMixinDueToConstructorsCause, | 49 templateIllegalMixinDueToConstructorsCause, |
| 50 templateInternalProblemUriMissingScheme, | 50 templateInternalProblemUriMissingScheme, |
| 51 templateUnspecified; | 51 templateUnspecified; |
| 52 | 52 |
| 53 import '../kernel/kernel_shadow_ast.dart' show KernelTypeInferenceEngine; | 53 import '../kernel/kernel_shadow_ast.dart' show ShadowTypeInferenceEngine; |
| 54 | 54 |
| 55 import '../kernel/kernel_target.dart' show KernelTarget; | 55 import '../kernel/kernel_target.dart' show KernelTarget; |
| 56 | 56 |
| 57 import '../loader.dart' show Loader; | 57 import '../loader.dart' show Loader; |
| 58 | 58 |
| 59 import '../parser/class_member_parser.dart' show ClassMemberParser; | 59 import '../parser/class_member_parser.dart' show ClassMemberParser; |
| 60 | 60 |
| 61 import '../scanner.dart' show ErrorToken, ScannerResult, Token, scan; | 61 import '../scanner.dart' show ErrorToken, ScannerResult, Token, scan; |
| 62 | 62 |
| 63 import '../severity.dart' show Severity; | 63 import '../severity.dart' show Severity; |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 void checkOverrides(List<SourceClassBuilder> sourceClasses) { | 470 void checkOverrides(List<SourceClassBuilder> sourceClasses) { |
| 471 assert(hierarchy != null); | 471 assert(hierarchy != null); |
| 472 for (SourceClassBuilder builder in sourceClasses) { | 472 for (SourceClassBuilder builder in sourceClasses) { |
| 473 builder.checkOverrides(hierarchy); | 473 builder.checkOverrides(hierarchy); |
| 474 } | 474 } |
| 475 ticker.logMs("Checked overrides"); | 475 ticker.logMs("Checked overrides"); |
| 476 } | 476 } |
| 477 | 477 |
| 478 void createTypeInferenceEngine() { | 478 void createTypeInferenceEngine() { |
| 479 typeInferenceEngine = | 479 typeInferenceEngine = |
| 480 new KernelTypeInferenceEngine(instrumentation, target.strongMode); | 480 new ShadowTypeInferenceEngine(instrumentation, target.strongMode); |
| 481 } | 481 } |
| 482 | 482 |
| 483 /// Performs the first phase of top level initializer inference, which | 483 /// Performs the first phase of top level initializer inference, which |
| 484 /// consists of creating kernel objects for all fields and top level variables | 484 /// consists of creating kernel objects for all fields and top level variables |
| 485 /// that might be subject to type inference, and records dependencies between | 485 /// that might be subject to type inference, and records dependencies between |
| 486 /// them. | 486 /// them. |
| 487 void prepareInitializerInference() { | 487 void prepareInitializerInference() { |
| 488 typeInferenceEngine.prepareTopLevel(coreTypes, hierarchy); | 488 typeInferenceEngine.prepareTopLevel(coreTypes, hierarchy); |
| 489 builders.forEach((Uri uri, LibraryBuilder library) { | 489 builders.forEach((Uri uri, LibraryBuilder library) { |
| 490 if (library is SourceLibraryBuilder) { | 490 if (library is SourceLibraryBuilder) { |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 Expression throwCompileConstantError(Expression error) { | 552 Expression throwCompileConstantError(Expression error) { |
| 553 return target.backendTarget.throwCompileConstantError(coreTypes, error); | 553 return target.backendTarget.throwCompileConstantError(coreTypes, error); |
| 554 } | 554 } |
| 555 | 555 |
| 556 Expression buildCompileTimeError(Message message, int offset, Uri uri) { | 556 Expression buildCompileTimeError(Message message, int offset, Uri uri) { |
| 557 String text = target.context | 557 String text = target.context |
| 558 .format(message.withLocation(uri, offset), Severity.error); | 558 .format(message.withLocation(uri, offset), Severity.error); |
| 559 return target.backendTarget.buildCompileTimeError(coreTypes, text, offset); | 559 return target.backendTarget.buildCompileTimeError(coreTypes, text, offset); |
| 560 } | 560 } |
| 561 } | 561 } |
| OLD | NEW |