OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 1440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1451 | 1451 |
1452 template <typename LabelType> | 1452 template <typename LabelType> |
1453 void MacroAssembler::SmiShiftLogicalRight(Register dst, | 1453 void MacroAssembler::SmiShiftLogicalRight(Register dst, |
1454 Register src1, | 1454 Register src1, |
1455 Register src2, | 1455 Register src2, |
1456 LabelType* on_not_smi_result) { | 1456 LabelType* on_not_smi_result) { |
1457 ASSERT(!dst.is(kScratchRegister)); | 1457 ASSERT(!dst.is(kScratchRegister)); |
1458 ASSERT(!src1.is(kScratchRegister)); | 1458 ASSERT(!src1.is(kScratchRegister)); |
1459 ASSERT(!src2.is(kScratchRegister)); | 1459 ASSERT(!src2.is(kScratchRegister)); |
1460 ASSERT(!dst.is(rcx)); | 1460 ASSERT(!dst.is(rcx)); |
| 1461 // dst and src1 can be the same, because the one case that bails out |
| 1462 // is a shift by 0, which leaves dst, and therefore src1, unchanged. |
1461 NearLabel result_ok; | 1463 NearLabel result_ok; |
1462 if (src1.is(rcx) || src2.is(rcx)) { | 1464 if (src1.is(rcx) || src2.is(rcx)) { |
1463 movq(kScratchRegister, rcx); | 1465 movq(kScratchRegister, rcx); |
1464 } | 1466 } |
1465 if (!dst.is(src1)) { | 1467 if (!dst.is(src1)) { |
1466 movq(dst, src1); | 1468 movq(dst, src1); |
1467 } | 1469 } |
1468 SmiToInteger32(rcx, src2); | 1470 SmiToInteger32(rcx, src2); |
1469 orl(rcx, Immediate(kSmiShift)); | 1471 orl(rcx, Immediate(kSmiShift)); |
1470 shr_cl(dst); // Shift is rcx modulo 0x1f + 32. | 1472 shr_cl(dst); // Shift is rcx modulo 0x1f + 32. |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1768 Jump(adaptor, RelocInfo::CODE_TARGET); | 1770 Jump(adaptor, RelocInfo::CODE_TARGET); |
1769 } | 1771 } |
1770 bind(&invoke); | 1772 bind(&invoke); |
1771 } | 1773 } |
1772 } | 1774 } |
1773 | 1775 |
1774 | 1776 |
1775 } } // namespace v8::internal | 1777 } } // namespace v8::internal |
1776 | 1778 |
1777 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ | 1779 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ |
OLD | NEW |