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

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

Issue 2813093002: Remove BackendClasses and JavaScriptBackendClasses. (Closed)
Patch Set: . Created 3 years, 8 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/ssa/optimize.dart ('k') | pkg/compiler/lib/src/types/map_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/flat_type_mask.dart
diff --git a/pkg/compiler/lib/src/types/flat_type_mask.dart b/pkg/compiler/lib/src/types/flat_type_mask.dart
index 5758746062616e3fcbe0495c719ea16fa84811e2..15c25fd98a33ec1aa5ffdf74e0ba0074dbbae24b 100644
--- a/pkg/compiler/lib/src/types/flat_type_mask.dart
+++ b/pkg/compiler/lib/src/types/flat_type_mask.dart
@@ -114,25 +114,25 @@ class FlatTypeMask implements TypeMask {
// The general optimization is to realize there is only one class that
// implements [base] and [base] is not instantiated. We however do
// not track correctly the list of truly instantiated classes.
- BackendClasses backendClasses = closedWorld.backendClasses;
+ CommonElements commonElements = closedWorld.commonElements;
if (containsOnlyString(closedWorld)) {
return cls == closedWorld.commonElements.stringClass ||
- cls == backendClasses.stringClass;
+ cls == commonElements.jsStringClass;
}
if (containsOnlyBool(closedWorld)) {
return cls == closedWorld.commonElements.boolClass ||
- cls == backendClasses.boolClass;
+ cls == commonElements.jsBoolClass;
}
if (containsOnlyInt(closedWorld)) {
return cls == closedWorld.commonElements.intClass ||
- cls == backendClasses.intClass ||
- cls == backendClasses.positiveIntClass ||
- cls == backendClasses.uint32Class ||
- cls == backendClasses.uint31Class;
+ cls == commonElements.jsIntClass ||
+ cls == commonElements.jsPositiveIntClass ||
+ cls == commonElements.jsUInt32Class ||
+ cls == commonElements.jsUInt31Class;
}
if (containsOnlyDouble(closedWorld)) {
return cls == closedWorld.commonElements.doubleClass ||
- cls == backendClasses.doubleClass;
+ cls == commonElements.jsDoubleClass;
}
return false;
}
@@ -175,38 +175,34 @@ class FlatTypeMask implements TypeMask {
}
bool containsOnlyInt(ClosedWorld closedWorld) {
- BackendClasses backendClasses = closedWorld.backendClasses;
+ CommonElements commonElements = closedWorld.commonElements;
return base == closedWorld.commonElements.intClass ||
- base == backendClasses.intClass ||
- base == backendClasses.positiveIntClass ||
- base == backendClasses.uint31Class ||
- base == backendClasses.uint32Class;
+ base == commonElements.jsIntClass ||
+ base == commonElements.jsPositiveIntClass ||
+ base == commonElements.jsUInt31Class ||
+ base == commonElements.jsUInt32Class;
}
bool containsOnlyDouble(ClosedWorld closedWorld) {
- BackendClasses backendClasses = closedWorld.backendClasses;
return base == closedWorld.commonElements.doubleClass ||
- base == backendClasses.doubleClass;
+ base == closedWorld.commonElements.jsDoubleClass;
}
bool containsOnlyNum(ClosedWorld closedWorld) {
- BackendClasses backendClasses = closedWorld.backendClasses;
return containsOnlyInt(closedWorld) ||
containsOnlyDouble(closedWorld) ||
base == closedWorld.commonElements.numClass ||
- base == backendClasses.numClass;
+ base == closedWorld.commonElements.jsNumberClass;
}
bool containsOnlyBool(ClosedWorld closedWorld) {
- BackendClasses backendClasses = closedWorld.backendClasses;
return base == closedWorld.commonElements.boolClass ||
- base == backendClasses.boolClass;
+ base == closedWorld.commonElements.jsBoolClass;
}
bool containsOnlyString(ClosedWorld closedWorld) {
- BackendClasses backendClasses = closedWorld.backendClasses;
return base == closedWorld.commonElements.stringClass ||
- base == backendClasses.stringClass;
+ base == closedWorld.commonElements.jsStringClass;
}
bool containsOnly(ClassEntity cls) {
@@ -496,16 +492,16 @@ class FlatTypeMask implements TypeMask {
*/
bool canHit(
MemberEntity element, Selector selector, ClosedWorld closedWorld) {
- BackendClasses backendClasses = closedWorld.backendClasses;
+ CommonElements commonElements = closedWorld.commonElements;
assert(element.name == selector.name);
if (isEmpty) return false;
if (isNull) {
return closedWorld.hasElementIn(
- backendClasses.nullClass, selector, element);
+ commonElements.jsNullClass, selector, element);
}
ClassEntity other = element.enclosingClass;
- if (other == backendClasses.nullClass) {
+ if (other == commonElements.jsNullClass) {
return isNullable;
} else if (isExact) {
return closedWorld.hasElementIn(base, selector, element);
« no previous file with comments | « pkg/compiler/lib/src/ssa/optimize.dart ('k') | pkg/compiler/lib/src/types/map_type_mask.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698