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

Unified Diff: lib/compiler/implementation/ssa/optimize.dart

Issue 10916172: num implements Comparable and Hashable. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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 | « lib/compiler/implementation/ssa/codegen.dart ('k') | lib/compiler/implementation/ssa/types.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/ssa/optimize.dart
===================================================================
--- lib/compiler/implementation/ssa/optimize.dart (revision 12035)
+++ lib/compiler/implementation/ssa/optimize.dart (working copy)
@@ -512,7 +512,9 @@
|| element === compiler.dynamicClass) {
return graph.addConstantBool(true, constantSystem);
} else if (expressionType.isInteger()) {
- if (element === compiler.intClass || element === compiler.numClass) {
+ if (element === compiler.intClass
+ || element === compiler.numClass
+ || Elements.isNumberOrStringSupertype(element, compiler)) {
return graph.addConstantBool(true, constantSystem);
} else if (element === compiler.doubleClass) {
// We let the JS semantics decide for that check. Currently
@@ -522,7 +524,9 @@
return graph.addConstantBool(false, constantSystem);
}
} else if (expressionType.isDouble()) {
- if (element === compiler.doubleClass || element === compiler.numClass) {
+ if (element === compiler.doubleClass
+ || element === compiler.numClass
+ || Elements.isNumberOrStringSupertype(element, compiler)) {
return graph.addConstantBool(true, constantSystem);
} else if (element === compiler.intClass) {
// We let the JS semantics decide for that check. Currently
@@ -540,7 +544,8 @@
// type int or double.
} else if (expressionType.isString()) {
if (element === compiler.stringClass
- || Elements.isStringSupertype(element, compiler)) {
+ || Elements.isStringOnlySupertype(element, compiler)
+ || Elements.isNumberOrStringSupertype(element, compiler)) {
return graph.addConstantBool(true, constantSystem);
} else {
return graph.addConstantBool(false, constantSystem);
« no previous file with comments | « lib/compiler/implementation/ssa/codegen.dart ('k') | lib/compiler/implementation/ssa/types.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698