| Index: pkg/compiler/lib/src/js_backend/backend_impact.dart
|
| diff --git a/pkg/compiler/lib/src/js_backend/backend_impact.dart b/pkg/compiler/lib/src/js_backend/backend_impact.dart
|
| index 3ab0227a795e776694fed5d266e48663cb7d470a..e933ae5f1d3d027ec5f9e62abbe92c9e7308bdbb 100644
|
| --- a/pkg/compiler/lib/src/js_backend/backend_impact.dart
|
| +++ b/pkg/compiler/lib/src/js_backend/backend_impact.dart
|
| @@ -10,10 +10,17 @@ import '../core_types.dart' show CommonElements;
|
| import '../dart_types.dart' show InterfaceType;
|
| import '../elements/elements.dart' show ClassElement, Element;
|
| import '../universe/selector.dart';
|
| +import '../util/enumset.dart';
|
| import 'backend_helpers.dart';
|
| import 'constant_system_javascript.dart';
|
| import 'js_backend.dart';
|
|
|
| +/// Backend specific features required by a backend impact.
|
| +enum BackendFeature {
|
| + needToInitializeIsolateAffinityTag,
|
| + needToInitializeDispatchProperty,
|
| +}
|
| +
|
| /// A set of JavaScript backend dependencies.
|
| class BackendImpact {
|
| final List<Element> staticUses;
|
| @@ -21,13 +28,19 @@ class BackendImpact {
|
| final List<InterfaceType> instantiatedTypes;
|
| final List<ClassElement> instantiatedClasses;
|
| final List<BackendImpact> otherImpacts;
|
| + final EnumSet<BackendFeature> _features;
|
|
|
| - BackendImpact(
|
| + const BackendImpact(
|
| {this.staticUses: const <Element>[],
|
| this.dynamicUses: const <Selector>[],
|
| this.instantiatedTypes: const <InterfaceType>[],
|
| this.instantiatedClasses: const <ClassElement>[],
|
| - this.otherImpacts: const <BackendImpact>[]});
|
| + this.otherImpacts: const <BackendImpact>[],
|
| + EnumSet<BackendFeature> features: const EnumSet<BackendFeature>.fixed(0)})
|
| + : this._features = features;
|
| +
|
| + Iterable<BackendFeature> get features =>
|
| + _features.iterable(BackendFeature.values);
|
| }
|
|
|
| /// The JavaScript backend dependencies for various features.
|
| @@ -598,4 +611,25 @@ class BackendImpacts {
|
| }
|
| return _closure;
|
| }
|
| +
|
| + BackendImpact _interceptorUse;
|
| +
|
| + BackendImpact get interceptorUse {
|
| + if (_interceptorUse == null) {
|
| + _interceptorUse = new BackendImpact(
|
| + staticUses: [
|
| + helpers.getNativeInterceptorMethod
|
| + ],
|
| + instantiatedClasses: [
|
| + helpers.jsJavaScriptObjectClass,
|
| + helpers.jsPlainJavaScriptObjectClass,
|
| + helpers.jsJavaScriptFunctionClass
|
| + ],
|
| + features: new EnumSet<BackendFeature>.fromValues([
|
| + BackendFeature.needToInitializeDispatchProperty,
|
| + BackendFeature.needToInitializeIsolateAffinityTag
|
| + ], fixed: true));
|
| + }
|
| + return _interceptorUse;
|
| + }
|
| }
|
|
|