Index: pkg/compiler/lib/src/constants/values.dart |
diff --git a/pkg/compiler/lib/src/constants/values.dart b/pkg/compiler/lib/src/constants/values.dart |
index 2a7c5c4d45e157f3f8896c95aa8fbf6f8cf2aec0..945aaba89e838c506dc52cca41077f467f436237 100644 |
--- a/pkg/compiler/lib/src/constants/values.dart |
+++ b/pkg/compiler/lib/src/constants/values.dart |
@@ -502,6 +502,7 @@ class MapConstantValue extends ObjectConstantValue { |
final List<ConstantValue> keys; |
final List<ConstantValue> values; |
final int hashCode; |
+ Map<ConstantValue, ConstantValue> _lookupMap; |
MapConstantValue(InterfaceType type, |
List<ConstantValue> keys, |
@@ -539,6 +540,12 @@ class MapConstantValue extends ObjectConstantValue { |
int get length => keys.length; |
+ ConstantValue lookup(ConstantValue key) { |
+ var lookupMap = _lookupMap ??= |
+ new Map<ConstantValue, ConstantValue>.fromIterables(keys, values); |
+ return lookupMap[key]; |
+ } |
+ |
accept(ConstantValueVisitor visitor, arg) => visitor.visitMap(this, arg); |
String unparse() { |