Index: src/ic.cc |
=================================================================== |
--- src/ic.cc (revision 6575) |
+++ src/ic.cc (working copy) |
@@ -2053,6 +2053,7 @@ |
} |
if (left_type.IsInteger32() && right_type.IsInteger32()) { |
+ ASSERT(kSmiValueSize != 32); // 32-bit Smis cause no distinct INT32 type. |
return INT32; |
} |
@@ -2096,9 +2097,11 @@ |
} |
if (type == TRBinaryOpIC::SMI && |
previous_type == TRBinaryOpIC::SMI) { |
- if (op == Token::DIV || op == Token::MUL) { |
+ if (op == Token::DIV || op == Token::MUL || kSmiValueSize == 32) { |
// Arithmetic on two Smi inputs has yielded a heap number. |
// That is the only way to get here from the Smi stub. |
+ // With 32-bit Smis, all overflows give heap numbers, but with |
+ // 31-bit Smis, most operations overflow to int32 results. |
result_type = TRBinaryOpIC::HEAP_NUMBER; |
} else { |
// Other operations on SMIs that overflow yield int32s. |