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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/types.dart

Issue 12528004: Check for canBePrimitiveNumber when doing the intersection on a number type. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/optimize.dart ('k') | tests/corelib/corelib.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/ssa/types.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/ssa/types.dart (revision 19535)
+++ sdk/lib/_internal/compiler/implementation/ssa/types.dart (working copy)
@@ -416,6 +416,7 @@
if (other.isUnknown()) return HType.BOOLEAN;
if (other.isBooleanOrNull()) return HType.BOOLEAN;
if (other.isBoolean()) return HType.BOOLEAN;
+ if (other.isTop(compiler)) return HType.BOOLEAN;
return HType.CONFLICTING;
}
}
@@ -453,7 +454,7 @@
if (other.isIntegerOrNull()) return HType.INTEGER_OR_NULL;
if (other.isDoubleOrNull()) return HType.DOUBLE_OR_NULL;
if (other.isNumberOrNull()) return HType.NUMBER_OR_NULL;
- if (other.isTop(compiler)) {
+ if (other.canBePrimitiveNumber(compiler)) {
return other.canBeNull() ? this : HType.NUMBER;
}
if (other.canBeNull()) return HType.NULL;
@@ -493,6 +494,7 @@
if (other.isIntegerOrNull()) return HType.INTEGER;
if (other.isDoubleOrNull()) return HType.DOUBLE;
if (other.isNumberOrNull()) return HType.NUMBER;
+ if (other.canBePrimitiveNumber(compiler)) return HType.NUMBER;
return HType.CONFLICTING;
}
}
@@ -531,7 +533,7 @@
if (other.isDoubleOrNull()) return HType.NULL;
if (other.isNumber()) return HType.INTEGER;
if (other.isNumberOrNull()) return HType.INTEGER_OR_NULL;
- if (other.isTop(compiler)) {
+ if (other.canBePrimitiveNumber(compiler)) {
return other.canBeNull() ? this : HType.INTEGER;
}
if (other.canBeNull()) return HType.NULL;
@@ -574,6 +576,7 @@
if (other.isDoubleOrNull()) return HType.CONFLICTING;
if (other.isNumber()) return HType.INTEGER;
if (other.isNumberOrNull()) return HType.INTEGER;
+ if (other.canBePrimitiveNumber(compiler)) return HType.INTEGER;
return HType.CONFLICTING;
}
}
@@ -612,7 +615,7 @@
if (other.isDoubleOrNull()) return HType.DOUBLE_OR_NULL;
if (other.isNumber()) return HType.DOUBLE;
if (other.isNumberOrNull()) return HType.DOUBLE_OR_NULL;
- if (other.isTop(compiler)) {
+ if (other.canBePrimitiveNumber(compiler)) {
return other.canBeNull() ? this : HType.DOUBLE;
}
if (other.canBeNull()) return HType.NULL;
@@ -655,6 +658,7 @@
if (other.isDoubleOrNull()) return HType.DOUBLE;
if (other.isNumber()) return HType.DOUBLE;
if (other.isNumberOrNull()) return HType.DOUBLE;
+ if (other.canBePrimitiveNumber(compiler)) return HType.DOUBLE;
return HType.CONFLICTING;
}
}
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/optimize.dart ('k') | tests/corelib/corelib.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698