OLD | NEW |
1 | 1 |
2 // Copyright 2012 the V8 project authors. All rights reserved. | 2 // Copyright 2012 the V8 project authors. All rights reserved. |
3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
5 | 5 |
6 #include <limits.h> // For LONG_MIN, LONG_MAX. | 6 #include <limits.h> // For LONG_MIN, LONG_MAX. |
7 | 7 |
8 #if V8_TARGET_ARCH_MIPS | 8 #if V8_TARGET_ARCH_MIPS |
9 | 9 |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 3696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3707 | 3707 |
3708 | 3708 |
3709 void MacroAssembler::StoreNumberToDoubleElements(Register value_reg, | 3709 void MacroAssembler::StoreNumberToDoubleElements(Register value_reg, |
3710 Register key_reg, | 3710 Register key_reg, |
3711 Register elements_reg, | 3711 Register elements_reg, |
3712 Register scratch1, | 3712 Register scratch1, |
3713 Register scratch2, | 3713 Register scratch2, |
3714 Register scratch3, | 3714 Register scratch3, |
3715 Label* fail, | 3715 Label* fail, |
3716 int elements_offset) { | 3716 int elements_offset) { |
| 3717 DCHECK(!AreAliased(value_reg, key_reg, elements_reg, scratch1, scratch2, |
| 3718 scratch3)); |
3717 Label smi_value, maybe_nan, have_double_value, is_nan, done; | 3719 Label smi_value, maybe_nan, have_double_value, is_nan, done; |
3718 Register mantissa_reg = scratch2; | 3720 Register mantissa_reg = scratch2; |
3719 Register exponent_reg = scratch3; | 3721 Register exponent_reg = scratch3; |
3720 | 3722 |
3721 // Handle smi values specially. | 3723 // Handle smi values specially. |
3722 JumpIfSmi(value_reg, &smi_value); | 3724 JumpIfSmi(value_reg, &smi_value); |
3723 | 3725 |
3724 // Ensure that the object is a heap number | 3726 // Ensure that the object is a heap number |
3725 CheckMap(value_reg, | 3727 CheckMap(value_reg, |
3726 scratch1, | 3728 scratch1, |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3761 jmp(&have_double_value); | 3763 jmp(&have_double_value); |
3762 | 3764 |
3763 bind(&smi_value); | 3765 bind(&smi_value); |
3764 Addu(scratch1, elements_reg, | 3766 Addu(scratch1, elements_reg, |
3765 Operand(FixedDoubleArray::kHeaderSize - kHeapObjectTag - | 3767 Operand(FixedDoubleArray::kHeaderSize - kHeapObjectTag - |
3766 elements_offset)); | 3768 elements_offset)); |
3767 sll(scratch2, key_reg, kDoubleSizeLog2 - kSmiTagSize); | 3769 sll(scratch2, key_reg, kDoubleSizeLog2 - kSmiTagSize); |
3768 Addu(scratch1, scratch1, scratch2); | 3770 Addu(scratch1, scratch1, scratch2); |
3769 // scratch1 is now effective address of the double element | 3771 // scratch1 is now effective address of the double element |
3770 | 3772 |
3771 Register untagged_value = elements_reg; | 3773 Register untagged_value = scratch2; |
3772 SmiUntag(untagged_value, value_reg); | 3774 SmiUntag(untagged_value, value_reg); |
3773 mtc1(untagged_value, f2); | 3775 mtc1(untagged_value, f2); |
3774 cvt_d_w(f0, f2); | 3776 cvt_d_w(f0, f2); |
3775 sdc1(f0, MemOperand(scratch1, 0)); | 3777 sdc1(f0, MemOperand(scratch1, 0)); |
3776 bind(&done); | 3778 bind(&done); |
3777 } | 3779 } |
3778 | 3780 |
3779 | 3781 |
3780 void MacroAssembler::CompareMapAndBranch(Register obj, | 3782 void MacroAssembler::CompareMapAndBranch(Register obj, |
3781 Register scratch, | 3783 Register scratch, |
(...skipping 1985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5767 lb(scratch1, FieldMemOperand(current, Map::kBitField2Offset)); | 5769 lb(scratch1, FieldMemOperand(current, Map::kBitField2Offset)); |
5768 DecodeField<Map::ElementsKindBits>(scratch1); | 5770 DecodeField<Map::ElementsKindBits>(scratch1); |
5769 Branch(found, eq, scratch1, Operand(DICTIONARY_ELEMENTS)); | 5771 Branch(found, eq, scratch1, Operand(DICTIONARY_ELEMENTS)); |
5770 lw(current, FieldMemOperand(current, Map::kPrototypeOffset)); | 5772 lw(current, FieldMemOperand(current, Map::kPrototypeOffset)); |
5771 Branch(&loop_again, ne, current, Operand(factory->null_value())); | 5773 Branch(&loop_again, ne, current, Operand(factory->null_value())); |
5772 | 5774 |
5773 bind(&end); | 5775 bind(&end); |
5774 } | 5776 } |
5775 | 5777 |
5776 | 5778 |
5777 bool AreAliased(Register reg1, | 5779 bool AreAliased(Register reg1, Register reg2, Register reg3, Register reg4, |
5778 Register reg2, | 5780 Register reg5, Register reg6, Register reg7, Register reg8, |
5779 Register reg3, | 5781 Register reg9, Register reg10) { |
5780 Register reg4, | 5782 int n_of_valid_regs = reg1.is_valid() + reg2.is_valid() + reg3.is_valid() + |
5781 Register reg5, | 5783 reg4.is_valid() + reg5.is_valid() + reg6.is_valid() + |
5782 Register reg6, | 5784 reg7.is_valid() + reg8.is_valid() + reg9.is_valid() + |
5783 Register reg7, | 5785 reg10.is_valid(); |
5784 Register reg8) { | |
5785 int n_of_valid_regs = reg1.is_valid() + reg2.is_valid() + | |
5786 reg3.is_valid() + reg4.is_valid() + reg5.is_valid() + reg6.is_valid() + | |
5787 reg7.is_valid() + reg8.is_valid(); | |
5788 | 5786 |
5789 RegList regs = 0; | 5787 RegList regs = 0; |
5790 if (reg1.is_valid()) regs |= reg1.bit(); | 5788 if (reg1.is_valid()) regs |= reg1.bit(); |
5791 if (reg2.is_valid()) regs |= reg2.bit(); | 5789 if (reg2.is_valid()) regs |= reg2.bit(); |
5792 if (reg3.is_valid()) regs |= reg3.bit(); | 5790 if (reg3.is_valid()) regs |= reg3.bit(); |
5793 if (reg4.is_valid()) regs |= reg4.bit(); | 5791 if (reg4.is_valid()) regs |= reg4.bit(); |
5794 if (reg5.is_valid()) regs |= reg5.bit(); | 5792 if (reg5.is_valid()) regs |= reg5.bit(); |
5795 if (reg6.is_valid()) regs |= reg6.bit(); | 5793 if (reg6.is_valid()) regs |= reg6.bit(); |
5796 if (reg7.is_valid()) regs |= reg7.bit(); | 5794 if (reg7.is_valid()) regs |= reg7.bit(); |
5797 if (reg8.is_valid()) regs |= reg8.bit(); | 5795 if (reg8.is_valid()) regs |= reg8.bit(); |
| 5796 if (reg9.is_valid()) regs |= reg9.bit(); |
| 5797 if (reg10.is_valid()) regs |= reg10.bit(); |
5798 int n_of_non_aliasing_regs = NumRegs(regs); | 5798 int n_of_non_aliasing_regs = NumRegs(regs); |
5799 | 5799 |
5800 return n_of_valid_regs != n_of_non_aliasing_regs; | 5800 return n_of_valid_regs != n_of_non_aliasing_regs; |
5801 } | 5801 } |
5802 | 5802 |
5803 | 5803 |
5804 CodePatcher::CodePatcher(Isolate* isolate, byte* address, int instructions, | 5804 CodePatcher::CodePatcher(Isolate* isolate, byte* address, int instructions, |
5805 FlushICache flush_cache) | 5805 FlushICache flush_cache) |
5806 : address_(address), | 5806 : address_(address), |
5807 size_(instructions * Assembler::kInstrSize), | 5807 size_(instructions * Assembler::kInstrSize), |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5863 if (mag.shift > 0) sra(result, result, mag.shift); | 5863 if (mag.shift > 0) sra(result, result, mag.shift); |
5864 srl(at, dividend, 31); | 5864 srl(at, dividend, 31); |
5865 Addu(result, result, Operand(at)); | 5865 Addu(result, result, Operand(at)); |
5866 } | 5866 } |
5867 | 5867 |
5868 | 5868 |
5869 } // namespace internal | 5869 } // namespace internal |
5870 } // namespace v8 | 5870 } // namespace v8 |
5871 | 5871 |
5872 #endif // V8_TARGET_ARCH_MIPS | 5872 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |