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

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

Issue 2894893002: Add ElementCodegenWorldBuilder (Closed)
Patch Set: Updated cf. comments. Created 3 years, 7 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/enqueuer.dart
diff --git a/pkg/compiler/lib/src/js_backend/enqueuer.dart b/pkg/compiler/lib/src/js_backend/enqueuer.dart
index 318bb9f55778555c4ab3b1f9d991686d9a1843aa..9d0c36a65ed9ed38c8f008d942e058cc1ba6176c 100644
--- a/pkg/compiler/lib/src/js_backend/enqueuer.dart
+++ b/pkg/compiler/lib/src/js_backend/enqueuer.dart
@@ -6,17 +6,14 @@ library dart2js.js.enqueue;
import 'dart:collection' show Queue;
-import '../common/codegen.dart' show CodegenWorkItem;
import '../common/tasks.dart' show CompilerTask;
import '../common/work.dart' show WorkItem;
import '../common.dart';
import '../common_elements.dart' show ElementEnvironment;
import '../elements/resolution_types.dart'
show ResolutionDartType, ResolutionInterfaceType;
-import '../elements/elements.dart' show MemberElement;
import '../elements/entities.dart';
import '../enqueue.dart';
-import '../js_backend/backend.dart' show JavaScriptBackend;
import '../options.dart';
import '../universe/world_builder.dart';
import '../universe/use.dart'
@@ -31,7 +28,6 @@ import '../universe/world_impact.dart'
show ImpactUseCase, WorldImpact, WorldImpactVisitor;
import '../util/enumset.dart';
import '../util/util.dart' show Setlet;
-import '../world.dart' show ClosedWorld;
/// [Enqueuer] which is specific to code generation.
class CodegenEnqueuer extends EnqueuerImpl {
@@ -268,31 +264,3 @@ class CodegenEnqueuer extends EnqueuerImpl {
@override
Iterable<ClassEntity> get processedClasses => _worldBuilder.processedClasses;
}
-
-/// Builder that creates the work item necessary for the code generation of a
-/// [MemberElement].
-class CodegenWorkItemBuilder extends WorkItemBuilder {
- final JavaScriptBackend _backend;
- final ClosedWorld _closedWorld;
- final CompilerOptions _options;
-
- CodegenWorkItemBuilder(this._backend, this._closedWorld, this._options);
-
- @override
- WorkItem createWorkItem(MemberElement element) {
- assert(invariant(element, element.isDeclaration));
- // Don't generate code for foreign elements.
- if (_backend.isForeign(element)) return null;
- if (element.isAbstract) return null;
-
- // Codegen inlines field initializers. It only needs to generate
- // code for checked setters.
- if (element.isField && element.isInstanceMember) {
- if (!_options.enableTypeAssertions ||
- element.enclosingElement.isClosure) {
- return null;
- }
- }
- return new CodegenWorkItem(_backend, _closedWorld, element);
- }
-}
« no previous file with comments | « pkg/compiler/lib/src/js_backend/element_strategy.dart ('k') | pkg/compiler/lib/src/js_backend/resolution_listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698