Index: pkg/compiler/lib/src/kernel/element_map.dart |
diff --git a/pkg/compiler/lib/src/kernel/element_map.dart b/pkg/compiler/lib/src/kernel/element_map.dart |
index 658a577988aa9fc44366727233b2fa1395216da7..b2a373ba557d8dfa2fea55393a9d6354754dd6fc 100644 |
--- a/pkg/compiler/lib/src/kernel/element_map.dart |
+++ b/pkg/compiler/lib/src/kernel/element_map.dart |
@@ -800,9 +800,9 @@ class _KClassEnv { |
} |
} |
- Iterable<ConstantExpression> getMetadata(KernelToElementMap worldBuilder) { |
+ Iterable<ConstantExpression> getMetadata(KernelToElementMap elementMap) { |
if (_metadata == null) { |
- _metadata = worldBuilder.getMetadata(cls.annotations); |
+ _metadata = elementMap.getMetadata(cls.annotations); |
} |
return _metadata; |
} |
@@ -810,12 +810,17 @@ class _KClassEnv { |
class _MemberData { |
final ir.Member node; |
+ Iterable<ConstantExpression> _metadata; |
_MemberData(this.node); |
ResolutionImpact getWorldImpact(KernelToElementMap elementMap) { |
return buildKernelImpact(node, elementMap); |
} |
+ |
+ Iterable<ConstantExpression> getMetadata(KernelToElementMap elementMap) { |
+ return _metadata ??= elementMap.getMetadata(node.annotations); |
+ } |
} |
class _FunctionData extends _MemberData { |
@@ -1040,6 +1045,16 @@ class KernelElementEnvironment implements ElementEnvironment { |
// TODO(johnniwinther): Support these. |
return false; |
} |
+ |
+ @override |
+ Iterable<ConstantValue> getMemberMetadata(KMember member) { |
+ List<ConstantValue> values = <ConstantValue>[]; |
+ _MemberData memberData = elementMap._memberList[member.memberIndex]; |
+ for (ConstantExpression constant in memberData.getMetadata(elementMap)) { |
+ values.add(elementMap.constantEnvironment.getConstantValue(constant)); |
+ } |
+ return values; |
+ } |
} |
/// Visitor that converts kernel dart types into [DartType]. |