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

Unified Diff: pkg/compiler/lib/src/common/codegen.dart

Issue 1892093003: Support deserialized compilation of the empty program. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments Created 4 years, 8 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/common/codegen.dart
diff --git a/pkg/compiler/lib/src/common/codegen.dart b/pkg/compiler/lib/src/common/codegen.dart
index 62b4bb02087b715aa4b4da6bfbd70a841153a18f..4640bdb4902275f5ce91b9b9f10b2f97e1c78f1c 100644
--- a/pkg/compiler/lib/src/common/codegen.dart
+++ b/pkg/compiler/lib/src/common/codegen.dart
@@ -4,6 +4,7 @@
library dart2js.common.codegen;
+import '../closure.dart' show SynthesizedCallMethodElementX;
import '../common.dart';
import '../compiler.dart' show Compiler;
import '../constants/values.dart' show ConstantValue;
@@ -225,6 +226,7 @@ class CodegenRegistry extends Registry {
/// [WorkItem] used exclusively by the [CodegenEnqueuer].
class CodegenWorkItem extends WorkItem {
CodegenRegistry registry;
+ final ResolvedAst resolvedAst;
factory CodegenWorkItem(Compiler compiler, AstElement element,
ItemCompilationContext compilationContext) {
@@ -235,16 +237,14 @@ class CodegenWorkItem extends WorkItem {
assert(invariant(
element, compiler.enqueuer.resolution.hasBeenProcessed(element),
message: "$element has not been resolved."));
- assert(invariant(element, element.hasResolvedAst,
- message: 'Resolution tree is null for $element in codegen work item'));
- return new CodegenWorkItem.internal(element, compilationContext);
+ ResolvedAst resolvedAst = compiler.backend.frontend.getResolvedAst(element);
+ return new CodegenWorkItem.internal(resolvedAst, compilationContext);
}
CodegenWorkItem.internal(
- AstElement element, ItemCompilationContext compilationContext)
- : super(element, compilationContext);
-
- ResolvedAst get resolvedAst => element.resolvedAst;
+ ResolvedAst resolvedAst, ItemCompilationContext compilationContext)
+ : this.resolvedAst = resolvedAst,
+ super(resolvedAst.element, compilationContext);
WorldImpact run(Compiler compiler, CodegenEnqueuer world) {
if (world.isProcessed(element)) return const WorldImpact();

Powered by Google App Engine
This is Rietveld 408576698