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 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1107 __ Push(v0, a2, a1, a0); | 1107 __ Push(v0, a2, a1, a0); |
1108 __ jmp(&loop); | 1108 __ jmp(&loop); |
1109 | 1109 |
1110 __ bind(&no_descriptors); | 1110 __ bind(&no_descriptors); |
1111 __ Drop(1); | 1111 __ Drop(1); |
1112 __ jmp(&exit); | 1112 __ jmp(&exit); |
1113 | 1113 |
1114 // We got a fixed array in register v0. Iterate through that. | 1114 // We got a fixed array in register v0. Iterate through that. |
1115 __ bind(&fixed_array); | 1115 __ bind(&fixed_array); |
1116 | 1116 |
| 1117 int const vector_index = SmiFromSlot(slot)->value(); |
1117 __ EmitLoadTypeFeedbackVector(a1); | 1118 __ EmitLoadTypeFeedbackVector(a1); |
1118 __ li(a2, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); | 1119 __ li(a2, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); |
1119 int vector_index = SmiFromSlot(slot)->value(); | |
1120 __ sd(a2, FieldMemOperand(a1, FixedArray::OffsetOfElementAt(vector_index))); | 1120 __ sd(a2, FieldMemOperand(a1, FixedArray::OffsetOfElementAt(vector_index))); |
1121 | 1121 |
1122 __ li(a1, Operand(Smi::FromInt(1))); // Smi(1) indicates slow check | 1122 __ li(a1, Operand(Smi::FromInt(1))); // Smi(1) indicates slow check |
1123 __ Push(a1, v0); // Smi and array | 1123 __ Push(a1, v0); // Smi and array |
1124 __ ld(a1, FieldMemOperand(v0, FixedArray::kLengthOffset)); | 1124 __ ld(a1, FieldMemOperand(v0, FixedArray::kLengthOffset)); |
1125 __ Push(a1); // Fixed array length (as smi). | 1125 __ Push(a1); // Fixed array length (as smi). |
1126 PrepareForBailoutForId(stmt->PrepareId(), NO_REGISTERS); | 1126 PrepareForBailoutForId(stmt->PrepareId(), NO_REGISTERS); |
1127 __ li(a0, Operand(Smi::FromInt(0))); | 1127 __ li(a0, Operand(Smi::FromInt(0))); |
1128 __ Push(a0); // Initial index. | 1128 __ Push(a0); // Initial index. |
1129 | 1129 |
(...skipping 17 matching lines...) Expand all Loading... |
1147 // permanent slow case into register a2. | 1147 // permanent slow case into register a2. |
1148 __ ld(a2, MemOperand(sp, 3 * kPointerSize)); | 1148 __ ld(a2, MemOperand(sp, 3 * kPointerSize)); |
1149 | 1149 |
1150 // Check if the expected map still matches that of the enumerable. | 1150 // Check if the expected map still matches that of the enumerable. |
1151 // If not, we may have to filter the key. | 1151 // If not, we may have to filter the key. |
1152 Label update_each; | 1152 Label update_each; |
1153 __ ld(a1, MemOperand(sp, 4 * kPointerSize)); | 1153 __ ld(a1, MemOperand(sp, 4 * kPointerSize)); |
1154 __ ld(a4, FieldMemOperand(a1, HeapObject::kMapOffset)); | 1154 __ ld(a4, FieldMemOperand(a1, HeapObject::kMapOffset)); |
1155 __ Branch(&update_each, eq, a4, Operand(a2)); | 1155 __ Branch(&update_each, eq, a4, Operand(a2)); |
1156 | 1156 |
| 1157 // We might get here from TurboFan or Crankshaft when something in the |
| 1158 // for-in loop body deopts and only now notice in fullcodegen, that we |
| 1159 // can now longer use the enum cache, i.e. left fast mode. So better record |
| 1160 // this information here, in case we later OSR back into this loop or |
| 1161 // reoptimize the whole function w/o rerunning the loop with the slow |
| 1162 // mode object in fullcodegen (which would result in a deopt loop). |
| 1163 __ EmitLoadTypeFeedbackVector(a0); |
| 1164 __ li(a2, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); |
| 1165 __ sd(a2, FieldMemOperand(a0, FixedArray::OffsetOfElementAt(vector_index))); |
| 1166 |
1157 // Convert the entry to a string or (smi) 0 if it isn't a property | 1167 // Convert the entry to a string or (smi) 0 if it isn't a property |
1158 // any more. If the property has been removed while iterating, we | 1168 // any more. If the property has been removed while iterating, we |
1159 // just skip it. | 1169 // just skip it. |
1160 __ Push(a1, a3); // Enumerable and current entry. | 1170 __ Push(a1, a3); // Enumerable and current entry. |
1161 __ CallRuntime(Runtime::kForInFilter); | 1171 __ CallRuntime(Runtime::kForInFilter); |
1162 PrepareForBailoutForId(stmt->FilterId(), TOS_REG); | 1172 PrepareForBailoutForId(stmt->FilterId(), TOS_REG); |
1163 __ mov(a3, result_register()); | 1173 __ mov(a3, result_register()); |
1164 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); | 1174 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); |
1165 __ Branch(loop_statement.continue_label(), eq, a3, Operand(at)); | 1175 __ Branch(loop_statement.continue_label(), eq, a3, Operand(at)); |
1166 | 1176 |
(...skipping 3657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4824 reinterpret_cast<uint64_t>( | 4834 reinterpret_cast<uint64_t>( |
4825 isolate->builtins()->OsrAfterStackCheck()->entry())); | 4835 isolate->builtins()->OsrAfterStackCheck()->entry())); |
4826 return OSR_AFTER_STACK_CHECK; | 4836 return OSR_AFTER_STACK_CHECK; |
4827 } | 4837 } |
4828 | 4838 |
4829 | 4839 |
4830 } // namespace internal | 4840 } // namespace internal |
4831 } // namespace v8 | 4841 } // namespace v8 |
4832 | 4842 |
4833 #endif // V8_TARGET_ARCH_MIPS64 | 4843 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |