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 4834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4845 __ AllocateInNewSpace(size, elements_reg, scratch1, scratch2, &slow, | 4845 __ AllocateInNewSpace(size, elements_reg, scratch1, scratch2, &slow, |
4846 TAG_OBJECT); | 4846 TAG_OBJECT); |
4847 | 4847 |
4848 // Initialize the new FixedDoubleArray. | 4848 // Initialize the new FixedDoubleArray. |
4849 __ LoadRoot(scratch1, Heap::kFixedDoubleArrayMapRootIndex); | 4849 __ LoadRoot(scratch1, Heap::kFixedDoubleArrayMapRootIndex); |
4850 __ sw(scratch1, FieldMemOperand(elements_reg, JSObject::kMapOffset)); | 4850 __ sw(scratch1, FieldMemOperand(elements_reg, JSObject::kMapOffset)); |
4851 __ li(scratch1, Operand(Smi::FromInt(JSArray::kPreallocatedArrayElements))); | 4851 __ li(scratch1, Operand(Smi::FromInt(JSArray::kPreallocatedArrayElements))); |
4852 __ sw(scratch1, | 4852 __ sw(scratch1, |
4853 FieldMemOperand(elements_reg, FixedDoubleArray::kLengthOffset)); | 4853 FieldMemOperand(elements_reg, FixedDoubleArray::kLengthOffset)); |
4854 | 4854 |
4855 __ li(scratch1, Operand(kHoleNanLower32)); | |
4856 __ li(scratch2, Operand(kHoleNanUpper32)); | |
4857 for (int i = 1; i < JSArray::kPreallocatedArrayElements; i++) { | |
4858 int offset = FixedDoubleArray::OffsetOfElementAt(i); | |
4859 __ sw(scratch1, FieldMemOperand(elements_reg, offset)); | |
4860 __ sw(scratch2, FieldMemOperand(elements_reg, offset + kPointerSize)); | |
4861 } | |
4862 | |
4863 __ mov(scratch1, elements_reg); | 4855 __ mov(scratch1, elements_reg); |
4864 __ StoreNumberToDoubleElements(value_reg, | 4856 __ StoreNumberToDoubleElements(value_reg, |
4865 key_reg, | 4857 key_reg, |
4866 // All registers after this are overwritten. | 4858 // All registers after this are overwritten. |
4867 scratch1, | 4859 scratch1, |
4868 scratch2, | 4860 scratch2, |
4869 scratch3, | 4861 scratch3, |
4870 scratch4, | 4862 scratch4, |
4871 scratch5, | 4863 scratch5, |
4872 &transition_elements_kind); | 4864 &transition_elements_kind); |
4873 | 4865 |
| 4866 __ li(scratch1, Operand(kHoleNanLower32)); |
| 4867 __ li(scratch2, Operand(kHoleNanUpper32)); |
| 4868 for (int i = 1; i < JSArray::kPreallocatedArrayElements; i++) { |
| 4869 int offset = FixedDoubleArray::OffsetOfElementAt(i); |
| 4870 __ sw(scratch1, FieldMemOperand(elements_reg, offset)); |
| 4871 __ sw(scratch2, FieldMemOperand(elements_reg, offset + kPointerSize)); |
| 4872 } |
| 4873 |
4874 // Install the new backing store in the JSArray. | 4874 // Install the new backing store in the JSArray. |
4875 __ sw(elements_reg, | 4875 __ sw(elements_reg, |
4876 FieldMemOperand(receiver_reg, JSObject::kElementsOffset)); | 4876 FieldMemOperand(receiver_reg, JSObject::kElementsOffset)); |
4877 __ RecordWriteField(receiver_reg, JSObject::kElementsOffset, elements_reg, | 4877 __ RecordWriteField(receiver_reg, JSObject::kElementsOffset, elements_reg, |
4878 scratch1, kRAHasNotBeenSaved, kDontSaveFPRegs, | 4878 scratch1, kRAHasNotBeenSaved, kDontSaveFPRegs, |
4879 EMIT_REMEMBERED_SET, OMIT_SMI_CHECK); | 4879 EMIT_REMEMBERED_SET, OMIT_SMI_CHECK); |
4880 | 4880 |
4881 // Increment the length of the array. | 4881 // Increment the length of the array. |
4882 __ li(length_reg, Operand(Smi::FromInt(1))); | 4882 __ li(length_reg, Operand(Smi::FromInt(1))); |
4883 __ sw(length_reg, FieldMemOperand(receiver_reg, JSArray::kLengthOffset)); | 4883 __ sw(length_reg, FieldMemOperand(receiver_reg, JSArray::kLengthOffset)); |
(...skipping 17 matching lines...) Expand all Loading... |
4901 __ Jump(ic_slow, RelocInfo::CODE_TARGET); | 4901 __ Jump(ic_slow, RelocInfo::CODE_TARGET); |
4902 } | 4902 } |
4903 } | 4903 } |
4904 | 4904 |
4905 | 4905 |
4906 #undef __ | 4906 #undef __ |
4907 | 4907 |
4908 } } // namespace v8::internal | 4908 } } // namespace v8::internal |
4909 | 4909 |
4910 #endif // V8_TARGET_ARCH_MIPS | 4910 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |