diff --git a/pkg/compiler/lib/src/common/backend_api.dart b/pkg/compiler/lib/src/common/backend_api.dart deleted file mode 100644 index 5c3895276e2..00000000000 --- a/pkg/compiler/lib/src/common/backend_api.dart +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -library dart2js.backend_api; - -import '../common/resolution.dart' show ResolutionImpact; -import '../universe/world_impact.dart' show WorldImpact; - -/// Target-specific transformation for resolution world impacts. -/// -/// This processes target-agnostic [ResolutionImpact]s and creates [WorldImpact] -/// in which backend/target specific impact data is added, for example: if -/// certain feature is used that requires some helper code from the backend -/// libraries, this will be included by the impact transformer. -class ImpactTransformer { - /// Transform the [ResolutionImpact] into a [WorldImpact] adding the - /// backend dependencies for features used in [worldImpact]. - WorldImpact transformResolutionImpact(ResolutionImpact worldImpact) { - return worldImpact; - } -} diff --git a/pkg/compiler/lib/src/js_backend/impact_transformer.dart b/pkg/compiler/lib/src/js_backend/impact_transformer.dart index 3a92051e86f..e340b31513f 100644 --- a/pkg/compiler/lib/src/js_backend/impact_transformer.dart +++ b/pkg/compiler/lib/src/js_backend/impact_transformer.dart @@ -8,7 +8,6 @@ import '../universe/class_hierarchy.dart' show ClassHierarchyBuilder; import '../common.dart'; import '../common/elements.dart'; -import '../common/backend_api.dart' show ImpactTransformer; import '../common/codegen.dart' show CodegenImpact; import '../common/resolution.dart' show ResolutionImpact; import '../constants/values.dart'; @@ -34,7 +33,13 @@ import 'native_data.dart'; import 'runtime_types.dart'; import 'runtime_types_resolution.dart'; -class JavaScriptImpactTransformer extends ImpactTransformer { +/// JavaScript specific transformation for resolution world impacts. +/// +/// This processes target-agnostic [ResolutionImpact]s and creates [WorldImpact] +/// in which JavaScript specific impact data is added, for example: if +/// a certain feature is used that requires some helper code from the backend +/// libraries, this will be included by the impact transformer. +class JavaScriptImpactTransformer { final ElementEnvironment _elementEnvironment; final CommonElements _commonElements; final BackendImpacts _impacts; @@ -60,7 +65,8 @@ class JavaScriptImpactTransformer extends ImpactTransformer { DartTypes get _dartTypes => _commonElements.dartTypes; - @override + /// Transform the [ResolutionImpact] into a [WorldImpact] adding the + /// backend dependencies for features used in [worldImpact]. WorldImpact transformResolutionImpact(ResolutionImpact worldImpact) { TransformedWorldImpact transformed = TransformedWorldImpact(worldImpact); diff --git a/pkg/compiler/lib/src/kernel/kernel_strategy.dart b/pkg/compiler/lib/src/kernel/kernel_strategy.dart index dcd7fb24127..ef176a1df9f 100644 --- a/pkg/compiler/lib/src/kernel/kernel_strategy.dart +++ b/pkg/compiler/lib/src/kernel/kernel_strategy.dart @@ -7,7 +7,6 @@ library dart2js.kernel.frontend_strategy; import 'package:kernel/ast.dart' as ir; import '../common.dart'; -import '../common/backend_api.dart'; import '../common/elements.dart'; import '../common/names.dart' show Uris; import '../common/resolution.dart'; @@ -159,7 +158,7 @@ class KernelFrontendStrategy { // before creating the resolution enqueuer. AnnotationsData annotationsData = AnnotationsDataImpl( compiler.options, annotationsDataBuilder.pragmaAnnotations); - ImpactTransformer impactTransformer = JavaScriptImpactTransformer( + final impactTransformer = JavaScriptImpactTransformer( elementEnvironment, commonElements, impacts, @@ -303,7 +302,7 @@ class KernelFrontendStrategy { class KernelWorkItemBuilder implements WorkItemBuilder { final CompilerTask _compilerTask; final KernelToElementMapImpl _elementMap; - final ImpactTransformer _impactTransformer; + final JavaScriptImpactTransformer _impactTransformer; final NativeMemberResolver _nativeMemberResolver; final AnnotationsDataBuilder _annotationsDataBuilder; final Map _closureModels; @@ -347,7 +346,7 @@ class KernelWorkItemBuilder implements WorkItemBuilder { class KernelWorkItem implements WorkItem { final CompilerTask _compilerTask; final KernelToElementMapImpl _elementMap; - final ImpactTransformer _impactTransformer; + final JavaScriptImpactTransformer _impactTransformer; final NativeMemberResolver _nativeMemberResolver; final AnnotationsDataBuilder _annotationsDataBuilder; @override