OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/mips64/codegen-mips64.h" | 5 #include "src/mips64/codegen-mips64.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_MIPS64 | 7 #if V8_TARGET_ARCH_MIPS64 |
8 | 8 |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/macro-assembler.h" | 10 #include "src/macro-assembler.h" |
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
725 | 725 |
726 __ push(ra); | 726 __ push(ra); |
727 __ ld(length, FieldMemOperand(elements, FixedArray::kLengthOffset)); | 727 __ ld(length, FieldMemOperand(elements, FixedArray::kLengthOffset)); |
728 // elements: source FixedArray | 728 // elements: source FixedArray |
729 // length: number of elements (smi-tagged) | 729 // length: number of elements (smi-tagged) |
730 | 730 |
731 // Allocate new FixedDoubleArray. | 731 // Allocate new FixedDoubleArray. |
732 __ SmiScale(scratch, length, kDoubleSizeLog2); | 732 __ SmiScale(scratch, length, kDoubleSizeLog2); |
733 __ Daddu(scratch, scratch, FixedDoubleArray::kHeaderSize); | 733 __ Daddu(scratch, scratch, FixedDoubleArray::kHeaderSize); |
734 __ Allocate(scratch, array, t3, scratch2, &gc_required, DOUBLE_ALIGNMENT); | 734 __ Allocate(scratch, array, t3, scratch2, &gc_required, DOUBLE_ALIGNMENT); |
| 735 __ Dsubu(array, array, kHeapObjectTag); |
735 // array: destination FixedDoubleArray, not tagged as heap object | 736 // array: destination FixedDoubleArray, not tagged as heap object |
736 | 737 |
737 // Set destination FixedDoubleArray's length and map. | 738 // Set destination FixedDoubleArray's length and map. |
738 __ LoadRoot(scratch2, Heap::kFixedDoubleArrayMapRootIndex); | 739 __ LoadRoot(scratch2, Heap::kFixedDoubleArrayMapRootIndex); |
739 __ sd(length, MemOperand(array, FixedDoubleArray::kLengthOffset)); | 740 __ sd(length, MemOperand(array, FixedDoubleArray::kLengthOffset)); |
740 // Update receiver's map. | 741 // Update receiver's map. |
741 __ sd(scratch2, MemOperand(array, HeapObject::kMapOffset)); | 742 __ sd(scratch2, MemOperand(array, HeapObject::kMapOffset)); |
742 | 743 |
743 __ sd(target_map, FieldMemOperand(receiver, HeapObject::kMapOffset)); | 744 __ sd(target_map, FieldMemOperand(receiver, HeapObject::kMapOffset)); |
744 __ RecordWriteField(receiver, | 745 __ RecordWriteField(receiver, |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
875 | 876 |
876 // Allocate new FixedArray. | 877 // Allocate new FixedArray. |
877 // Re-use value and target_map registers, as they have been saved on the | 878 // Re-use value and target_map registers, as they have been saved on the |
878 // stack. | 879 // stack. |
879 Register array_size = value; | 880 Register array_size = value; |
880 Register allocate_scratch = target_map; | 881 Register allocate_scratch = target_map; |
881 __ SmiScale(array_size, length, kPointerSizeLog2); | 882 __ SmiScale(array_size, length, kPointerSizeLog2); |
882 __ Daddu(array_size, array_size, FixedDoubleArray::kHeaderSize); | 883 __ Daddu(array_size, array_size, FixedDoubleArray::kHeaderSize); |
883 __ Allocate(array_size, array, allocate_scratch, scratch, &gc_required, | 884 __ Allocate(array_size, array, allocate_scratch, scratch, &gc_required, |
884 NO_ALLOCATION_FLAGS); | 885 NO_ALLOCATION_FLAGS); |
| 886 __ Dsubu(array, array, kHeapObjectTag); |
885 // array: destination FixedArray, not tagged as heap object | 887 // array: destination FixedArray, not tagged as heap object |
886 // Set destination FixedDoubleArray's length and map. | 888 // Set destination FixedDoubleArray's length and map. |
887 __ LoadRoot(scratch, Heap::kFixedArrayMapRootIndex); | 889 __ LoadRoot(scratch, Heap::kFixedArrayMapRootIndex); |
888 __ sd(length, MemOperand(array, FixedDoubleArray::kLengthOffset)); | 890 __ sd(length, MemOperand(array, FixedDoubleArray::kLengthOffset)); |
889 __ sd(scratch, MemOperand(array, HeapObject::kMapOffset)); | 891 __ sd(scratch, MemOperand(array, HeapObject::kMapOffset)); |
890 | 892 |
891 // Prepare for conversion loop. | 893 // Prepare for conversion loop. |
892 Register src_elements = elements; | 894 Register src_elements = elements; |
893 Register dst_elements = target_map; | 895 Register dst_elements = target_map; |
894 Register dst_end = length; | 896 Register dst_end = length; |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1256 } | 1258 } |
1257 } | 1259 } |
1258 | 1260 |
1259 | 1261 |
1260 #undef __ | 1262 #undef __ |
1261 | 1263 |
1262 } // namespace internal | 1264 } // namespace internal |
1263 } // namespace v8 | 1265 } // namespace v8 |
1264 | 1266 |
1265 #endif // V8_TARGET_ARCH_MIPS64 | 1267 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |