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

Unified Diff: sdk/lib/_internal/compiler/implementation/js_backend/backend.dart

Issue 574683002: Use ConstExp for storing constants. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. 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_backend/backend.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
index 09dcfefb4989809d6673e8a2a371e84e6a98bef6..12e4925bcba10af6c52aa3b499c9279785c2f345 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
@@ -751,7 +751,7 @@ class JavaScriptBackend extends Backend {
Element annotatedElement,
Registry registry) {
assert(registry.isForResolution);
- Constant constant = constants.getConstantForMetadata(metadata);
+ Constant constant = constants.getConstantForMetadata(metadata).value;
registerCompileTimeConstant(constant, registry);
metadataConstants.add(new Dependency(constant, annotatedElement));
}
@@ -1154,10 +1154,10 @@ class JavaScriptBackend extends Backend {
return;
}
if (kind.category == ElementCategory.VARIABLE) {
- Constant initialValue = constants.getConstantForVariable(element);
+ ConstExp initialValue = constants.getConstantForVariable(element);
if (initialValue != null) {
- registerCompileTimeConstant(initialValue, work.registry);
- constants.addCompileTimeConstantForEmission(initialValue);
+ registerCompileTimeConstant(initialValue.value, work.registry);
+ constants.addCompileTimeConstantForEmission(initialValue.value);
// We don't need to generate code for static or top-level
// variables. For instance variables, we may need to generate
// the checked setter.
@@ -1611,7 +1611,7 @@ class JavaScriptBackend extends Backend {
if (mustRetainMetadata && referencedFromMirrorSystem(element)) {
for (MetadataAnnotation metadata in element.metadata) {
metadata.ensureResolved(compiler);
- Constant constant = constants.getConstantForMetadata(metadata);
+ Constant constant = constants.getConstantForMetadata(metadata).value;
constants.addCompileTimeConstantForEmission(constant);
}
return true;
@@ -1880,7 +1880,7 @@ class JavaScriptBackend extends Backend {
// all metadata but only stuff that potentially would match one
// of the used meta targets.
metadata.ensureResolved(compiler);
- Constant value = metadata.value;
+ Constant value = metadata.constant.value;
if (value == null) continue;
DartType type = value.computeType(compiler);
if (metaTargetsUsed.contains(type.element)) return true;
@@ -2148,8 +2148,8 @@ class JavaScriptBackend extends Backend {
bool hasNoSideEffects = false;
for (MetadataAnnotation metadata in element.metadata) {
metadata.ensureResolved(compiler);
- if (!metadata.value.isConstructedObject) continue;
- ObjectConstant value = metadata.value;
+ if (!metadata.constant.value.isConstructedObject) continue;
+ ObjectConstant value = metadata.constant.value;
ClassElement cls = value.type.element;
if (cls == noInlineClass) {
hasNoInline = true;

Powered by Google App Engine
This is Rietveld 408576698