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

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

Issue 1809533004: Support serialization of WorldImpact (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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 10 import '../common/codegen.dart' show
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 import '../library_loader.dart' show 48 import '../library_loader.dart' show
49 LibraryLoader, 49 LibraryLoader,
50 LoadedLibraries; 50 LoadedLibraries;
51 import '../native/native.dart' as native show 51 import '../native/native.dart' as native show
52 NativeEnqueuer, 52 NativeEnqueuer,
53 maybeEnableNative; 53 maybeEnableNative;
54 import '../patch_parser.dart' show 54 import '../patch_parser.dart' show
55 checkNativeAnnotation, checkJsInteropAnnotation; 55 checkNativeAnnotation, checkJsInteropAnnotation;
56 import '../resolution/tree_elements.dart' show 56 import '../resolution/tree_elements.dart' show
57 TreeElements; 57 TreeElements;
58 import '../serialization/serialization.dart' show
59 DeserializerPlugin,
60 ObjectDecoder,
61 ObjectEncoder,
62 SerializerPlugin;
58 import '../tree/tree.dart' show 63 import '../tree/tree.dart' show
59 Node, 64 Node,
60 Send; 65 Send;
61 import '../universe/call_structure.dart' show 66 import '../universe/call_structure.dart' show
62 CallStructure; 67 CallStructure;
63 import '../universe/world_impact.dart' show 68 import '../universe/world_impact.dart' show
64 ImpactStrategy, 69 ImpactStrategy,
65 WorldImpact; 70 WorldImpact;
66 71
67 import 'codegen.dart' show 72 import 'codegen.dart' show
(...skipping 27 matching lines...) Expand all
95 ConstantCompilerTask get constantCompilerTask; 100 ConstantCompilerTask get constantCompilerTask;
96 101
97 /// Backend transformation methods for the world impacts. 102 /// Backend transformation methods for the world impacts.
98 ImpactTransformer get impactTransformer; 103 ImpactTransformer get impactTransformer;
99 104
100 /// The strategy used for collecting and emitting source information. 105 /// The strategy used for collecting and emitting source information.
101 SourceInformationStrategy get sourceInformationStrategy { 106 SourceInformationStrategy get sourceInformationStrategy {
102 return const SourceInformationStrategy(); 107 return const SourceInformationStrategy();
103 } 108 }
104 109
110 /// Interface for serialization of backend specific data.
111 BackendSerialization get serialization => const BackendSerialization();
112
105 // TODO(johnniwinther): Move this to the JavaScriptBackend. 113 // TODO(johnniwinther): Move this to the JavaScriptBackend.
106 String get patchVersion => null; 114 String get patchVersion => null;
107 115
108 /// Set of classes that need to be considered for reflection although not 116 /// Set of classes that need to be considered for reflection although not
109 /// otherwise visible during resolution. 117 /// otherwise visible during resolution.
110 Iterable<ClassElement> classesRequiredForReflection = const []; 118 Iterable<ClassElement> classesRequiredForReflection = const [];
111 119
112 // Given a [FunctionElement], return a buffer with the code generated for it 120 // Given a [FunctionElement], return a buffer with the code generated for it
113 // or null if no code was generated. 121 // or null if no code was generated.
114 CodeBuffer codeOf(Element element) => null; 122 CodeBuffer codeOf(Element element) => null;
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 431
424 /// Returns the location of the patch-file associated with [libraryName] 432 /// Returns the location of the patch-file associated with [libraryName]
425 /// resolved from [plaformConfigUri]. 433 /// resolved from [plaformConfigUri].
426 /// 434 ///
427 /// Returns null if there is none. 435 /// Returns null if there is none.
428 Uri resolvePatchUri(String libraryName, Uri plaformConfigUri); 436 Uri resolvePatchUri(String libraryName, Uri plaformConfigUri);
429 437
430 /// Creates an impact strategy to use for compilation. 438 /// Creates an impact strategy to use for compilation.
431 ImpactStrategy createImpactStrategy( 439 ImpactStrategy createImpactStrategy(
432 {bool supportDeferredLoad: true, 440 {bool supportDeferredLoad: true,
433 bool supportDumpInfo: true}) { 441 bool supportDumpInfo: true,
442 bool supportSerialization: true}) {
434 return const ImpactStrategy(); 443 return const ImpactStrategy();
435 } 444 }
436 } 445 }
437 446
438 /// Interface for resolving calls to foreign functions. 447 /// Interface for resolving calls to foreign functions.
439 abstract class ForeignResolver { 448 abstract class ForeignResolver {
440 /// Returns the constant expression of [node], or `null` if [node] is not 449 /// Returns the constant expression of [node], or `null` if [node] is not
441 /// a constant expression. 450 /// a constant expression.
442 ConstantExpression getConstant(Node node); 451 ConstantExpression getConstant(Node node);
443 452
(...skipping 11 matching lines...) Expand all
455 WorldImpact transformResolutionImpact(ResolutionImpact worldImpact) { 464 WorldImpact transformResolutionImpact(ResolutionImpact worldImpact) {
456 return worldImpact; 465 return worldImpact;
457 } 466 }
458 467
459 /// Transform the [CodegenImpact] into a [WorldImpact] adding the 468 /// Transform the [CodegenImpact] into a [WorldImpact] adding the
460 /// backend dependencies for features used in [worldImpact]. 469 /// backend dependencies for features used in [worldImpact].
461 WorldImpact transformCodegenImpact(CodegenImpact worldImpact) { 470 WorldImpact transformCodegenImpact(CodegenImpact worldImpact) {
462 return worldImpact; 471 return worldImpact;
463 } 472 }
464 } 473 }
474
475 /// Interface for serialization of backend specific data.
476 class BackendSerialization {
477 const BackendSerialization();
478
479 SerializerPlugin get serializer => const SerializerPlugin();
480 DeserializerPlugin get deserializer => const DeserializerPlugin();
481 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/compiler.dart » ('j') | pkg/compiler/lib/src/js_backend/backend.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698