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

Unified Diff: pkg/compiler/lib/src/js_backend/constant_handler_javascript.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_handler_javascript.dart
diff --git a/pkg/compiler/lib/src/js_backend/constant_handler_javascript.dart b/pkg/compiler/lib/src/js_backend/constant_handler_javascript.dart
index 953a30c5ea31e9a0f9067c6057df26a90226b2c5..284146755742d255563266ccbac642cedc7e08db 100644
--- a/pkg/compiler/lib/src/js_backend/constant_handler_javascript.dart
+++ b/pkg/compiler/lib/src/js_backend/constant_handler_javascript.dart
@@ -8,6 +8,7 @@ import '../constants/constant_system.dart';
import '../constants/expressions.dart';
import '../constants/values.dart';
import '../elements/elements.dart';
+import '../elements/entities.dart';
import '../elements/visitor.dart' show BaseElementVisitor;
import '../resolution/tree_elements.dart' show TreeElements;
import '../tree/tree.dart';
@@ -115,7 +116,7 @@ class JavaScriptConstantCompiler extends ConstantCompilerBase
implements BackendConstantEnvironment {
// TODO(johnniwinther): Move this to the backend constant handler.
/** Caches the statics where the initial value cannot be eagerly compiled. */
- final Set<FieldElement> lazyStatics = new Set<FieldElement>();
+ final Set<FieldEntity> lazyStatics = new Set<FieldEntity>();
// Constants computed for constant expressions.
final Map<Node, ConstantExpression> nodeConstantMap =
@@ -140,18 +141,19 @@ class JavaScriptConstantCompiler extends ConstantCompilerBase
element, definitions,
isConst: isConst, checkType: checkType);
if (!isConst && value == null) {
- registerLazyStatic(element);
+ FieldElement field = element;
+ registerLazyStatic(field);
}
return value;
}
@override
- void registerLazyStatic(FieldElement element) {
+ void registerLazyStatic(FieldEntity element) {
lazyStatics.add(element);
}
- List<FieldElement> getLazilyInitializedFieldsForEmission() {
- return new List<FieldElement>.from(lazyStatics);
+ List<FieldEntity> getLazilyInitializedFieldsForEmission() {
+ return new List<FieldEntity>.from(lazyStatics);
}
ConstantExpression compileNode(Node node, TreeElements elements,

Powered by Google App Engine
This is Rietveld 408576698