mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 00:13:50 +00:00
[dart2js] add facade for kernel_strategy
Change-Id: I71681bd8d3e6d06aeedd3a8dfc94bbc47fa8fbd1 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262741 Reviewed-by: Nate Biggs <natebiggs@google.com>
This commit is contained in:
parent
6843d6e5be
commit
b5bb9f84a1
|
@ -24,6 +24,7 @@ import 'compiler_interfaces.dart'
|
|||
show
|
||||
CompilerDeferredLoadingFacade,
|
||||
CompilerDiagnosticsFacade,
|
||||
CompilerKernelStrategyFacade,
|
||||
CompilerTypeInferenceFacade;
|
||||
import 'deferred_load/deferred_load.dart' show DeferredLoadTask;
|
||||
import 'deferred_load/output_unit.dart' show OutputUnitData;
|
||||
|
@ -78,6 +79,7 @@ class Compiler
|
|||
implements
|
||||
CompilerDiagnosticsFacade,
|
||||
CompilerDeferredLoadingFacade,
|
||||
CompilerKernelStrategyFacade,
|
||||
CompilerTypeInferenceFacade {
|
||||
@override
|
||||
final Measurer measurer;
|
||||
|
@ -137,6 +139,7 @@ class Compiler
|
|||
GenericTask selfTask;
|
||||
|
||||
GenericTask enqueueTask;
|
||||
@override
|
||||
DeferredLoadTask deferredLoadTask;
|
||||
DumpInfoTask dumpInfoTask;
|
||||
SerializationTask serializationTask;
|
||||
|
|
|
@ -9,6 +9,7 @@ library compiler.src.compiler_interfaces;
|
|||
import '../compiler_api.dart' show CompilerOutput, Diagnostic;
|
||||
|
||||
import 'common/tasks.dart' show Measurer;
|
||||
import 'deferred_load/deferred_load.dart' show DeferredLoadTask;
|
||||
import 'deferred_load/program_split_constraints/nodes.dart' show ConstraintData;
|
||||
import 'diagnostics/diagnostic_listener.dart' show DiagnosticMessage;
|
||||
import 'diagnostics/diagnostic_listener.dart' show DiagnosticReporter;
|
||||
|
@ -64,3 +65,18 @@ abstract class CompilerDiagnosticsFacade {
|
|||
|
||||
SourceSpan spanFromSpannable(Spannable spannable, Entity? currentElement);
|
||||
}
|
||||
|
||||
/// Subset of [Compiler] needed by kernel strategy
|
||||
///
|
||||
/// See definitions on [Compiler] for documentation.
|
||||
abstract class CompilerKernelStrategyFacade {
|
||||
bool get compilationFailed;
|
||||
Measurer get measurer;
|
||||
DiagnosticReporter get reporter;
|
||||
Map<Entity, WorldImpact> get impactCache;
|
||||
CompilerOptions get options;
|
||||
KernelFrontendStrategyForDeferredLoading get frontendStrategy;
|
||||
CompilerOutput get outputProvider;
|
||||
ConstraintData? get programSplitConstraintsData;
|
||||
DeferredLoadTask get deferredLoadTask;
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ import '../common/elements.dart';
|
|||
import '../common/names.dart' show Uris;
|
||||
import '../common/tasks.dart';
|
||||
import '../common/work.dart';
|
||||
import '../compiler.dart';
|
||||
import '../compiler_interfaces.dart';
|
||||
import '../deferred_load/deferred_load.dart' show DeferredLoadTask;
|
||||
import '../elements/entities.dart';
|
||||
import '../enqueue.dart';
|
||||
|
@ -134,7 +134,7 @@ class KernelFrontendStrategy
|
|||
}
|
||||
|
||||
ResolutionEnqueuer createResolutionEnqueuer(
|
||||
CompilerTask task, Compiler compiler) {
|
||||
CompilerTask task, CompilerKernelStrategyFacade compiler) {
|
||||
RuntimeTypesNeedBuilder rtiNeedBuilder = _createRuntimeTypesNeedBuilder();
|
||||
BackendImpacts impacts = BackendImpacts(commonElements, compiler.options);
|
||||
final nativeBasicData = _elementMap.nativeBasicData;
|
||||
|
@ -260,7 +260,8 @@ class KernelFrontendStrategy
|
|||
KernelToElementMap get elementMap => _elementMap;
|
||||
|
||||
/// Creates a [DeferredLoadTask] for the element model used in this strategy.
|
||||
DeferredLoadTask createDeferredLoadTask(Compiler compiler) =>
|
||||
DeferredLoadTask createDeferredLoadTask(
|
||||
CompilerDeferredLoadingFacade compiler) =>
|
||||
DeferredLoadTask(compiler, _elementMap);
|
||||
|
||||
/// Computes the main function from [mainLibrary] adding additional world
|
||||
|
|
Loading…
Reference in a new issue