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

Unified Diff: sdk/lib/_internal/compiler/implementation/js_emitter/metadata_emitter.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/metadata_emitter.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/metadata_emitter.dart b/sdk/lib/_internal/compiler/implementation/js_emitter/metadata_emitter.dart
index 394ee95d1454aba10d058bd4418e8cb24109e4c1..b57a8e231e12b1f6635f34da68c0632de30529a9 100644
--- a/sdk/lib/_internal/compiler/implementation/js_emitter/metadata_emitter.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_emitter/metadata_emitter.dart
@@ -27,7 +27,8 @@ class MetadataEmitter extends CodeEmitterHelper {
if (link != null) {
for (; !link.isEmpty; link = link.tail) {
MetadataAnnotation annotation = link.head;
- Constant value = annotation.value;
+ Constant value =
+ backend.constants.getConstantForMetadata(annotation);
if (value == null) {
compiler.internalError(annotation, 'Annotation value is null.');
} else {
@@ -46,8 +47,7 @@ class MetadataEmitter extends CodeEmitterHelper {
if (signature.optionalParameterCount == 0) return const [];
List<int> defaultValues = <int>[];
for (Element element in signature.optionalParameters) {
- Constant value =
- compiler.constantHandler.initialVariableValues[element];
+ Constant value = backend.constants.getConstantForVariable(element);
String stringRepresentation = (value == null)
? "null"
: jsAst.prettyPrint(task.constantReference(value), compiler)
@@ -58,7 +58,7 @@ class MetadataEmitter extends CodeEmitterHelper {
}
int reifyMetadata(MetadataAnnotation annotation) {
- Constant value = annotation.value;
+ Constant value = backend.constants.getConstantForMetadata(annotation);
if (value == null) {
compiler.internalError(annotation, 'Annotation value is null.');
return -1;

Powered by Google App Engine
This is Rietveld 408576698