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