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

Unified Diff: sdk/lib/_internal/compiler/implementation/js_emitter/container_builder.dart

Issue 221873002: Compute frontend/backend specific constants. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes Created 6 years, 8 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: sdk/lib/_internal/compiler/implementation/js_emitter/container_builder.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/container_builder.dart b/sdk/lib/_internal/compiler/implementation/js_emitter/container_builder.dart
index eeb19bef119e6fa8d1ae14461570a71f2fc863ea..f48b741241a12d7781163088c6ad5450792a9012 100644
--- a/sdk/lib/_internal/compiler/implementation/js_emitter/container_builder.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_emitter/container_builder.dart
@@ -43,7 +43,7 @@ class ContainerBuilder extends CodeEmitterHelper {
// directly.
return;
}
- ConstantHandler handler = compiler.constantHandler;
+ JavaScriptConstantCompiler handler = backend.constants;
List<String> names = selector.getOrderedNamedArguments();
String invocationName = namer.invocationName(selector);
@@ -99,7 +99,7 @@ class ContainerBuilder extends CodeEmitterHelper {
parametersBuffer[optionalParameterStart + index] =
new jsAst.Parameter(jsName);
} else {
- Constant value = handler.initialVariableValues[element];
+ Constant value = handler.getConstantForVariable(element);
if (value == null) {
argumentsBuffer[count] = task.constantReference(new NullConstant());
} else {
@@ -505,9 +505,11 @@ class ContainerBuilder extends CodeEmitterHelper {
if (backend.mustRetainMetadata) {
List<MetadataAnnotation> annotations = parameter.metadata.toList();
Iterable<int> metadataIndices =
- annotations.map((MetadataAnnotation a) {
- compiler.constantHandler.addCompileTimeConstantForEmission(a.value);
- return task.metadataEmitter.reifyMetadata(a);
+ annotations.map((MetadataAnnotation annotation) {
+ Constant constant =
+ backend.constants.getConstantForMetadata(annotation);
+ backend.constants.addCompileTimeConstantForEmission(constant);
+ return task.metadataEmitter.reifyMetadata(annotation);
});
expressions.add(metadataIndices.isNotEmpty ? metadataIndices.toList()
: js('[]'));

Powered by Google App Engine
This is Rietveld 408576698