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

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

Issue 2349163003: Move towards using WorldImpact for codegen (Closed)
Patch Set: Reinsert missing features uses. Created 4 years, 3 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
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;
+ }
}
« no previous file with comments | « pkg/compiler/lib/src/js_backend/backend.dart ('k') | pkg/compiler/lib/src/js_backend/custom_elements_analysis.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698