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 #if V8_TARGET_ARCH_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
6 | 6 |
7 // Note on Mips implementation: | 7 // Note on Mips implementation: |
8 // | 8 // |
9 // The result_register() for mips is the 'v0' register, which is defined | 9 // The result_register() for mips is the 'v0' register, which is defined |
10 // by the ABI to contain function return values. However, the first | 10 // by the ABI to contain function return values. However, the first |
(...skipping 3786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3797 // Get the FixedArray containing array's elements. | 3797 // Get the FixedArray containing array's elements. |
3798 elements = array; | 3798 elements = array; |
3799 __ ld(elements, FieldMemOperand(array, JSArray::kElementsOffset)); | 3799 __ ld(elements, FieldMemOperand(array, JSArray::kElementsOffset)); |
3800 array = no_reg; // End of array's live range. | 3800 array = no_reg; // End of array's live range. |
3801 | 3801 |
3802 // Check that all array elements are sequential one-byte strings, and | 3802 // Check that all array elements are sequential one-byte strings, and |
3803 // accumulate the sum of their lengths, as a smi-encoded value. | 3803 // accumulate the sum of their lengths, as a smi-encoded value. |
3804 __ mov(string_length, zero_reg); | 3804 __ mov(string_length, zero_reg); |
3805 __ Daddu(element, | 3805 __ Daddu(element, |
3806 elements, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); | 3806 elements, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); |
3807 __ dsll(elements_end, array_length, kPointerSizeLog2); | 3807 __ Dlsa(elements_end, element, array_length, kPointerSizeLog2); |
3808 __ Daddu(elements_end, element, elements_end); | |
3809 // Loop condition: while (element < elements_end). | 3808 // Loop condition: while (element < elements_end). |
3810 // Live values in registers: | 3809 // Live values in registers: |
3811 // elements: Fixed array of strings. | 3810 // elements: Fixed array of strings. |
3812 // array_length: Length of the fixed array of strings (not smi) | 3811 // array_length: Length of the fixed array of strings (not smi) |
3813 // separator: Separator string | 3812 // separator: Separator string |
3814 // string_length: Accumulated sum of string lengths (smi). | 3813 // string_length: Accumulated sum of string lengths (smi). |
3815 // element: Current array element. | 3814 // element: Current array element. |
3816 // elements_end: Array end. | 3815 // elements_end: Array end. |
3817 if (generate_debug_code_) { | 3816 if (generate_debug_code_) { |
3818 __ Assert(gt, kNoEmptyArraysHereInEmitFastOneByteArrayJoin, array_length, | 3817 __ Assert(gt, kNoEmptyArraysHereInEmitFastOneByteArrayJoin, array_length, |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3877 // Live values in registers: | 3876 // Live values in registers: |
3878 // element: First array element | 3877 // element: First array element |
3879 // separator: Separator string | 3878 // separator: Separator string |
3880 // string_length: Length of result string (not smi) | 3879 // string_length: Length of result string (not smi) |
3881 // array_length: Length of the array. | 3880 // array_length: Length of the array. |
3882 __ AllocateOneByteString(result, string_length, scratch1, scratch2, | 3881 __ AllocateOneByteString(result, string_length, scratch1, scratch2, |
3883 elements_end, &bailout); | 3882 elements_end, &bailout); |
3884 // Prepare for looping. Set up elements_end to end of the array. Set | 3883 // Prepare for looping. Set up elements_end to end of the array. Set |
3885 // result_pos to the position of the result where to write the first | 3884 // result_pos to the position of the result where to write the first |
3886 // character. | 3885 // character. |
3887 __ dsll(elements_end, array_length, kPointerSizeLog2); | 3886 __ Dlsa(elements_end, element, array_length, kPointerSizeLog2); |
3888 __ Daddu(elements_end, element, elements_end); | |
3889 result_pos = array_length; // End of live range for array_length. | 3887 result_pos = array_length; // End of live range for array_length. |
3890 array_length = no_reg; | 3888 array_length = no_reg; |
3891 __ Daddu(result_pos, | 3889 __ Daddu(result_pos, |
3892 result, | 3890 result, |
3893 Operand(SeqOneByteString::kHeaderSize - kHeapObjectTag)); | 3891 Operand(SeqOneByteString::kHeaderSize - kHeapObjectTag)); |
3894 | 3892 |
3895 // Check the length of the separator. | 3893 // Check the length of the separator. |
3896 __ ld(scratch1, FieldMemOperand(separator, SeqOneByteString::kLengthOffset)); | 3894 __ ld(scratch1, FieldMemOperand(separator, SeqOneByteString::kLengthOffset)); |
3897 __ li(at, Operand(Smi::FromInt(1))); | 3895 __ li(at, Operand(Smi::FromInt(1))); |
3898 __ Branch(&one_char_separator, eq, scratch1, Operand(at)); | 3896 __ Branch(&one_char_separator, eq, scratch1, Operand(at)); |
(...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4840 reinterpret_cast<uint64_t>( | 4838 reinterpret_cast<uint64_t>( |
4841 isolate->builtins()->OsrAfterStackCheck()->entry())); | 4839 isolate->builtins()->OsrAfterStackCheck()->entry())); |
4842 return OSR_AFTER_STACK_CHECK; | 4840 return OSR_AFTER_STACK_CHECK; |
4843 } | 4841 } |
4844 | 4842 |
4845 | 4843 |
4846 } // namespace internal | 4844 } // namespace internal |
4847 } // namespace v8 | 4845 } // namespace v8 |
4848 | 4846 |
4849 #endif // V8_TARGET_ARCH_MIPS64 | 4847 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |