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

Unified Diff: pkg/compiler/lib/src/deferred_load.dart

Issue 1148343004: Remove ConstantExpression.value (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Update comments. Created 5 years, 7 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/deferred_load.dart
diff --git a/pkg/compiler/lib/src/deferred_load.dart b/pkg/compiler/lib/src/deferred_load.dart
index 2b0b7fc7882639f7f25ce9534caa4f05da44f05f..92116b8f77d792fd51a4a55ad9c908c99ccb6a0d 100644
--- a/pkg/compiler/lib/src/deferred_load.dart
+++ b/pkg/compiler/lib/src/deferred_load.dart
@@ -287,17 +287,17 @@ class DeferredLoadTask extends CompilerTask {
treeElements.forEachConstantNode((Node node, _) {
// Explicitly depend on the backend constants.
constants.add(
- backend.constants.getConstantForNode(node, treeElements).value);
+ backend.constants.getConstantValueForNode(node, treeElements));
});
elements.addAll(treeElements.otherDependencies);
}
// TODO(sigurdm): How is metadata on a patch-class handled?
for (MetadataAnnotation metadata in element.metadata) {
- ConstantExpression constant =
- backend.constants.getConstantForMetadata(metadata);
+ ConstantValue constant =
+ backend.constants.getConstantValueForMetadata(metadata);
if (constant != null) {
- constants.add(constant.value);
+ constants.add(constant);
}
}
@@ -491,20 +491,18 @@ class DeferredLoadTask extends CompilerTask {
});
for (MetadataAnnotation metadata in library.metadata) {
- ConstantExpression constant =
- backend.constants.getConstantForMetadata(metadata);
+ ConstantValue constant =
+ backend.constants.getConstantValueForMetadata(metadata);
if (constant != null) {
- _mapConstantDependencies(constant.value,
- deferredImport);
+ _mapConstantDependencies(constant, deferredImport);
}
}
for (LibraryTag tag in library.tags) {
for (MetadataAnnotation metadata in tag.metadata) {
- ConstantExpression constant =
- backend.constants.getConstantForMetadata(metadata);
+ ConstantValue constant =
+ backend.constants.getConstantValueForMetadata(metadata);
if (constant != null) {
- _mapConstantDependencies(constant.value,
- deferredImport);
+ _mapConstantDependencies(constant, deferredImport);
}
}
}
@@ -537,10 +535,11 @@ class DeferredLoadTask extends CompilerTask {
assert(metadatas != null);
for (MetadataAnnotation metadata in metadatas) {
metadata.ensureResolved(compiler);
- Element element =
- metadata.constant.value.getType(compiler.coreTypes).element;
+ ConstantValue value =
+ compiler.constants.getConstantValue(metadata.constant);
+ Element element = value.getType(compiler.coreTypes).element;
if (element == deferredLibraryClass) {
- ConstructedConstantValue constant = metadata.constant.value;
+ ConstructedConstantValue constant = value;
StringConstantValue s = constant.fields.values.single;
result = s.primitiveValue.slowToString();
break;
@@ -727,8 +726,9 @@ class DeferredLoadTask extends CompilerTask {
if (metadataList != null) {
for (MetadataAnnotation metadata in metadataList) {
metadata.ensureResolved(compiler);
- Element element =
- metadata.constant.value.getType(compiler.coreTypes).element;
+ ConstantValue value =
+ compiler.constants.getConstantValue(metadata.constant);
+ Element element = value.getType(compiler.coreTypes).element;
if (element == deferredLibraryClass) {
compiler.reportError(
import, MessageKind.DEFERRED_OLD_SYNTAX);
« no previous file with comments | « pkg/compiler/lib/src/dart_backend/dart_backend.dart ('k') | pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698