Index: src/arm/codegen-arm.cc |
=================================================================== |
--- src/arm/codegen-arm.cc (revision 5308) |
+++ src/arm/codegen-arm.cc (working copy) |
@@ -1222,21 +1222,26 @@ |
case Token::SHR: |
case Token::SAR: { |
ASSERT(!reversed); |
- TypeInfo result = |
- (op == Token::SAR) ? TypeInfo::Integer32() : TypeInfo::Number(); |
- if (!reversed) { |
- if (op == Token::SHR) { |
- if (int_value >= 2) { |
- result = TypeInfo::Smi(); |
- } else if (int_value >= 1) { |
- result = TypeInfo::Integer32(); |
- } |
+ int shift_amount = int_value & 0x1f; |
+ TypeInfo result = TypeInfo::Number(); |
+ |
+ if (op == Token::SHR) { |
+ if (shift_amount > 1) { |
+ result = TypeInfo::Smi(); |
+ } else if (shift_amount > 0) { |
+ result = TypeInfo::Integer32(); |
+ } |
+ } else if (op == Token::SAR) { |
+ if (shift_amount > 0) { |
+ result = TypeInfo::Smi(); |
} else { |
- if (int_value >= 1) { |
- result = TypeInfo::Smi(); |
- } |
+ result = TypeInfo::Integer32(); |
} |
+ } else { |
+ ASSERT(op == Token::SHL); |
+ result = TypeInfo::Integer32(); |
} |
+ |
Register scratch = VirtualFrame::scratch0(); |
Register scratch2 = VirtualFrame::scratch1(); |
int shift_value = int_value & 0x1f; // least significant 5 bits |