OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 4728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4739 | 4739 |
4740 void KeyedStoreStubCompiler::GenerateStoreFastDoubleElement( | 4740 void KeyedStoreStubCompiler::GenerateStoreFastDoubleElement( |
4741 MacroAssembler* masm, | 4741 MacroAssembler* masm, |
4742 bool is_js_array, | 4742 bool is_js_array, |
4743 KeyedAccessGrowMode grow_mode) { | 4743 KeyedAccessGrowMode grow_mode) { |
4744 // ----------- S t a t e ------------- | 4744 // ----------- S t a t e ------------- |
4745 // -- a0 : value | 4745 // -- a0 : value |
4746 // -- a1 : key | 4746 // -- a1 : key |
4747 // -- a2 : receiver | 4747 // -- a2 : receiver |
4748 // -- ra : return address | 4748 // -- ra : return address |
4749 // -- a3 : scratch | 4749 // -- a3 : scratch (elements backing store) |
4750 // -- t0 : scratch (elements_reg) | 4750 // -- t0 : scratch (elements_reg) |
4751 // -- t1 : scratch (mantissa_reg) | 4751 // -- t1 : scratch (mantissa_reg) |
4752 // -- t2 : scratch (exponent_reg) | 4752 // -- t2 : scratch (exponent_reg) |
4753 // -- t3 : scratch4 | 4753 // -- t3 : scratch4 |
| 4754 // -- t4 : scratch |
4754 // ----------------------------------- | 4755 // ----------------------------------- |
4755 Label miss_force_generic, transition_elements_kind, grow, slow; | 4756 Label miss_force_generic, transition_elements_kind, grow, slow; |
4756 Label finish_store, check_capacity; | 4757 Label finish_store, check_capacity; |
4757 | 4758 |
4758 Register value_reg = a0; | 4759 Register value_reg = a0; |
4759 Register key_reg = a1; | 4760 Register key_reg = a1; |
4760 Register receiver_reg = a2; | 4761 Register receiver_reg = a2; |
4761 Register elements_reg = a3; | 4762 Register elements_reg = a3; |
4762 Register scratch1 = t0; | 4763 Register scratch1 = t0; |
4763 Register scratch2 = t1; | 4764 Register scratch2 = t1; |
4764 Register scratch3 = t2; | 4765 Register scratch3 = t2; |
4765 Register scratch4 = t3; | 4766 Register scratch4 = t3; |
| 4767 Register scratch5 = t4; |
4766 Register length_reg = t3; | 4768 Register length_reg = t3; |
4767 | 4769 |
4768 // This stub is meant to be tail-jumped to, the receiver must already | 4770 // This stub is meant to be tail-jumped to, the receiver must already |
4769 // have been verified by the caller to not be a smi. | 4771 // have been verified by the caller to not be a smi. |
4770 | 4772 |
4771 // Check that the key is a smi or a heap number convertible to a smi. | 4773 // Check that the key is a smi or a heap number convertible to a smi. |
4772 GenerateSmiKeyCheck(masm, key_reg, t0, t1, f2, &miss_force_generic); | 4774 GenerateSmiKeyCheck(masm, key_reg, t0, t1, f2, &miss_force_generic); |
4773 | 4775 |
4774 __ lw(elements_reg, | 4776 __ lw(elements_reg, |
4775 FieldMemOperand(receiver_reg, JSObject::kElementsOffset)); | 4777 FieldMemOperand(receiver_reg, JSObject::kElementsOffset)); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4851 FieldMemOperand(elements_reg, FixedDoubleArray::kLengthOffset)); | 4853 FieldMemOperand(elements_reg, FixedDoubleArray::kLengthOffset)); |
4852 | 4854 |
4853 __ li(scratch1, Operand(kHoleNanLower32)); | 4855 __ li(scratch1, Operand(kHoleNanLower32)); |
4854 __ li(scratch2, Operand(kHoleNanUpper32)); | 4856 __ li(scratch2, Operand(kHoleNanUpper32)); |
4855 for (int i = 1; i < JSArray::kPreallocatedArrayElements; i++) { | 4857 for (int i = 1; i < JSArray::kPreallocatedArrayElements; i++) { |
4856 int offset = FixedDoubleArray::OffsetOfElementAt(i); | 4858 int offset = FixedDoubleArray::OffsetOfElementAt(i); |
4857 __ sw(scratch1, FieldMemOperand(elements_reg, offset)); | 4859 __ sw(scratch1, FieldMemOperand(elements_reg, offset)); |
4858 __ sw(scratch2, FieldMemOperand(elements_reg, offset + kPointerSize)); | 4860 __ sw(scratch2, FieldMemOperand(elements_reg, offset + kPointerSize)); |
4859 } | 4861 } |
4860 | 4862 |
| 4863 __ mov(scratch1, elements_reg); |
4861 __ StoreNumberToDoubleElements(value_reg, | 4864 __ StoreNumberToDoubleElements(value_reg, |
4862 key_reg, | 4865 key_reg, |
4863 // All registers after this are overwritten. | 4866 // All registers after this are overwritten. |
4864 elements_reg, | |
4865 scratch1, | 4867 scratch1, |
4866 scratch2, | 4868 scratch2, |
4867 scratch3, | 4869 scratch3, |
4868 scratch4, | 4870 scratch4, |
| 4871 scratch5, |
4869 &transition_elements_kind); | 4872 &transition_elements_kind); |
4870 | 4873 |
4871 // Install the new backing store in the JSArray. | 4874 // Install the new backing store in the JSArray. |
4872 __ sw(elements_reg, | 4875 __ sw(elements_reg, |
4873 FieldMemOperand(receiver_reg, JSObject::kElementsOffset)); | 4876 FieldMemOperand(receiver_reg, JSObject::kElementsOffset)); |
4874 __ RecordWriteField(receiver_reg, JSObject::kElementsOffset, elements_reg, | 4877 __ RecordWriteField(receiver_reg, JSObject::kElementsOffset, elements_reg, |
4875 scratch1, kRAHasNotBeenSaved, kDontSaveFPRegs, | 4878 scratch1, kRAHasNotBeenSaved, kDontSaveFPRegs, |
4876 EMIT_REMEMBERED_SET, OMIT_SMI_CHECK); | 4879 EMIT_REMEMBERED_SET, OMIT_SMI_CHECK); |
4877 | 4880 |
4878 // Increment the length of the array. | 4881 // Increment the length of the array. |
(...skipping 19 matching lines...) Expand all Loading... |
4898 __ Jump(ic_slow, RelocInfo::CODE_TARGET); | 4901 __ Jump(ic_slow, RelocInfo::CODE_TARGET); |
4899 } | 4902 } |
4900 } | 4903 } |
4901 | 4904 |
4902 | 4905 |
4903 #undef __ | 4906 #undef __ |
4904 | 4907 |
4905 } } // namespace v8::internal | 4908 } } // namespace v8::internal |
4906 | 4909 |
4907 #endif // V8_TARGET_ARCH_MIPS | 4910 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |