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

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

Issue 2873633002: Pass data objects to ConstantEmitter (Closed)
Patch Set: Created 3 years, 7 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_emitter/lazy_emitter/model_emitter.dart
diff --git a/pkg/compiler/lib/src/js_emitter/lazy_emitter/model_emitter.dart b/pkg/compiler/lib/src/js_emitter/lazy_emitter/model_emitter.dart
index 94fccf2244245ac53c77a4cc689a11e787c1cf4a..3c644a638f09da7e420e395dec6f7a316735eba4 100644
--- a/pkg/compiler/lib/src/js_emitter/lazy_emitter/model_emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/lazy_emitter/model_emitter.dart
@@ -29,7 +29,9 @@ import '../../js/js.dart' as js;
import '../../js_backend/js_backend.dart'
show JavaScriptBackend, Namer, ConstantEmitter;
import '../../js_backend/interceptor_data.dart';
+import '../../world.dart';
import '../constant_ordering.dart' show deepCompareConstants;
+import '../code_emitter_task.dart';
import '../js_emitter.dart' show NativeEmitter;
import '../js_emitter.dart' show NativeGenerator, buildTearOffCode;
import '../model.dart';
@@ -39,7 +41,7 @@ class ModelEmitter {
final Namer namer;
ConstantEmitter constantEmitter;
final NativeEmitter nativeEmitter;
- final InterceptorData _interceptorData;
+ final ClosedWorld _closedWorld;
JavaScriptBackend get backend => compiler.backend;
@@ -51,12 +53,21 @@ class ModelEmitter {
static const String typeNameProperty = r"builtin$cls";
- ModelEmitter(
- this.compiler, this.namer, this.nativeEmitter, this._interceptorData) {
+ ModelEmitter(this.compiler, this.namer, this.nativeEmitter, this._closedWorld,
+ CodeEmitterTask task) {
this.constantEmitter = new ConstantEmitter(
- compiler, namer, this.generateConstantReference, constantListGenerator);
+ compiler.options,
+ _closedWorld.commonElements,
+ compiler.backend.rtiNeed,
+ compiler.backend.rtiEncoder,
+ namer,
+ task,
+ this.generateConstantReference,
+ constantListGenerator);
}
+ InterceptorData get _interceptorData => _closedWorld.interceptorData;
+
js.Expression constantListGenerator(js.Expression array) {
// TODO(floitsch): remove hard-coded name.
return js.js('makeConstList(#)', [array]);

Powered by Google App Engine
This is Rietveld 408576698