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 1118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1129 __ GetObjectType(a2, a3, a3); | 1129 __ GetObjectType(a2, a3, a3); |
1130 __ Branch(&non_proxy, gt, a3, Operand(LAST_JS_PROXY_TYPE)); | 1130 __ Branch(&non_proxy, gt, a3, Operand(LAST_JS_PROXY_TYPE)); |
1131 __ li(a1, Operand(Smi::FromInt(0))); // Zero indicates proxy | 1131 __ li(a1, Operand(Smi::FromInt(0))); // Zero indicates proxy |
1132 __ bind(&non_proxy); | 1132 __ bind(&non_proxy); |
1133 __ Push(a1, v0); // Smi and array | 1133 __ Push(a1, v0); // Smi and array |
1134 __ ld(a1, FieldMemOperand(v0, FixedArray::kLengthOffset)); | 1134 __ ld(a1, FieldMemOperand(v0, FixedArray::kLengthOffset)); |
1135 __ li(a0, Operand(Smi::FromInt(0))); | 1135 __ li(a0, Operand(Smi::FromInt(0))); |
1136 __ Push(a1, a0); // Fixed array length (as smi) and initial index. | 1136 __ Push(a1, a0); // Fixed array length (as smi) and initial index. |
1137 | 1137 |
1138 // Generate code for doing the condition check. | 1138 // Generate code for doing the condition check. |
1139 PrepareForBailoutForId(stmt->BodyId(), NO_REGISTERS); | |
1140 __ bind(&loop); | 1139 __ bind(&loop); |
1141 SetExpressionAsStatementPosition(stmt->each()); | 1140 SetExpressionAsStatementPosition(stmt->each()); |
1142 | 1141 |
1143 // Load the current count to a0, load the length to a1. | 1142 // Load the current count to a0, load the length to a1. |
1144 __ ld(a0, MemOperand(sp, 0 * kPointerSize)); | 1143 __ ld(a0, MemOperand(sp, 0 * kPointerSize)); |
1145 __ ld(a1, MemOperand(sp, 1 * kPointerSize)); | 1144 __ ld(a1, MemOperand(sp, 1 * kPointerSize)); |
1146 __ Branch(loop_statement.break_label(), hs, a0, Operand(a1)); | 1145 __ Branch(loop_statement.break_label(), hs, a0, Operand(a1)); |
1147 | 1146 |
1148 // Get the current entry of the array into register a3. | 1147 // Get the current entry of the array into register a3. |
1149 __ ld(a2, MemOperand(sp, 2 * kPointerSize)); | 1148 __ ld(a2, MemOperand(sp, 2 * kPointerSize)); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1181 // Update the 'each' property or variable from the possibly filtered | 1180 // Update the 'each' property or variable from the possibly filtered |
1182 // entry in register a3. | 1181 // entry in register a3. |
1183 __ bind(&update_each); | 1182 __ bind(&update_each); |
1184 __ mov(result_register(), a3); | 1183 __ mov(result_register(), a3); |
1185 // Perform the assignment as if via '='. | 1184 // Perform the assignment as if via '='. |
1186 { EffectContext context(this); | 1185 { EffectContext context(this); |
1187 EmitAssignment(stmt->each(), stmt->EachFeedbackSlot()); | 1186 EmitAssignment(stmt->each(), stmt->EachFeedbackSlot()); |
1188 PrepareForBailoutForId(stmt->AssignmentId(), NO_REGISTERS); | 1187 PrepareForBailoutForId(stmt->AssignmentId(), NO_REGISTERS); |
1189 } | 1188 } |
1190 | 1189 |
| 1190 // Both Crankshaft and Turbofan expect BodyId to be right before stmt->body(). |
| 1191 PrepareForBailoutForId(stmt->BodyId(), NO_REGISTERS); |
1191 // Generate code for the body of the loop. | 1192 // Generate code for the body of the loop. |
1192 Visit(stmt->body()); | 1193 Visit(stmt->body()); |
1193 | 1194 |
1194 // Generate code for the going to the next element by incrementing | 1195 // Generate code for the going to the next element by incrementing |
1195 // the index (smi) stored on top of the stack. | 1196 // the index (smi) stored on top of the stack. |
1196 __ bind(loop_statement.continue_label()); | 1197 __ bind(loop_statement.continue_label()); |
1197 __ pop(a0); | 1198 __ pop(a0); |
1198 __ Daddu(a0, a0, Operand(Smi::FromInt(1))); | 1199 __ Daddu(a0, a0, Operand(Smi::FromInt(1))); |
1199 __ push(a0); | 1200 __ push(a0); |
1200 | 1201 |
(...skipping 3958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5159 reinterpret_cast<uint64_t>( | 5160 reinterpret_cast<uint64_t>( |
5160 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5161 isolate->builtins()->OsrAfterStackCheck()->entry())); |
5161 return OSR_AFTER_STACK_CHECK; | 5162 return OSR_AFTER_STACK_CHECK; |
5162 } | 5163 } |
5163 | 5164 |
5164 | 5165 |
5165 } // namespace internal | 5166 } // namespace internal |
5166 } // namespace v8 | 5167 } // namespace v8 |
5167 | 5168 |
5168 #endif // V8_TARGET_ARCH_MIPS64 | 5169 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |