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

Unified Diff: pkg/compiler/lib/src/js_backend/constant_emitter.dart

Issue 2939033002: Towards compiling Hello World! (Closed)
Patch Set: Fix parameter ordering Created 3 years, 6 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/constant_emitter.dart
diff --git a/pkg/compiler/lib/src/js_backend/constant_emitter.dart b/pkg/compiler/lib/src/js_backend/constant_emitter.dart
index 7296ce5fa31485805663a8970bab65c1900a7e91..08376c88790cd70b57f4e0c3b0998e1f49fd448a 100644
--- a/pkg/compiler/lib/src/js_backend/constant_emitter.dart
+++ b/pkg/compiler/lib/src/js_backend/constant_emitter.dart
@@ -5,13 +5,15 @@
import '../common.dart';
import '../common_elements.dart';
import '../constants/values.dart';
-import '../elements/resolution_types.dart';
import '../elements/elements.dart';
+import '../elements/entities.dart';
+import '../elements/resolution_types.dart';
import '../io/code_output.dart';
import '../js/js.dart' as jsAst;
import '../js/js.dart' show js;
import '../js_emitter/code_emitter_task.dart';
import '../options.dart';
+import '../universe/world_builder.dart';
import 'constant_system_javascript.dart';
import 'js_backend.dart';
import 'namer.dart';
@@ -36,6 +38,7 @@ class ConstantEmitter implements ConstantValueVisitor<jsAst.Expression, Null> {
final CompilerOptions _options;
final CommonElements _commonElements;
+ final CodegenWorldBuilder _worldBuilder;
final RuntimeTypesNeed _rtiNeed;
final RuntimeTypesEncoder _rtiEncoder;
final Namer _namer;
@@ -51,6 +54,7 @@ class ConstantEmitter implements ConstantValueVisitor<jsAst.Expression, Null> {
ConstantEmitter(
this._options,
this._commonElements,
+ this._worldBuilder,
this._rtiNeed,
this._rtiEncoder,
this._namer,
@@ -283,7 +287,7 @@ class ConstantEmitter implements ConstantValueVisitor<jsAst.Expression, Null> {
@override
jsAst.Expression visitInterceptor(InterceptorConstantValue constant, [_]) {
- ClassElement interceptorClass = constant.cls;
+ ClassEntity interceptorClass = constant.cls;
return _task.interceptorPrototypeAccess(interceptorClass);
}
@@ -304,7 +308,7 @@ class ConstantEmitter implements ConstantValueVisitor<jsAst.Expression, Null> {
@override
jsAst.Expression visitConstructed(ConstructedConstantValue constant, [_]) {
- ClassElement element = constant.type.element;
+ ClassEntity element = constant.type.element;
if (element == _commonElements.jsConstClass) {
StringConstantValue str = constant.fields.values.single;
String value = str.primitiveValue;
@@ -313,9 +317,9 @@ class ConstantEmitter implements ConstantValueVisitor<jsAst.Expression, Null> {
jsAst.Expression constructor =
_emitter.constructorAccess(constant.type.element);
List<jsAst.Expression> fields = <jsAst.Expression>[];
- element.forEachInstanceField((_, FieldElement field) {
+ _worldBuilder.forEachInstanceField(element, (_, FieldEntity field) {
fields.add(constantReferenceGenerator(constant.fields[field]));
- }, includeSuperAndInjectedMembers: true);
+ });
if (_rtiNeed.classNeedsRtiField(constant.type.element)) {
fields.add(_reifiedTypeArguments(constant.type));
}

Powered by Google App Engine
This is Rietveld 408576698