Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Unified Diff: pkg/compiler/lib/src/js_backend/backend_usage.dart

Issue 2693163002: Split backend implementation of EnqueuerListener (Closed)
Patch Set: Updated cf. comments Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/js_backend/backend.dart ('k') | pkg/compiler/lib/src/js_backend/enqueuer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..f1d25c3682d2b3dcc0ea8609e878a94c7d77b3df 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 [BackendHelpers.invokeOnMethod] is used.
+ bool get isInvokeOnUsed;
+
+ /// `true` of `Object.runtimeType` is used.
+ bool get isRuntimeTypeUsed;
+
+ /// `true` if the `dart:isolate` library is in use.
+ bool get isIsolateInUse;
+
+ /// `true` if `Function.apply` is used.
+ bool get isFunctionApplyUsed;
}
abstract class BackendUsageBuilder {
@@ -35,6 +50,15 @@ abstract class BackendUsageBuilder {
{bool isGlobal: false});
WorldImpact createImpactFor(BackendImpact impact);
void registerUsedMember(MemberElement member);
+
+ /// `true` of `Object.runtimeType` is used.
+ bool isRuntimeTypeUsed;
+
+ /// `true` if the `dart:isolate` library is in use.
+ bool isIsolateInUse;
+
+ /// `true` if `Function.apply` is used.
+ bool isFunctionApplyUsed;
}
class BackendUsageImpl implements BackendUsage, BackendUsageBuilder {
@@ -50,6 +74,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 [BackendHelpers.invokeOnMethod] is used.
+ bool isInvokeOnUsed = false;
+
+ /// `true` of `Object.runtimeType` is used.
+ bool isRuntimeTypeUsed = false;
+
+ /// `true` if the `dart:isolate` library is in use.
+ bool isIsolateInUse = false;
+
+ /// `true` if `Function.apply` is used.
+ bool isFunctionApplyUsed = false;
+
BackendUsageImpl(this._commonElements, this._helpers, this._resolution);
bool get needToInitializeIsolateAffinityTag =>
@@ -196,6 +235,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) {
+ isInvokeOnUsed = true;
+ } else if (_commonElements.isFunctionApplyMethod(member)) {
+ isFunctionApplyUsed = true;
}
}
« no previous file with comments | « pkg/compiler/lib/src/js_backend/backend.dart ('k') | pkg/compiler/lib/src/js_backend/enqueuer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698