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

Unified Diff: pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart

Issue 1229913002: dart2js: add FragmentEmitter for startup-emitter. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address comment. Created 5 years, 5 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 | « no previous file | pkg/compiler/lib/src/js_emitter/startup_emitter/model_emitter.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart
diff --git a/pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart b/pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart
new file mode 100644
index 0000000000000000000000000000000000000000..2e271d0b2a5d33e006e8e9aa21a7c29479a91d69
--- /dev/null
+++ b/pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart
@@ -0,0 +1,41 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+part of dart2js.js_emitter.startup_emitter.model_emitter;
+
+/**
+ * This class builds a JavaScript tree for a given fragment.
+ *
+ * A fragment is generally written into a separate file so that it can be
+ * loaded dynamically when a deferred library is loaded.
+ *
+ * This class is stateless and can be reused for different fragments.
+ */
+class FragmentEmitter {
+ final Compiler compiler;
+ final Namer namer;
+ final JavaScriptBackend backend;
+ final ConstantEmitter constantEmitter;
+ final ModelEmitter modelEmitter;
+
+ FragmentEmitter(this.compiler, this.namer, this.backend, this.constantEmitter,
+ this.modelEmitter);
+
+ js.Expression generateEmbeddedGlobalAccess(String global) =>
+ modelEmitter.generateEmbeddedGlobalAccess(global);
+
+ js.Expression generateConstantReference(ConstantValue value) =>
+ modelEmitter.generateConstantReference(value);
+
+ js.Statement emitMainFragment(Program program) {
+ MainFragment fragment = program.fragments.first;
+ throw new UnimplementedError('emitMain');
+ }
+
+ js.Statement emitDeferredFragment(DeferredFragment fragment,
+ js.Expression deferredTypes,
+ List<Holder> holders) {
+ throw new UnimplementedError('emitDeferred');
+ }
+}
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_emitter/startup_emitter/model_emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698