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

Unified Diff: pkg/compiler/lib/src/universe/resolution_world_builder.dart

Issue 2742283002: Add ConstantUse to WorldImpact (Closed)
Patch Set: Cleanup. Created 3 years, 9 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/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,

Powered by Google App Engine
This is Rietveld 408576698