Commit 0c60beb3 authored by erik.corry@gmail.com's avatar erik.corry@gmail.com

Fix an issue in the ARM port where a left shift was predicted to have a Smi...

Fix an issue in the ARM port where a left shift was predicted to have a Smi result when it had an int32 result.  This is a commit of http://codereview.chromium.org/3195004 for Rodolph Perfetta

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5315 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 0c446a68
......@@ -1222,21 +1222,26 @@ void CodeGenerator::SmiOperation(Token::Value op,
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment