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 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
818 } | 818 } |
819 | 819 |
820 | 820 |
821 Condition MacroAssembler::CheckSmi(Register src) { | 821 Condition MacroAssembler::CheckSmi(Register src) { |
822 ASSERT_EQ(0, kSmiTag); | 822 ASSERT_EQ(0, kSmiTag); |
823 testb(src, Immediate(kSmiTagMask)); | 823 testb(src, Immediate(kSmiTagMask)); |
824 return zero; | 824 return zero; |
825 } | 825 } |
826 | 826 |
827 | 827 |
828 Condition MacroAssembler::CheckPositiveSmi(Register src) { | 828 Condition MacroAssembler::CheckNonNegativeSmi(Register src) { |
829 ASSERT_EQ(0, kSmiTag); | 829 ASSERT_EQ(0, kSmiTag); |
830 // Make mask 0x8000000000000001 and test that both bits are zero. | 830 // Make mask 0x8000000000000001 and test that both bits are zero. |
831 movq(kScratchRegister, src); | 831 movq(kScratchRegister, src); |
832 rol(kScratchRegister, Immediate(1)); | 832 rol(kScratchRegister, Immediate(1)); |
833 testb(kScratchRegister, Immediate(3)); | 833 testb(kScratchRegister, Immediate(3)); |
834 return zero; | 834 return zero; |
835 } | 835 } |
836 | 836 |
837 | 837 |
838 Condition MacroAssembler::CheckBothSmi(Register first, Register second) { | 838 Condition MacroAssembler::CheckBothSmi(Register first, Register second) { |
839 if (first.is(second)) { | 839 if (first.is(second)) { |
840 return CheckSmi(first); | 840 return CheckSmi(first); |
841 } | 841 } |
842 ASSERT(kSmiTag == 0 && kHeapObjectTag == 1 && kHeapObjectTagMask == 3); | 842 ASSERT(kSmiTag == 0 && kHeapObjectTag == 1 && kHeapObjectTagMask == 3); |
843 leal(kScratchRegister, Operand(first, second, times_1, 0)); | 843 leal(kScratchRegister, Operand(first, second, times_1, 0)); |
844 testb(kScratchRegister, Immediate(0x03)); | 844 testb(kScratchRegister, Immediate(0x03)); |
845 return zero; | 845 return zero; |
846 } | 846 } |
847 | 847 |
848 | 848 |
849 Condition MacroAssembler::CheckBothPositiveSmi(Register first, | 849 Condition MacroAssembler::CheckBothNonNegativeSmi(Register first, |
850 Register second) { | 850 Register second) { |
851 if (first.is(second)) { | 851 if (first.is(second)) { |
852 return CheckPositiveSmi(first); | 852 return CheckNonNegativeSmi(first); |
853 } | 853 } |
854 movq(kScratchRegister, first); | 854 movq(kScratchRegister, first); |
855 or_(kScratchRegister, second); | 855 or_(kScratchRegister, second); |
856 rol(kScratchRegister, Immediate(1)); | 856 rol(kScratchRegister, Immediate(1)); |
857 testl(kScratchRegister, Immediate(0x03)); | 857 testl(kScratchRegister, Immediate(3)); |
858 return zero; | 858 return zero; |
859 } | 859 } |
860 | 860 |
861 | 861 |
862 Condition MacroAssembler::CheckEitherSmi(Register first, | 862 Condition MacroAssembler::CheckEitherSmi(Register first, |
863 Register second, | 863 Register second, |
864 Register scratch) { | 864 Register scratch) { |
865 if (first.is(second)) { | 865 if (first.is(second)) { |
866 return CheckSmi(first); | 866 return CheckSmi(first); |
867 } | 867 } |
(...skipping 1355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2223 CPU::FlushICache(address_, size_); | 2223 CPU::FlushICache(address_, size_); |
2224 | 2224 |
2225 // Check that the code was patched as expected. | 2225 // Check that the code was patched as expected. |
2226 ASSERT(masm_.pc_ == address_ + size_); | 2226 ASSERT(masm_.pc_ == address_ + size_); |
2227 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 2227 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
2228 } | 2228 } |
2229 | 2229 |
2230 } } // namespace v8::internal | 2230 } } // namespace v8::internal |
2231 | 2231 |
2232 #endif // V8_TARGET_ARCH_X64 | 2232 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |