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

Unified Diff: pkg/compiler/lib/src/js_emitter/lazy_emitter/emitter.dart

Issue 2568723007: Create Namer and Emitter on codegen start. (Closed)
Patch Set: Small fix. Created 4 years 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_emitter/lazy_emitter/emitter.dart
diff --git a/pkg/compiler/lib/src/js_emitter/lazy_emitter/emitter.dart b/pkg/compiler/lib/src/js_emitter/lazy_emitter/emitter.dart
index 64e1f79bd1396f5c875b369eb706a94327832696..3714a08898a02b8424b3a29bc66ee703cf988987 100644
--- a/pkg/compiler/lib/src/js_emitter/lazy_emitter/emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/lazy_emitter/emitter.dart
@@ -13,12 +13,27 @@ import '../../elements/elements.dart'
show ClassElement, Element, FieldElement, FunctionElement;
import '../../js/js.dart' as js;
import '../../js_backend/js_backend.dart' show JavaScriptBackend, Namer;
-import '../js_emitter.dart' show NativeEmitter;
-import '../js_emitter.dart' as emitterTask show Emitter;
+import '../../world.dart' show ClosedWorld;
+import '../js_emitter.dart' show CodeEmitterTask, NativeEmitter;
+import '../js_emitter.dart' as emitterTask show Emitter, EmitterFactory;
import '../model.dart';
import '../program_builder/program_builder.dart' show ProgramBuilder;
import 'model_emitter.dart';
+class EmitterFactory implements emitterTask.EmitterFactory {
+ @override
+ String get patchVersion => "lazy";
+
+ @override
+ bool get supportsReflection => false;
+
+ @override
+ Emitter createEmitter(
+ CodeEmitterTask task, Namer namer, ClosedWorld closedWorld) {
+ return new Emitter(task.compiler, namer, task.nativeEmitter);
+ }
+}
+
class Emitter implements emitterTask.Emitter {
final Compiler _compiler;
final Namer namer;
@@ -34,17 +49,11 @@ class Emitter implements emitterTask.Emitter {
DiagnosticReporter get reporter => _compiler.reporter;
@override
- String get patchVersion => "lazy";
-
- @override
int emitProgram(ProgramBuilder programBuilder) {
Program program = programBuilder.buildProgram();
return _emitter.emitProgram(program);
}
- @override
- bool get supportsReflection => false;
-
// TODO(floitsch): copied from full emitter. Adjust or share.
@override
bool isConstantInlinedOrAlreadyEmitted(ConstantValue constant) {
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/js_emitter.dart ('k') | pkg/compiler/lib/src/js_emitter/parameter_stub_generator.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698