OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
775 void MacroAssembler::SmiCompare(Register dst, Register src) { | 775 void MacroAssembler::SmiCompare(Register dst, Register src) { |
776 cmpq(dst, src); | 776 cmpq(dst, src); |
777 } | 777 } |
778 | 778 |
779 | 779 |
780 void MacroAssembler::SmiCompare(Register dst, Smi* src) { | 780 void MacroAssembler::SmiCompare(Register dst, Smi* src) { |
781 ASSERT(!dst.is(kScratchRegister)); | 781 ASSERT(!dst.is(kScratchRegister)); |
782 if (src->value() == 0) { | 782 if (src->value() == 0) { |
783 testq(dst, dst); | 783 testq(dst, dst); |
784 } else { | 784 } else { |
785 Move(kScratchRegister, src); | 785 Register constant_reg = GetSmiConstant(src); |
786 cmpq(dst, kScratchRegister); | 786 cmpq(dst, constant_reg); |
787 } | 787 } |
788 } | 788 } |
789 | 789 |
790 | 790 |
791 void MacroAssembler::SmiCompare(Register dst, const Operand& src) { | 791 void MacroAssembler::SmiCompare(Register dst, const Operand& src) { |
792 cmpq(dst, src); | 792 cmpq(dst, src); |
793 } | 793 } |
794 | 794 |
795 | 795 |
796 void MacroAssembler::SmiCompare(const Operand& dst, Register src) { | 796 void MacroAssembler::SmiCompare(const Operand& dst, Register src) { |
(...skipping 2150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2947 CPU::FlushICache(address_, size_); | 2947 CPU::FlushICache(address_, size_); |
2948 | 2948 |
2949 // Check that the code was patched as expected. | 2949 // Check that the code was patched as expected. |
2950 ASSERT(masm_.pc_ == address_ + size_); | 2950 ASSERT(masm_.pc_ == address_ + size_); |
2951 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 2951 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
2952 } | 2952 } |
2953 | 2953 |
2954 } } // namespace v8::internal | 2954 } } // namespace v8::internal |
2955 | 2955 |
2956 #endif // V8_TARGET_ARCH_X64 | 2956 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |