Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(214)

Side by Side Diff: pkg/compiler/lib/src/common/backend_api.dart

Issue 2296153002: Use backend-specific enqueuer. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 dart2js.backend_api; 5 library dart2js.backend_api;
6 6
7 import 'dart:async' show Future; 7 import 'dart:async' show Future;
8 8
9 import '../common.dart'; 9 import '../common.dart';
10 import '../common/codegen.dart' show CodegenImpact; 10 import '../common/codegen.dart' show CodegenImpact;
11 import '../common/resolution.dart' show ResolutionImpact, Frontend, Target; 11 import '../common/resolution.dart' show ResolutionImpact, Frontend, Target;
12 import '../compile_time_constants.dart' 12 import '../compile_time_constants.dart'
13 show BackendConstantEnvironment, ConstantCompilerTask; 13 show BackendConstantEnvironment, ConstantCompilerTask;
14 import '../compiler.dart' show Compiler; 14 import '../compiler.dart' show Compiler;
15 import '../constants/constant_system.dart' show ConstantSystem; 15 import '../constants/constant_system.dart' show ConstantSystem;
16 import '../constants/expressions.dart' show ConstantExpression; 16 import '../constants/expressions.dart' show ConstantExpression;
17 import '../constants/values.dart' show ConstantValue; 17 import '../constants/values.dart' show ConstantValue;
18 import '../dart_types.dart' show DartType, InterfaceType; 18 import '../dart_types.dart' show DartType, InterfaceType;
19 import '../elements/elements.dart' 19 import '../elements/elements.dart'
20 show ClassElement, Element, FunctionElement, LibraryElement; 20 show ClassElement, Element, FunctionElement, LibraryElement;
21 import '../enqueue.dart' show Enqueuer, EnqueueTask, ResolutionEnqueuer; 21 import '../enqueue.dart'
22 show Enqueuer, EnqueueTask, CodegenEnqueuer, ResolutionEnqueuer;
22 import '../io/code_output.dart' show CodeBuffer; 23 import '../io/code_output.dart' show CodeBuffer;
23 import '../io/source_information.dart' show SourceInformationStrategy; 24 import '../io/source_information.dart' show SourceInformationStrategy;
24 import '../js_backend/backend_helpers.dart' as js_backend show BackendHelpers; 25 import '../js_backend/backend_helpers.dart' as js_backend show BackendHelpers;
25 import '../js_backend/js_backend.dart' as js_backend; 26 import '../js_backend/js_backend.dart' as js_backend;
26 import '../library_loader.dart' show LibraryLoader, LoadedLibraries; 27 import '../library_loader.dart' show LibraryLoader, LoadedLibraries;
27 import '../native/native.dart' as native show NativeEnqueuer, maybeEnableNative; 28 import '../native/native.dart' as native show NativeEnqueuer, maybeEnableNative;
28 import '../patch_parser.dart' 29 import '../patch_parser.dart'
29 show checkNativeAnnotation, checkJsInteropAnnotation; 30 show checkNativeAnnotation, checkJsInteropAnnotation;
30 import '../serialization/serialization.dart' 31 import '../serialization/serialization.dart'
31 show DeserializerPlugin, SerializerPlugin; 32 show DeserializerPlugin, SerializerPlugin;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 Iterable<ClassElement> classesRequiredForReflection = const []; 76 Iterable<ClassElement> classesRequiredForReflection = const [];
76 77
77 // Given a [FunctionElement], return a buffer with the code generated for it 78 // Given a [FunctionElement], return a buffer with the code generated for it
78 // or null if no code was generated. 79 // or null if no code was generated.
79 CodeBuffer codeOf(Element element) => null; 80 CodeBuffer codeOf(Element element) => null;
80 81
81 void initializeHelperClasses() {} 82 void initializeHelperClasses() {}
82 83
83 void enqueueHelpers(ResolutionEnqueuer world, Registry registry); 84 void enqueueHelpers(ResolutionEnqueuer world, Registry registry);
84 85
86 /// Creates a [CodegenEnqueuer] specific to this backend.
87 CodegenEnqueuer createCodegenEnqueuer(Compiler compiler);
88
85 WorldImpact codegen(CodegenWorkItem work); 89 WorldImpact codegen(CodegenWorkItem work);
86 90
87 // The backend determines the native resolution enqueuer, with a no-op 91 // The backend determines the native resolution enqueuer, with a no-op
88 // default, so tools like dart2dart can ignore the native classes. 92 // default, so tools like dart2dart can ignore the native classes.
89 native.NativeEnqueuer nativeResolutionEnqueuer(world) { 93 native.NativeEnqueuer nativeResolutionEnqueuer(world) {
90 return new native.NativeEnqueuer(); 94 return new native.NativeEnqueuer();
91 } 95 }
92 96
93 native.NativeEnqueuer nativeCodegenEnqueuer(world) { 97 native.NativeEnqueuer nativeCodegenEnqueuer(world) {
94 return new native.NativeEnqueuer(); 98 return new native.NativeEnqueuer();
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 } 410 }
407 } 411 }
408 412
409 /// Interface for serialization of backend specific data. 413 /// Interface for serialization of backend specific data.
410 class BackendSerialization { 414 class BackendSerialization {
411 const BackendSerialization(); 415 const BackendSerialization();
412 416
413 SerializerPlugin get serializer => const SerializerPlugin(); 417 SerializerPlugin get serializer => const SerializerPlugin();
414 DeserializerPlugin get deserializer => const DeserializerPlugin(); 418 DeserializerPlugin get deserializer => const DeserializerPlugin();
415 } 419 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/enqueue.dart » ('j') | pkg/compiler/lib/src/js_backend/enqueuer.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698