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

Unified Diff: pkg/compiler/lib/src/js_backend/backend.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/js_backend/backend.dart
diff --git a/pkg/compiler/lib/src/js_backend/backend.dart b/pkg/compiler/lib/src/js_backend/backend.dart
index 3c29d53801701a35b290d5757e094517f2039ae5..1c4df41cc3329ef7b377ff679a46f6fab1a8c5c2 100644
--- a/pkg/compiler/lib/src/js_backend/backend.dart
+++ b/pkg/compiler/lib/src/js_backend/backend.dart
@@ -511,6 +511,8 @@ class JavaScriptBackend extends Backend {
final BackendHelpers helpers;
final BackendImpacts impacts;
+ final JSFrontendAccess frontend;
+
JavaScriptBackend(Compiler compiler,
{bool generateSourceMap: true,
bool useStartupEmitter: false,
@@ -529,6 +531,7 @@ class JavaScriptBackend extends Backend {
: const JavaScriptSourceInformationStrategy(),
helpers = new BackendHelpers(compiler),
impacts = new BackendImpacts(compiler),
+ frontend = new JSFrontendAccess(compiler),
super(compiler) {
emitter = new CodeEmitterTask(
compiler, namer, generateSourceMap, useStartupEmitter);
@@ -2475,6 +2478,32 @@ class JavaScriptBackend extends Backend {
}
}
+class JSFrontendAccess implements Frontend {
+ final Compiler compiler;
+
+ JSFrontendAccess(this.compiler);
+
+ Resolution get resolution => compiler.resolution;
+
+ @override
+ ResolutionImpact getResolutionImpact(Element element) {
+ return resolution.getResolutionImpact(element);
+ }
+
+ @override
+ ResolvedAst getResolvedAst(Element element) {
+ if (element is SynthesizedCallMethodElementX) {
+ return element.resolvedAst;
+ } else if (element is ConstructorBodyElementX) {
+ return element.resolvedAst;
+ } else {
+ assert(invariant(element, resolution.hasResolvedAst(element.declaration),
+ message: 'No ResolvedAst for $element'));
+ return resolution.getResolvedAst(element.declaration);
+ }
+ }
+}
+
/// Handling of special annotations for tests.
class Annotations {
static final Uri PACKAGE_EXPECT =

Powered by Google App Engine
This is Rietveld 408576698