| Index: pkg/compiler/lib/src/js_backend/backend_usage.dart
|
| diff --git a/pkg/compiler/lib/src/js_backend/backend_usage.dart b/pkg/compiler/lib/src/js_backend/backend_usage.dart
|
| index 869833e43e4f3eea378c9840ba8ff1e6f34d853e..0f1a3f3a51b92e8d5094a381a6ef8e3750b4715d 100644
|
| --- a/pkg/compiler/lib/src/js_backend/backend_usage.dart
|
| +++ b/pkg/compiler/lib/src/js_backend/backend_usage.dart
|
| @@ -8,7 +8,6 @@ import '../elements/elements.dart' show Element;
|
| import '../elements/entities.dart';
|
| import '../elements/types.dart';
|
| import '../util/util.dart' show Setlet;
|
| -import 'backend_helpers.dart';
|
| import 'backend_impact.dart';
|
|
|
| abstract class BackendUsage {
|
| @@ -29,7 +28,7 @@ abstract class BackendUsage {
|
| /// `true` if a core-library function requires the preamble file to function.
|
| bool get requiresPreamble;
|
|
|
| - /// `true` if [BackendHelpers.invokeOnMethod] is used.
|
| + /// `true` if [CommonElements.invokeOnMethod] is used.
|
| bool get isInvokeOnUsed;
|
|
|
| /// `true` of `Object.runtimeType` is used.
|
| @@ -88,7 +87,6 @@ abstract class BackendUsageBuilder {
|
|
|
| class BackendUsageBuilderImpl implements BackendUsageBuilder {
|
| final CommonElements _commonElements;
|
| - final BackendHelpers _helpers;
|
| // TODO(johnniwinther): Remove the need for these.
|
| Setlet<FunctionEntity> _globalFunctionDependencies;
|
| Setlet<ClassEntity> _globalClassDependencies;
|
| @@ -105,7 +103,7 @@ class BackendUsageBuilderImpl implements BackendUsageBuilder {
|
| /// `true` if a core-library function requires the preamble file to function.
|
| bool requiresPreamble = false;
|
|
|
| - /// `true` if [BackendHelpers.invokeOnMethod] is used.
|
| + /// `true` if [CommonElements.invokeOnMethod] is used.
|
| bool isInvokeOnUsed = false;
|
|
|
| /// `true` of `Object.runtimeType` is used.
|
| @@ -120,7 +118,7 @@ class BackendUsageBuilderImpl implements BackendUsageBuilder {
|
| /// `true` if `noSuchMethod` is used.
|
| bool isNoSuchMethodUsed = false;
|
|
|
| - BackendUsageBuilderImpl(this._commonElements, this._helpers);
|
| + BackendUsageBuilderImpl(this._commonElements);
|
|
|
| @override
|
| void registerBackendFunctionUse(FunctionEntity element) {
|
| @@ -147,9 +145,9 @@ class BackendUsageBuilderImpl implements BackendUsageBuilder {
|
| (element.library.isPlatformLibrary &&
|
| element.sourcePosition.uri.path
|
| .contains('_internal/js_runtime/lib/')) ||
|
| - element.library == _helpers.jsHelperLibrary ||
|
| - element.library == _helpers.interceptorsLibrary ||
|
| - element.library == _helpers.isolateHelperLibrary) {
|
| + element.library == _commonElements.jsHelperLibrary ||
|
| + element.library == _commonElements.interceptorsLibrary ||
|
| + element.library == _commonElements.isolateHelperLibrary) {
|
| // TODO(johnniwinther): We should be more precise about these.
|
| return true;
|
| } else {
|
| @@ -162,25 +160,25 @@ class BackendUsageBuilderImpl implements BackendUsageBuilder {
|
|
|
| bool _isValidEntity(Entity element) {
|
| if (element is ConstructorEntity &&
|
| - (element == _helpers.streamIteratorConstructor ||
|
| + (element == _commonElements.streamIteratorConstructor ||
|
| _commonElements.isSymbolConstructor(element) ||
|
| - _helpers.isSymbolValidatedConstructor(element) ||
|
| - element == _helpers.syncCompleterConstructor)) {
|
| + _commonElements.isSymbolValidatedConstructor(element) ||
|
| + element == _commonElements.syncCompleterConstructor)) {
|
| // TODO(johnniwinther): These are valid but we could be more precise.
|
| return true;
|
| } else if (element == _commonElements.symbolClass ||
|
| - element == _helpers.objectNoSuchMethod) {
|
| + element == _commonElements.objectNoSuchMethod) {
|
| // TODO(johnniwinther): These are valid but we could be more precise.
|
| return true;
|
| } else if (element == _commonElements.listClass ||
|
| - element == _helpers.mapLiteralClass ||
|
| + element == _commonElements.mapLiteralClass ||
|
| element == _commonElements.functionClass ||
|
| element == _commonElements.stringClass) {
|
| // TODO(johnniwinther): Avoid these.
|
| return true;
|
| - } else if (element == _helpers.genericNoSuchMethod ||
|
| - element == _helpers.unresolvedConstructorError ||
|
| - element == _helpers.malformedTypeError) {
|
| + } else if (element == _commonElements.genericNoSuchMethod ||
|
| + element == _commonElements.unresolvedConstructorError ||
|
| + element == _commonElements.malformedTypeError) {
|
| return true;
|
| }
|
| return false;
|
| @@ -235,11 +233,11 @@ class BackendUsageBuilderImpl implements BackendUsageBuilder {
|
| }
|
|
|
| void registerUsedMember(MemberEntity member) {
|
| - if (member == _helpers.getIsolateAffinityTagMarker) {
|
| + if (member == _commonElements.getIsolateAffinityTagMarker) {
|
| _needToInitializeIsolateAffinityTag = true;
|
| - } else if (member == _helpers.requiresPreambleMarker) {
|
| + } else if (member == _commonElements.requiresPreambleMarker) {
|
| requiresPreamble = true;
|
| - } else if (member == _helpers.invokeOnMethod) {
|
| + } else if (member == _commonElements.invokeOnMethod) {
|
| isInvokeOnUsed = true;
|
| } else if (_commonElements.isFunctionApplyMethod(member)) {
|
| isFunctionApplyUsed = true;
|
| @@ -296,7 +294,7 @@ class BackendUsageImpl implements BackendUsage {
|
| /// `true` if a core-library function requires the preamble file to function.
|
| final bool requiresPreamble;
|
|
|
| - /// `true` if [BackendHelpers.invokeOnMethod] is used.
|
| + /// `true` if [CommonElements.invokeOnMethod] is used.
|
| final bool isInvokeOnUsed;
|
|
|
| /// `true` of `Object.runtimeType` is used.
|
|
|