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 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1084 __ li(a0, Operand(Smi::FromInt(0))); | 1084 __ li(a0, Operand(Smi::FromInt(0))); |
1085 // Push map, enumeration cache, enumeration cache length (as smi) and zero. | 1085 // Push map, enumeration cache, enumeration cache length (as smi) and zero. |
1086 __ Push(v0, a2, a1, a0); | 1086 __ Push(v0, a2, a1, a0); |
1087 __ jmp(&loop); | 1087 __ jmp(&loop); |
1088 | 1088 |
1089 __ bind(&no_descriptors); | 1089 __ bind(&no_descriptors); |
1090 __ Drop(1); | 1090 __ Drop(1); |
1091 __ jmp(&exit); | 1091 __ jmp(&exit); |
1092 | 1092 |
1093 // We got a fixed array in register v0. Iterate through that. | 1093 // We got a fixed array in register v0. Iterate through that. |
1094 Label non_proxy; | |
1095 __ bind(&fixed_array); | 1094 __ bind(&fixed_array); |
1096 | 1095 |
1097 __ EmitLoadTypeFeedbackVector(a1); | 1096 __ EmitLoadTypeFeedbackVector(a1); |
1098 __ li(a2, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); | 1097 __ li(a2, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); |
1099 int vector_index = SmiFromSlot(slot)->value(); | 1098 int vector_index = SmiFromSlot(slot)->value(); |
1100 __ sw(a2, FieldMemOperand(a1, FixedArray::OffsetOfElementAt(vector_index))); | 1099 __ sw(a2, FieldMemOperand(a1, FixedArray::OffsetOfElementAt(vector_index))); |
1101 | 1100 |
1102 __ li(a1, Operand(Smi::FromInt(1))); // Smi indicates slow check | 1101 __ li(a1, Operand(Smi::FromInt(1))); // Smi(1) indicates slow check |
1103 __ lw(a2, MemOperand(sp, 0 * kPointerSize)); // Get enumerated object | |
1104 STATIC_ASSERT(JS_PROXY_TYPE == FIRST_JS_RECEIVER_TYPE); | |
1105 __ GetObjectType(a2, a3, a3); | |
1106 __ Branch(&non_proxy, gt, a3, Operand(JS_PROXY_TYPE)); | |
1107 __ li(a1, Operand(Smi::FromInt(0))); // Zero indicates proxy | |
1108 __ bind(&non_proxy); | |
1109 __ Push(a1, v0); // Smi and array | 1102 __ Push(a1, v0); // Smi and array |
1110 __ lw(a1, FieldMemOperand(v0, FixedArray::kLengthOffset)); | 1103 __ lw(a1, FieldMemOperand(v0, FixedArray::kLengthOffset)); |
1111 __ li(a0, Operand(Smi::FromInt(0))); | 1104 __ li(a0, Operand(Smi::FromInt(0))); |
1112 __ Push(a1, a0); // Fixed array length (as smi) and initial index. | 1105 __ Push(a1, a0); // Fixed array length (as smi) and initial index. |
1113 | 1106 |
1114 // Generate code for doing the condition check. | 1107 // Generate code for doing the condition check. |
1115 __ bind(&loop); | 1108 __ bind(&loop); |
1116 SetExpressionAsStatementPosition(stmt->each()); | 1109 SetExpressionAsStatementPosition(stmt->each()); |
1117 | 1110 |
1118 // Load the current count to a0, load the length to a1. | 1111 // Load the current count to a0, load the length to a1. |
(...skipping 12 matching lines...) Expand all Loading... |
1131 // permanent slow case into register a2. | 1124 // permanent slow case into register a2. |
1132 __ lw(a2, MemOperand(sp, 3 * kPointerSize)); | 1125 __ lw(a2, MemOperand(sp, 3 * kPointerSize)); |
1133 | 1126 |
1134 // Check if the expected map still matches that of the enumerable. | 1127 // Check if the expected map still matches that of the enumerable. |
1135 // If not, we may have to filter the key. | 1128 // If not, we may have to filter the key. |
1136 Label update_each; | 1129 Label update_each; |
1137 __ lw(a1, MemOperand(sp, 4 * kPointerSize)); | 1130 __ lw(a1, MemOperand(sp, 4 * kPointerSize)); |
1138 __ lw(t0, FieldMemOperand(a1, HeapObject::kMapOffset)); | 1131 __ lw(t0, FieldMemOperand(a1, HeapObject::kMapOffset)); |
1139 __ Branch(&update_each, eq, t0, Operand(a2)); | 1132 __ Branch(&update_each, eq, t0, Operand(a2)); |
1140 | 1133 |
1141 // For proxies, no filtering is done. | |
1142 // TODO(rossberg): What if only a prototype is a proxy? Not specified yet. | |
1143 DCHECK_EQ(static_cast<Smi*>(0), Smi::FromInt(0)); | |
1144 __ Branch(&update_each, eq, a2, Operand(zero_reg)); | |
1145 | |
1146 // Convert the entry to a string or (smi) 0 if it isn't a property | 1134 // Convert the entry to a string or (smi) 0 if it isn't a property |
1147 // any more. If the property has been removed while iterating, we | 1135 // any more. If the property has been removed while iterating, we |
1148 // just skip it. | 1136 // just skip it. |
1149 __ Push(a1, a3); // Enumerable and current entry. | 1137 __ Push(a1, a3); // Enumerable and current entry. |
1150 __ CallRuntime(Runtime::kForInFilter, 2); | 1138 __ CallRuntime(Runtime::kForInFilter, 2); |
1151 PrepareForBailoutForId(stmt->FilterId(), TOS_REG); | 1139 PrepareForBailoutForId(stmt->FilterId(), TOS_REG); |
1152 __ mov(a3, result_register()); | 1140 __ mov(a3, result_register()); |
1153 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); | 1141 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); |
1154 __ Branch(loop_statement.continue_label(), eq, a3, Operand(at)); | 1142 __ Branch(loop_statement.continue_label(), eq, a3, Operand(at)); |
1155 | 1143 |
(...skipping 3757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4913 reinterpret_cast<uint32_t>( | 4901 reinterpret_cast<uint32_t>( |
4914 isolate->builtins()->OsrAfterStackCheck()->entry())); | 4902 isolate->builtins()->OsrAfterStackCheck()->entry())); |
4915 return OSR_AFTER_STACK_CHECK; | 4903 return OSR_AFTER_STACK_CHECK; |
4916 } | 4904 } |
4917 | 4905 |
4918 | 4906 |
4919 } // namespace internal | 4907 } // namespace internal |
4920 } // namespace v8 | 4908 } // namespace v8 |
4921 | 4909 |
4922 #endif // V8_TARGET_ARCH_MIPS | 4910 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |