| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 1674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1685 break; | 1685 break; |
| 1686 default: | 1686 default: |
| 1687 UNREACHABLE(); | 1687 UNREACHABLE(); |
| 1688 break; | 1688 break; |
| 1689 } | 1689 } |
| 1690 } else { | 1690 } else { |
| 1691 int value = ToInteger32(LConstantOperand::cast(right)); | 1691 int value = ToInteger32(LConstantOperand::cast(right)); |
| 1692 uint8_t shift_count = static_cast<uint8_t>(value & 0x1F); | 1692 uint8_t shift_count = static_cast<uint8_t>(value & 0x1F); |
| 1693 switch (instr->op()) { | 1693 switch (instr->op()) { |
| 1694 case Token::ROR: | 1694 case Token::ROR: |
| 1695 if (shift_count == 0 && instr->can_deopt()) { | 1695 if (shift_count != 0) { |
| 1696 __ ror(ToRegister(left), shift_count); |
| 1697 } else if (instr->can_deopt()) { |
| 1696 __ test(ToRegister(left), Immediate(0x80000000)); | 1698 __ test(ToRegister(left), Immediate(0x80000000)); |
| 1697 DeoptimizeIf(not_zero, instr->environment()); | 1699 DeoptimizeIf(not_zero, instr->environment()); |
| 1698 } else { | |
| 1699 __ ror(ToRegister(left), shift_count); | |
| 1700 } | 1700 } |
| 1701 break; | 1701 break; |
| 1702 case Token::SAR: | 1702 case Token::SAR: |
| 1703 if (shift_count != 0) { | 1703 if (shift_count != 0) { |
| 1704 __ sar(ToRegister(left), shift_count); | 1704 __ sar(ToRegister(left), shift_count); |
| 1705 } | 1705 } |
| 1706 break; | 1706 break; |
| 1707 case Token::SHR: | 1707 case Token::SHR: |
| 1708 if (shift_count == 0 && instr->can_deopt()) { | 1708 if (shift_count != 0) { |
| 1709 __ shr(ToRegister(left), shift_count); |
| 1710 } else if (instr->can_deopt()) { |
| 1709 __ test(ToRegister(left), Immediate(0x80000000)); | 1711 __ test(ToRegister(left), Immediate(0x80000000)); |
| 1710 DeoptimizeIf(not_zero, instr->environment()); | 1712 DeoptimizeIf(not_zero, instr->environment()); |
| 1711 } else { | |
| 1712 __ shr(ToRegister(left), shift_count); | |
| 1713 } | 1713 } |
| 1714 break; | 1714 break; |
| 1715 case Token::SHL: | 1715 case Token::SHL: |
| 1716 if (shift_count != 0) { | 1716 if (shift_count != 0) { |
| 1717 __ shl(ToRegister(left), shift_count); | 1717 __ shl(ToRegister(left), shift_count); |
| 1718 } | 1718 } |
| 1719 break; | 1719 break; |
| 1720 default: | 1720 default: |
| 1721 UNREACHABLE(); | 1721 UNREACHABLE(); |
| 1722 break; | 1722 break; |
| (...skipping 4853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6576 FixedArray::kHeaderSize - kPointerSize)); | 6576 FixedArray::kHeaderSize - kPointerSize)); |
| 6577 __ bind(&done); | 6577 __ bind(&done); |
| 6578 } | 6578 } |
| 6579 | 6579 |
| 6580 | 6580 |
| 6581 #undef __ | 6581 #undef __ |
| 6582 | 6582 |
| 6583 } } // namespace v8::internal | 6583 } } // namespace v8::internal |
| 6584 | 6584 |
| 6585 #endif // V8_TARGET_ARCH_IA32 | 6585 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |