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

Unified Diff: pkg/compiler/lib/src/common/codegen.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
« no previous file with comments | « pkg/compiler/lib/src/backend_strategy.dart ('k') | pkg/compiler/lib/src/compiler.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/common/codegen.dart
diff --git a/pkg/compiler/lib/src/common/codegen.dart b/pkg/compiler/lib/src/common/codegen.dart
index 478085c7de66dbe75fb9e0f8d2b9f83f8bebd316..6f22d66136c224fa67a15470776e3bde3c5c458b 100644
--- a/pkg/compiler/lib/src/common/codegen.dart
+++ b/pkg/compiler/lib/src/common/codegen.dart
@@ -4,23 +4,15 @@
library dart2js.common.codegen;
-import '../common.dart';
import '../elements/elements.dart'
- show
- AsyncMarker,
- ClassElement,
- LocalFunctionElement,
- MemberElement,
- ResolvedAst;
+ show AsyncMarker, ClassElement, LocalFunctionElement, MemberElement;
import '../elements/entities.dart';
import '../elements/types.dart' show DartType, InterfaceType;
-import '../js_backend/backend.dart' show JavaScriptBackend;
import '../universe/use.dart' show ConstantUse, DynamicUse, StaticUse, TypeUse;
import '../universe/world_impact.dart'
show WorldImpact, WorldImpactBuilderImpl, WorldImpactVisitor;
import '../util/enumset.dart';
import '../util/util.dart' show Pair, Setlet;
-import '../world.dart' show ClosedWorld;
import 'work.dart' show WorkItem;
class CodegenImpact extends WorldImpact {
@@ -181,32 +173,6 @@ class CodegenRegistry {
}
/// [WorkItem] used exclusively by the [CodegenEnqueuer].
-class CodegenWorkItem extends WorkItem {
- CodegenRegistry registry;
- final ResolvedAst resolvedAst;
- final JavaScriptBackend _backend;
- final ClosedWorld _closedWorld;
-
- factory CodegenWorkItem(JavaScriptBackend backend, ClosedWorld closedWorld,
- MemberElement element) {
- // If this assertion fails, the resolution callbacks of the backend may be
- // missing call of form registry.registerXXX. Alternatively, the code
- // generation could spuriously be adding dependencies on things we know we
- // don't need.
- assert(invariant(element, element.hasResolvedAst,
- message: "$element has no resolved ast."));
- ResolvedAst resolvedAst = element.resolvedAst;
- return new CodegenWorkItem.internal(resolvedAst, backend, closedWorld);
- }
-
- CodegenWorkItem.internal(this.resolvedAst, this._backend, this._closedWorld);
-
- MemberElement get element => resolvedAst.element;
-
- WorldImpact run() {
- registry = new CodegenRegistry(element);
- return _backend.codegen(this, _closedWorld);
- }
-
- String toString() => 'CodegenWorkItem(${resolvedAst.element})';
+abstract class CodegenWorkItem extends WorkItem {
+ CodegenRegistry get registry;
}
« no previous file with comments | « pkg/compiler/lib/src/backend_strategy.dart ('k') | pkg/compiler/lib/src/compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698