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

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: 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..e3e45079553457bb6c3b9b3113c7a548cb572e9f 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;
+ JSFrontendAccess _frontend;
+
JavaScriptBackend(Compiler compiler,
{bool generateSourceMap: true,
bool useStartupEmitter: false,
@@ -545,6 +547,7 @@ class JavaScriptBackend extends Backend {
? new CpsFunctionCompiler(compiler, this, sourceInformationStrategy)
: new SsaFunctionCompiler(this, sourceInformationStrategy);
serialization = new JavaScriptBackendSerialization(this);
+ _frontend = new JSFrontendAccess(compiler);
Siggi Cherem (dart-lang) 2016/04/15 15:42:14 seems it should be possible to make this an initia
Johnni Winther 2016/04/18 08:05:43 Done.
}
ConstantSystem get constantSystem => constants.constantSystem;
@@ -2473,6 +2476,35 @@ class JavaScriptBackend extends Backend {
supportDumpInfo: supportDumpInfo,
supportSerialization: supportSerialization);
}
+
+ @override
+ Frontend get frontend => _frontend;
+}
+
+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.

Powered by Google App Engine
This is Rietveld 408576698