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_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
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 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1133 SetExpressionAsStatementPosition(stmt->each()); | 1133 SetExpressionAsStatementPosition(stmt->each()); |
1134 | 1134 |
1135 // Load the current count to a0, load the length to a1. | 1135 // Load the current count to a0, load the length to a1. |
1136 __ lw(a0, MemOperand(sp, 0 * kPointerSize)); | 1136 __ lw(a0, MemOperand(sp, 0 * kPointerSize)); |
1137 __ lw(a1, MemOperand(sp, 1 * kPointerSize)); | 1137 __ lw(a1, MemOperand(sp, 1 * kPointerSize)); |
1138 __ Branch(loop_statement.break_label(), hs, a0, Operand(a1)); | 1138 __ Branch(loop_statement.break_label(), hs, a0, Operand(a1)); |
1139 | 1139 |
1140 // Get the current entry of the array into register a3. | 1140 // Get the current entry of the array into register a3. |
1141 __ lw(a2, MemOperand(sp, 2 * kPointerSize)); | 1141 __ lw(a2, MemOperand(sp, 2 * kPointerSize)); |
1142 __ Addu(a2, a2, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); | 1142 __ Addu(a2, a2, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); |
1143 __ sll(t0, a0, kPointerSizeLog2 - kSmiTagSize); | 1143 __ Lsa(t0, a2, a0, kPointerSizeLog2 - kSmiTagSize); |
1144 __ addu(t0, a2, t0); // Array base + scaled (smi) index. | |
1145 __ lw(a3, MemOperand(t0)); // Current entry. | 1144 __ lw(a3, MemOperand(t0)); // Current entry. |
1146 | 1145 |
1147 // Get the expected map from the stack or a smi in the | 1146 // Get the expected map from the stack or a smi in the |
1148 // permanent slow case into register a2. | 1147 // permanent slow case into register a2. |
1149 __ lw(a2, MemOperand(sp, 3 * kPointerSize)); | 1148 __ lw(a2, MemOperand(sp, 3 * kPointerSize)); |
1150 | 1149 |
1151 // Check if the expected map still matches that of the enumerable. | 1150 // Check if the expected map still matches that of the enumerable. |
1152 // If not, we may have to filter the key. | 1151 // If not, we may have to filter the key. |
1153 Label update_each; | 1152 Label update_each; |
1154 __ lw(a1, MemOperand(sp, 4 * kPointerSize)); | 1153 __ lw(a1, MemOperand(sp, 4 * kPointerSize)); |
(...skipping 2636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3791 // Get the FixedArray containing array's elements. | 3790 // Get the FixedArray containing array's elements. |
3792 elements = array; | 3791 elements = array; |
3793 __ lw(elements, FieldMemOperand(array, JSArray::kElementsOffset)); | 3792 __ lw(elements, FieldMemOperand(array, JSArray::kElementsOffset)); |
3794 array = no_reg; // End of array's live range. | 3793 array = no_reg; // End of array's live range. |
3795 | 3794 |
3796 // Check that all array elements are sequential one-byte strings, and | 3795 // Check that all array elements are sequential one-byte strings, and |
3797 // accumulate the sum of their lengths, as a smi-encoded value. | 3796 // accumulate the sum of their lengths, as a smi-encoded value. |
3798 __ mov(string_length, zero_reg); | 3797 __ mov(string_length, zero_reg); |
3799 __ Addu(element, | 3798 __ Addu(element, |
3800 elements, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); | 3799 elements, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); |
3801 __ sll(elements_end, array_length, kPointerSizeLog2); | 3800 __ Lsa(elements_end, element, array_length, kPointerSizeLog2); |
3802 __ Addu(elements_end, element, elements_end); | |
3803 // Loop condition: while (element < elements_end). | 3801 // Loop condition: while (element < elements_end). |
3804 // Live values in registers: | 3802 // Live values in registers: |
3805 // elements: Fixed array of strings. | 3803 // elements: Fixed array of strings. |
3806 // array_length: Length of the fixed array of strings (not smi) | 3804 // array_length: Length of the fixed array of strings (not smi) |
3807 // separator: Separator string | 3805 // separator: Separator string |
3808 // string_length: Accumulated sum of string lengths (smi). | 3806 // string_length: Accumulated sum of string lengths (smi). |
3809 // element: Current array element. | 3807 // element: Current array element. |
3810 // elements_end: Array end. | 3808 // elements_end: Array end. |
3811 if (generate_debug_code_) { | 3809 if (generate_debug_code_) { |
3812 __ Assert(gt, kNoEmptyArraysHereInEmitFastOneByteArrayJoin, array_length, | 3810 __ Assert(gt, kNoEmptyArraysHereInEmitFastOneByteArrayJoin, array_length, |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3869 // Live values in registers: | 3867 // Live values in registers: |
3870 // element: First array element | 3868 // element: First array element |
3871 // separator: Separator string | 3869 // separator: Separator string |
3872 // string_length: Length of result string (not smi) | 3870 // string_length: Length of result string (not smi) |
3873 // array_length: Length of the array. | 3871 // array_length: Length of the array. |
3874 __ AllocateOneByteString(result, string_length, scratch1, scratch2, | 3872 __ AllocateOneByteString(result, string_length, scratch1, scratch2, |
3875 elements_end, &bailout); | 3873 elements_end, &bailout); |
3876 // Prepare for looping. Set up elements_end to end of the array. Set | 3874 // Prepare for looping. Set up elements_end to end of the array. Set |
3877 // result_pos to the position of the result where to write the first | 3875 // result_pos to the position of the result where to write the first |
3878 // character. | 3876 // character. |
3879 __ sll(elements_end, array_length, kPointerSizeLog2); | 3877 __ Lsa(elements_end, element, array_length, kPointerSizeLog2); |
3880 __ Addu(elements_end, element, elements_end); | |
3881 result_pos = array_length; // End of live range for array_length. | 3878 result_pos = array_length; // End of live range for array_length. |
3882 array_length = no_reg; | 3879 array_length = no_reg; |
3883 __ Addu(result_pos, | 3880 __ Addu(result_pos, |
3884 result, | 3881 result, |
3885 Operand(SeqOneByteString::kHeaderSize - kHeapObjectTag)); | 3882 Operand(SeqOneByteString::kHeaderSize - kHeapObjectTag)); |
3886 | 3883 |
3887 // Check the length of the separator. | 3884 // Check the length of the separator. |
3888 __ lw(scratch1, FieldMemOperand(separator, SeqOneByteString::kLengthOffset)); | 3885 __ lw(scratch1, FieldMemOperand(separator, SeqOneByteString::kLengthOffset)); |
3889 __ li(at, Operand(Smi::FromInt(1))); | 3886 __ li(at, Operand(Smi::FromInt(1))); |
3890 __ Branch(&one_char_separator, eq, scratch1, Operand(at)); | 3887 __ Branch(&one_char_separator, eq, scratch1, Operand(at)); |
(...skipping 936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4827 reinterpret_cast<uint32_t>( | 4824 reinterpret_cast<uint32_t>( |
4828 isolate->builtins()->OsrAfterStackCheck()->entry())); | 4825 isolate->builtins()->OsrAfterStackCheck()->entry())); |
4829 return OSR_AFTER_STACK_CHECK; | 4826 return OSR_AFTER_STACK_CHECK; |
4830 } | 4827 } |
4831 | 4828 |
4832 | 4829 |
4833 } // namespace internal | 4830 } // namespace internal |
4834 } // namespace v8 | 4831 } // namespace v8 |
4835 | 4832 |
4836 #endif // V8_TARGET_ARCH_MIPS | 4833 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |