Chromium Code Reviews| 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 b99358bd026a5f8f857dc2db517cb1377bf1f123..7cabd5b4e74d0814d8d9fb9a68fd758d3898cd87 100644 |
| --- a/pkg/compiler/lib/src/js_backend/backend_usage.dart |
| +++ b/pkg/compiler/lib/src/js_backend/backend_usage.dart |
| @@ -20,6 +20,21 @@ abstract class BackendUsage { |
| bool get needToInitializeDispatchProperty; |
| bool usedByBackend(Element element); |
| Iterable<Element> get globalDependencies; |
| + |
| + /// True if a core-library function requires the preamble file to function. |
| + bool get requiresPreamble; |
| + |
| + /// `true` if access to [BackendHelpers.invokeOnMethod] is supported. |
| + bool get hasInvokeOnSupport; |
|
Siggi Cherem (dart-lang)
2017/02/17 23:05:08
Let's rename a lot of these properties.
Reading t
Johnni Winther
2017/02/20 11:37:42
Done.
|
| + |
| + /// `true` of `Object.runtimeType` is supported. |
| + bool get hasRuntimeTypeSupport; |
| + |
| + /// `true` of use of the `dart:isolate` library is supported. |
| + bool get hasIsolateSupport; |
| + |
| + /// `true` of `Function.apply` is supported. |
| + bool get hasFunctionApplySupport; |
| } |
| abstract class BackendUsageBuilder { |
| @@ -35,6 +50,14 @@ abstract class BackendUsageBuilder { |
| {bool isGlobal: false}); |
| WorldImpact createImpactFor(BackendImpact impact); |
| void registerUsedMember(MemberElement member); |
| + |
| + bool hasRuntimeTypeSupport; |
| + |
| + /// `true` of use of the `dart:isolate` library is supported. |
| + bool hasIsolateSupport; |
| + |
| + /// `true` of `Function.apply` is supported. |
| + bool hasFunctionApplySupport; |
| } |
| class BackendUsageImpl implements BackendUsage, BackendUsageBuilder { |
| @@ -50,6 +73,21 @@ class BackendUsageImpl implements BackendUsage, BackendUsageBuilder { |
| bool _needToInitializeIsolateAffinityTag = false; |
| bool _needToInitializeDispatchProperty = false; |
| + /// True if a core-library function requires the preamble file to function. |
| + bool requiresPreamble = false; |
| + |
| + /// `true` if access to [BackendHelpers.invokeOnMethod] is supported. |
| + bool hasInvokeOnSupport = false; |
| + |
| + /// `true` of `Object.runtimeType` is supported. |
| + bool hasRuntimeTypeSupport = false; |
| + |
| + /// `true` of use of the `dart:isolate` library is supported. |
| + bool hasIsolateSupport = false; |
| + |
| + /// `true` of `Function.apply` is supported. |
| + bool hasFunctionApplySupport = false; |
| + |
| BackendUsageImpl(this._commonElements, this._helpers, this._resolution); |
| bool get needToInitializeIsolateAffinityTag => |
| @@ -196,6 +234,12 @@ class BackendUsageImpl implements BackendUsage, BackendUsageBuilder { |
| void registerUsedMember(MemberElement member) { |
| if (member == _helpers.getIsolateAffinityTagMarker) { |
| _needToInitializeIsolateAffinityTag = true; |
| + } else if (member == _helpers.requiresPreambleMarker) { |
| + requiresPreamble = true; |
| + } else if (member == _helpers.invokeOnMethod) { |
| + hasInvokeOnSupport = true; |
| + } else if (_commonElements.isFunctionApplyMethod(member)) { |
| + hasFunctionApplySupport = true; |
| } |
| } |