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

Unified Diff: pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart

Issue 2613213003: Use entities in ClosedWorld interface (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « pkg/compiler/lib/src/enqueue.dart ('k') | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart
diff --git a/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart b/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart
index c3f2a729dd791a5d677e951635813d221e18294b..5678b81f77a5189ea24d7a3c1f37bb227c41fc6f 100644
--- a/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart
+++ b/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart
@@ -1632,14 +1632,15 @@ class SimpleTypeInferrerVisitor<T>
return length.value;
} else if (element != null &&
element.isField &&
- Elements.isStaticOrTopLevelField(element) &&
- closedWorld.fieldNeverChanges(element)) {
+ Elements.isStaticOrTopLevelField(element)) {
FieldElement fieldElement = element;
- ConstantValue value =
- compiler.backend.constants.getConstantValue(fieldElement.constant);
- if (value != null && value.isInt) {
- IntConstantValue intValue = value;
- return intValue.primitiveValue;
+ if (closedWorld.fieldNeverChanges(fieldElement)) {
+ ConstantValue value =
+ compiler.backend.constants.getConstantValue(fieldElement.constant);
+ if (value != null && value.isInt) {
+ IntConstantValue intValue = value;
+ return intValue.primitiveValue;
+ }
}
}
return null;
« no previous file with comments | « pkg/compiler/lib/src/enqueue.dart ('k') | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698