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

Unified Diff: pkg/compiler/lib/src/types/constants.dart

Issue 2488353004: Remove Compiler access from ResolutionEnqueuer (Closed)
Patch Set: Updated cf. comments. Created 4 years, 1 month 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/ssa/types.dart ('k') | pkg/compiler/lib/src/types/flat_type_mask.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/types/constants.dart
diff --git a/pkg/compiler/lib/src/types/constants.dart b/pkg/compiler/lib/src/types/constants.dart
index 8c3f6b72a69a0426691bc106d9dacf1332accbb8..60dbd90f21c019ec2437b31068305111689c9990 100644
--- a/pkg/compiler/lib/src/types/constants.dart
+++ b/pkg/compiler/lib/src/types/constants.dart
@@ -22,7 +22,7 @@ class ConstantValueTypeMasks extends ConstantValueVisitor<TypeMask, Compiler> {
TypeMask visitConstructed(
ConstructedConstantValue constant, Compiler compiler) {
if (compiler.backend.isInterceptorClass(constant.type.element)) {
- return compiler.commonMasks.nonNullType;
+ return compiler.closedWorld.commonMasks.nonNullType;
}
return new TypeMask.nonNullExact(
constant.type.element, compiler.closedWorld);
@@ -38,13 +38,13 @@ class ConstantValueTypeMasks extends ConstantValueVisitor<TypeMask, Compiler> {
// We have to recognize double constants that are 'is int'.
if (compiler.backend.constantSystem.isInt(constant)) {
if (constant.isMinusZero) {
- return compiler.commonMasks.uint31Type;
+ return compiler.closedWorld.commonMasks.uint31Type;
} else {
assert(constant.isPositiveInfinity || constant.isNegativeInfinity);
- return compiler.commonMasks.intType;
+ return compiler.closedWorld.commonMasks.intType;
}
}
- return compiler.commonMasks.doubleType;
+ return compiler.closedWorld.commonMasks.doubleType;
}
@override
@@ -55,9 +55,9 @@ class ConstantValueTypeMasks extends ConstantValueVisitor<TypeMask, Compiler> {
case SyntheticConstantKind.EMPTY_VALUE:
return constant.payload;
case SyntheticConstantKind.TYPEVARIABLE_REFERENCE:
- return compiler.commonMasks.intType;
+ return compiler.closedWorld.commonMasks.intType;
case SyntheticConstantKind.NAME:
- return compiler.commonMasks.stringType;
+ return compiler.closedWorld.commonMasks.stringType;
default:
DiagnosticReporter reporter = compiler.reporter;
reporter.internalError(
@@ -68,55 +68,56 @@ class ConstantValueTypeMasks extends ConstantValueVisitor<TypeMask, Compiler> {
@override
TypeMask visitBool(BoolConstantValue constant, Compiler compiler) {
- return compiler.commonMasks.boolType;
+ return compiler.closedWorld.commonMasks.boolType;
}
@override
TypeMask visitFunction(FunctionConstantValue constant, Compiler compiler) {
- return compiler.commonMasks.functionType;
+ return compiler.closedWorld.commonMasks.functionType;
}
@override
TypeMask visitInt(IntConstantValue constant, Compiler compiler) {
- if (constant.isUInt31()) return compiler.commonMasks.uint31Type;
- if (constant.isUInt32()) return compiler.commonMasks.uint32Type;
- if (constant.isPositive()) return compiler.commonMasks.positiveIntType;
- return compiler.commonMasks.intType;
+ if (constant.isUInt31()) return compiler.closedWorld.commonMasks.uint31Type;
+ if (constant.isUInt32()) return compiler.closedWorld.commonMasks.uint32Type;
+ if (constant.isPositive())
+ return compiler.closedWorld.commonMasks.positiveIntType;
+ return compiler.closedWorld.commonMasks.intType;
}
@override
TypeMask visitInterceptor(
InterceptorConstantValue constant, Compiler compiler) {
- return compiler.commonMasks.nonNullType;
+ return compiler.closedWorld.commonMasks.nonNullType;
}
@override
TypeMask visitList(ListConstantValue constant, Compiler compiler) {
- return compiler.commonMasks.constListType;
+ return compiler.closedWorld.commonMasks.constListType;
}
@override
TypeMask visitMap(MapConstantValue constant, Compiler compiler) {
- return compiler.commonMasks.constMapType;
+ return compiler.closedWorld.commonMasks.constMapType;
}
@override
TypeMask visitNull(NullConstantValue constant, Compiler compiler) {
- return compiler.commonMasks.nullType;
+ return compiler.closedWorld.commonMasks.nullType;
}
@override
TypeMask visitNonConstant(NonConstantValue constant, Compiler compiler) {
- return compiler.commonMasks.nullType;
+ return compiler.closedWorld.commonMasks.nullType;
}
@override
TypeMask visitString(StringConstantValue constant, Compiler compiler) {
- return compiler.commonMasks.stringType;
+ return compiler.closedWorld.commonMasks.stringType;
}
@override
TypeMask visitType(TypeConstantValue constant, Compiler compiler) {
- return compiler.commonMasks.typeType;
+ return compiler.closedWorld.commonMasks.typeType;
}
}
« no previous file with comments | « pkg/compiler/lib/src/ssa/types.dart ('k') | pkg/compiler/lib/src/types/flat_type_mask.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698