Index: pkg/compiler/lib/src/universe/resolution_world_builder.dart |
diff --git a/pkg/compiler/lib/src/universe/resolution_world_builder.dart b/pkg/compiler/lib/src/universe/resolution_world_builder.dart |
index 4fb573bd79f91dd3d3870439859b8bdabe465989..6095664c177c3bb2a0ea6b8829583c16cf5c7023 100644 |
--- a/pkg/compiler/lib/src/universe/resolution_world_builder.dart |
+++ b/pkg/compiler/lib/src/universe/resolution_world_builder.dart |
@@ -89,6 +89,10 @@ abstract class ResolutionEnqueuerWorldBuilder extends ResolutionWorldBuilder { |
/// Applies the [staticUse] to applicable members. Calls [membersUsed] with |
/// the usage changes for each member. |
void registerStaticUse(StaticUse staticUse, MemberUsedCallback memberUsed); |
+ |
+ /// Register the constant [use] with this world builder. Returns `true` if |
+ /// the constant use was new to the world. |
+ bool registerConstantUse(ConstantUse use); |
} |
/// The type and kind of an instantiation registered through |
@@ -355,6 +359,8 @@ class ElementResolutionWorldBuilder implements ResolutionEnqueuerWorldBuilder { |
<ClassElement, ClassHierarchyNode>{}; |
final Map<ClassElement, ClassSet> _classSets = <ClassElement, ClassSet>{}; |
+ final Set<ConstantValue> _constantValues = new Set<ConstantValue>(); |
+ |
bool get isClosed => _closed; |
ElementResolutionWorldBuilder( |
@@ -610,6 +616,10 @@ class ElementResolutionWorldBuilder implements ResolutionEnqueuerWorldBuilder { |
isChecks.add(type); |
} |
+ bool registerConstantUse(ConstantUse use) { |
+ return _constantValues.add(use.value); |
+ } |
+ |
void registerStaticUse(StaticUse staticUse, MemberUsedCallback memberUsed) { |
Element element = staticUse.element; |
assert(invariant(element, element.isDeclaration, |