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_ARM | 5 #if V8_TARGET_ARCH_ARM |
6 | 6 |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/debug/debug.h" | 10 #include "src/debug/debug.h" |
(...skipping 1121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1132 __ CompareObjectType(r2, r3, r3, LAST_JS_PROXY_TYPE); | 1132 __ CompareObjectType(r2, r3, r3, LAST_JS_PROXY_TYPE); |
1133 __ b(gt, &non_proxy); | 1133 __ b(gt, &non_proxy); |
1134 __ mov(r1, Operand(Smi::FromInt(0))); // Zero indicates proxy | 1134 __ mov(r1, Operand(Smi::FromInt(0))); // Zero indicates proxy |
1135 __ bind(&non_proxy); | 1135 __ bind(&non_proxy); |
1136 __ Push(r1, r0); // Smi and array | 1136 __ Push(r1, r0); // Smi and array |
1137 __ ldr(r1, FieldMemOperand(r0, FixedArray::kLengthOffset)); | 1137 __ ldr(r1, FieldMemOperand(r0, FixedArray::kLengthOffset)); |
1138 __ mov(r0, Operand(Smi::FromInt(0))); | 1138 __ mov(r0, Operand(Smi::FromInt(0))); |
1139 __ Push(r1, r0); // Fixed array length (as smi) and initial index. | 1139 __ Push(r1, r0); // Fixed array length (as smi) and initial index. |
1140 | 1140 |
1141 // Generate code for doing the condition check. | 1141 // Generate code for doing the condition check. |
1142 PrepareForBailoutForId(stmt->BodyId(), NO_REGISTERS); | |
1143 __ bind(&loop); | 1142 __ bind(&loop); |
1144 SetExpressionAsStatementPosition(stmt->each()); | 1143 SetExpressionAsStatementPosition(stmt->each()); |
1145 | 1144 |
1146 // Load the current count to r0, load the length to r1. | 1145 // Load the current count to r0, load the length to r1. |
1147 __ Ldrd(r0, r1, MemOperand(sp, 0 * kPointerSize)); | 1146 __ Ldrd(r0, r1, MemOperand(sp, 0 * kPointerSize)); |
1148 __ cmp(r0, r1); // Compare to the array length. | 1147 __ cmp(r0, r1); // Compare to the array length. |
1149 __ b(hs, loop_statement.break_label()); | 1148 __ b(hs, loop_statement.break_label()); |
1150 | 1149 |
1151 // Get the current entry of the array into register r3. | 1150 // Get the current entry of the array into register r3. |
1152 __ ldr(r2, MemOperand(sp, 2 * kPointerSize)); | 1151 __ ldr(r2, MemOperand(sp, 2 * kPointerSize)); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1185 // Update the 'each' property or variable from the possibly filtered | 1184 // Update the 'each' property or variable from the possibly filtered |
1186 // entry in register r3. | 1185 // entry in register r3. |
1187 __ bind(&update_each); | 1186 __ bind(&update_each); |
1188 __ mov(result_register(), r3); | 1187 __ mov(result_register(), r3); |
1189 // Perform the assignment as if via '='. | 1188 // Perform the assignment as if via '='. |
1190 { EffectContext context(this); | 1189 { EffectContext context(this); |
1191 EmitAssignment(stmt->each(), stmt->EachFeedbackSlot()); | 1190 EmitAssignment(stmt->each(), stmt->EachFeedbackSlot()); |
1192 PrepareForBailoutForId(stmt->AssignmentId(), NO_REGISTERS); | 1191 PrepareForBailoutForId(stmt->AssignmentId(), NO_REGISTERS); |
1193 } | 1192 } |
1194 | 1193 |
| 1194 // Both Crankshaft and Turbofan expect BodyId to be right before stmt->body(). |
| 1195 PrepareForBailoutForId(stmt->BodyId(), NO_REGISTERS); |
1195 // Generate code for the body of the loop. | 1196 // Generate code for the body of the loop. |
1196 Visit(stmt->body()); | 1197 Visit(stmt->body()); |
1197 | 1198 |
1198 // Generate code for the going to the next element by incrementing | 1199 // Generate code for the going to the next element by incrementing |
1199 // the index (smi) stored on top of the stack. | 1200 // the index (smi) stored on top of the stack. |
1200 __ bind(loop_statement.continue_label()); | 1201 __ bind(loop_statement.continue_label()); |
1201 __ pop(r0); | 1202 __ pop(r0); |
1202 __ add(r0, r0, Operand(Smi::FromInt(1))); | 1203 __ add(r0, r0, Operand(Smi::FromInt(1))); |
1203 __ push(r0); | 1204 __ push(r0); |
1204 | 1205 |
(...skipping 3986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5191 DCHECK(interrupt_address == | 5192 DCHECK(interrupt_address == |
5192 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5193 isolate->builtins()->OsrAfterStackCheck()->entry()); |
5193 return OSR_AFTER_STACK_CHECK; | 5194 return OSR_AFTER_STACK_CHECK; |
5194 } | 5195 } |
5195 | 5196 |
5196 | 5197 |
5197 } // namespace internal | 5198 } // namespace internal |
5198 } // namespace v8 | 5199 } // namespace v8 |
5199 | 5200 |
5200 #endif // V8_TARGET_ARCH_ARM | 5201 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |