| OLD | NEW |
| 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
| 2 // All Rights Reserved. | 2 // All Rights Reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions | 5 // modification, are permitted provided that the following conditions |
| 6 // are met: | 6 // are met: |
| 7 // | 7 // |
| 8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
| 9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
| 10 // | 10 // |
| (...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 762 } | 762 } |
| 763 #endif // def DEBUG | 763 #endif // def DEBUG |
| 764 return Serializer::enabled(); | 764 return Serializer::enabled(); |
| 765 } else if (rmode_ == RelocInfo::NONE) { | 765 } else if (rmode_ == RelocInfo::NONE) { |
| 766 return false; | 766 return false; |
| 767 } | 767 } |
| 768 return true; | 768 return true; |
| 769 } | 769 } |
| 770 | 770 |
| 771 | 771 |
| 772 bool Operand::is_single_instruction() const { | 772 bool Operand::is_single_instruction(Instr instr) const { |
| 773 if (rm_.is_valid()) return true; | 773 if (rm_.is_valid()) return true; |
| 774 if (must_use_constant_pool()) return false; | |
| 775 uint32_t dummy1, dummy2; | 774 uint32_t dummy1, dummy2; |
| 776 return fits_shifter(imm32_, &dummy1, &dummy2, NULL); | 775 if (must_use_constant_pool() || |
| 776 !fits_shifter(imm32_, &dummy1, &dummy2, &instr)) { |
| 777 // The immediate operand cannot be encoded as a shifter operand, or use of |
| 778 // constant pool is required. For a mov instruction not setting the |
| 779 // condition code additional instruction conventions can be used. |
| 780 if ((instr & ~kCondMask) == 13*B21) { // mov, S not set |
| 781 if (must_use_constant_pool() || |
| 782 !Isolate::Current()->cpu_features()->IsSupported(ARMv7)) { |
| 783 // mov instruction will be an ldr from constant pool (one instruction). |
| 784 return true; |
| 785 } else { |
| 786 // mov instruction will be a mov or movw followed by movt (two |
| 787 // instructions). |
| 788 return false; |
| 789 } |
| 790 } else { |
| 791 // If this is not a mov or mvn instruction there will always an additional |
| 792 // instructions - either mov or ldr. The mov might actually be two |
| 793 // instructions mov or movw followed by movt so including the actual |
| 794 // instruction two or three instructions will be generated. |
| 795 return false; |
| 796 } |
| 797 } else { |
| 798 // No use of constant pool and the immediate operand can be encoded as a |
| 799 // shifter operand. |
| 800 return true; |
| 801 } |
| 777 } | 802 } |
| 778 | 803 |
| 779 | 804 |
| 780 void Assembler::addrmod1(Instr instr, | 805 void Assembler::addrmod1(Instr instr, |
| 781 Register rn, | 806 Register rn, |
| 782 Register rd, | 807 Register rd, |
| 783 const Operand& x) { | 808 const Operand& x) { |
| 784 CheckBuffer(); | 809 CheckBuffer(); |
| 785 ASSERT((instr & ~(kCondMask | kOpCodeMask | S)) == 0); | 810 ASSERT((instr & ~(kCondMask | kOpCodeMask | S)) == 0); |
| 786 if (!x.rm_.is_valid()) { | 811 if (!x.rm_.is_valid()) { |
| (...skipping 1963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2750 | 2775 |
| 2751 // Since a constant pool was just emitted, move the check offset forward by | 2776 // Since a constant pool was just emitted, move the check offset forward by |
| 2752 // the standard interval. | 2777 // the standard interval. |
| 2753 next_buffer_check_ = pc_offset() + kCheckConstInterval; | 2778 next_buffer_check_ = pc_offset() + kCheckConstInterval; |
| 2754 } | 2779 } |
| 2755 | 2780 |
| 2756 | 2781 |
| 2757 } } // namespace v8::internal | 2782 } } // namespace v8::internal |
| 2758 | 2783 |
| 2759 #endif // V8_TARGET_ARCH_ARM | 2784 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |