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

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

Issue 574683002: Use ConstExp for storing constants. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes and further implementation. Created 6 years, 3 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 c256b0d9d347b911faa5710df69254d494c11cfb..43d3e7b48a1a41c091a602511a1efcad8bc1349f 100644
--- a/sdk/lib/_internal/compiler/implementation/js_emitter/container_builder.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_emitter/container_builder.dart
@@ -96,10 +96,11 @@ class ContainerBuilder extends CodeEmitterHelper {
parametersBuffer[optionalParameterStart + index] =
new jsAst.Parameter(jsName);
} else {
- Constant value = handler.getConstantForVariable(element);
- if (value == null) {
+ ConstExp constant = handler.getConstantForVariable(element);
+ if (constant == null) {
argumentsBuffer[count] = task.constantReference(new NullConstant());
} else {
+ Constant value = constant.value;
if (!value.isNull) {
// If the value is the null constant, we should not pass it
// down to the native method.
@@ -516,7 +517,7 @@ class ContainerBuilder extends CodeEmitterHelper {
Iterable<int> metadataIndices =
parameter.metadata.map((MetadataAnnotation annotation) {
Constant constant =
- backend.constants.getConstantForMetadata(annotation);
+ backend.constants.getConstantForMetadata(annotation).value;
backend.constants.addCompileTimeConstantForEmission(constant);
return task.metadataEmitter.reifyMetadata(annotation);
});

Powered by Google App Engine
This is Rietveld 408576698