| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
| 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. |
| 4 |
| 5 library dart2js.kernel.frontend_strategy; |
| 6 |
| 7 import '../common.dart'; |
| 8 import '../common_elements.dart'; |
| 9 import '../common/tasks.dart'; |
| 10 import '../environment.dart' as env; |
| 11 import '../frontend_strategy.dart'; |
| 12 import '../library_loader.dart'; |
| 13 import '../serialization/task.dart'; |
| 14 import '../patch_parser.dart'; |
| 15 import '../resolved_uri_translator.dart'; |
| 16 import 'world_builder.dart'; |
| 17 |
| 18 /// Front end strategy that loads '.dill' files and builds a resolved element |
| 19 /// model from kernel IR nodes. |
| 20 class KernelFrontEndStrategy implements FrontEndStrategy { |
| 21 KernelWorldBuilder worldBuilder; |
| 22 |
| 23 KernelAnnotationProcessor _annotationProcesser; |
| 24 |
| 25 KernelFrontEndStrategy(DiagnosticReporter reporter) |
| 26 : worldBuilder = new KernelWorldBuilder(reporter); |
| 27 |
| 28 @override |
| 29 LibraryLoaderTask createLibraryLoader( |
| 30 ResolvedUriTranslator uriTranslator, |
| 31 ScriptLoader scriptLoader, |
| 32 ElementScanner scriptScanner, |
| 33 LibraryDeserializer deserializer, |
| 34 PatchResolverFunction patchResolverFunc, |
| 35 PatchParserTask patchParser, |
| 36 env.Environment environment, |
| 37 DiagnosticReporter reporter, |
| 38 Measurer measurer) { |
| 39 return new DillLibraryLoaderTask( |
| 40 worldBuilder, uriTranslator, scriptLoader, reporter, measurer); |
| 41 } |
| 42 |
| 43 @override |
| 44 ElementEnvironment get elementEnvironment => worldBuilder.elementEnvironment; |
| 45 |
| 46 @override |
| 47 AnnotationProcessor get annotationProcesser => |
| 48 _annotationProcesser ??= new KernelAnnotationProcessor(worldBuilder); |
| 49 } |
| OLD | NEW |