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

Unified Diff: sdk/lib/_internal/compiler/implementation/mirrors_used.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/mirrors_used.dart
diff --git a/sdk/lib/_internal/compiler/implementation/mirrors_used.dart b/sdk/lib/_internal/compiler/implementation/mirrors_used.dart
index 4e9711f29e3cdfb5b013c09d572ac1cdcbac659e..3078ba81e1b71a6484265877419a6e41f5a63be5 100644
--- a/sdk/lib/_internal/compiler/implementation/mirrors_used.dart
+++ b/sdk/lib/_internal/compiler/implementation/mirrors_used.dart
@@ -4,6 +4,8 @@
library dart2js.mirrors_used;
+import 'cps_ir/const_expression.dart';
+
import 'dart2jslib.dart' show
Compiler,
CompilerTask,
@@ -132,7 +134,8 @@ class MirrorUsageAnalyzerTask extends CompilerTask {
NamedArgument named = argument.asNamedArgument();
if (named == null) continue;
ConstantCompiler constantCompiler = compiler.resolver.constantCompiler;
- Constant value = constantCompiler.compileNode(named.expression, mapping);
+ Constant value =
+ constantCompiler.compileNode(named.expression, mapping).value;
MirrorUsageBuilder builder =
new MirrorUsageBuilder(
@@ -261,9 +264,9 @@ class MirrorUsageAnalyzer {
List<MirrorUsage> result = <MirrorUsage>[];
for (MetadataAnnotation metadata in tag.metadata) {
metadata.ensureResolved(compiler);
- Element element = metadata.value.computeType(compiler).element;
+ Element element = metadata.constant.value.computeType(compiler).element;
if (element == compiler.mirrorsUsedClass) {
- result.add(buildUsage(metadata.value));
+ result.add(buildUsage(metadata.constant.value));
}
}
return result;
@@ -561,8 +564,8 @@ class MirrorUsageBuilder {
/// Attempt to find a [Spannable] corresponding to constant.
Spannable positionOf(Constant constant) {
Node node;
- elements.forEachConstantNode((Node n, Constant c) {
- if (node == null && c == constant) {
+ elements.forEachConstantNode((Node n, ConstExp c) {
+ if (node == null && c.value == constant) {
node = n;
}
});

Powered by Google App Engine
This is Rietveld 408576698