| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 5 #if V8_TARGET_ARCH_PPC |
| 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 1087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1098 __ CompareObjectType(r5, r6, r6, LAST_JS_PROXY_TYPE); | 1098 __ CompareObjectType(r5, r6, r6, LAST_JS_PROXY_TYPE); |
| 1099 __ bgt(&non_proxy); | 1099 __ bgt(&non_proxy); |
| 1100 __ LoadSmiLiteral(r4, Smi::FromInt(0)); // Zero indicates proxy | 1100 __ LoadSmiLiteral(r4, Smi::FromInt(0)); // Zero indicates proxy |
| 1101 __ bind(&non_proxy); | 1101 __ bind(&non_proxy); |
| 1102 __ Push(r4, r3); // Smi and array | 1102 __ Push(r4, r3); // Smi and array |
| 1103 __ LoadP(r4, FieldMemOperand(r3, FixedArray::kLengthOffset)); | 1103 __ LoadP(r4, FieldMemOperand(r3, FixedArray::kLengthOffset)); |
| 1104 __ LoadSmiLiteral(r3, Smi::FromInt(0)); | 1104 __ LoadSmiLiteral(r3, Smi::FromInt(0)); |
| 1105 __ Push(r4, r3); // Fixed array length (as smi) and initial index. | 1105 __ Push(r4, r3); // Fixed array length (as smi) and initial index. |
| 1106 | 1106 |
| 1107 // Generate code for doing the condition check. | 1107 // Generate code for doing the condition check. |
| 1108 PrepareForBailoutForId(stmt->BodyId(), NO_REGISTERS); | |
| 1109 __ bind(&loop); | 1108 __ bind(&loop); |
| 1110 SetExpressionAsStatementPosition(stmt->each()); | 1109 SetExpressionAsStatementPosition(stmt->each()); |
| 1111 | 1110 |
| 1112 // Load the current count to r3, load the length to r4. | 1111 // Load the current count to r3, load the length to r4. |
| 1113 __ LoadP(r3, MemOperand(sp, 0 * kPointerSize)); | 1112 __ LoadP(r3, MemOperand(sp, 0 * kPointerSize)); |
| 1114 __ LoadP(r4, MemOperand(sp, 1 * kPointerSize)); | 1113 __ LoadP(r4, MemOperand(sp, 1 * kPointerSize)); |
| 1115 __ cmpl(r3, r4); // Compare to the array length. | 1114 __ cmpl(r3, r4); // Compare to the array length. |
| 1116 __ bge(loop_statement.break_label()); | 1115 __ bge(loop_statement.break_label()); |
| 1117 | 1116 |
| 1118 // Get the current entry of the array into register r6. | 1117 // Get the current entry of the array into register r6. |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1153 // entry in register r6. | 1152 // entry in register r6. |
| 1154 __ bind(&update_each); | 1153 __ bind(&update_each); |
| 1155 __ mr(result_register(), r6); | 1154 __ mr(result_register(), r6); |
| 1156 // Perform the assignment as if via '='. | 1155 // Perform the assignment as if via '='. |
| 1157 { | 1156 { |
| 1158 EffectContext context(this); | 1157 EffectContext context(this); |
| 1159 EmitAssignment(stmt->each(), stmt->EachFeedbackSlot()); | 1158 EmitAssignment(stmt->each(), stmt->EachFeedbackSlot()); |
| 1160 PrepareForBailoutForId(stmt->AssignmentId(), NO_REGISTERS); | 1159 PrepareForBailoutForId(stmt->AssignmentId(), NO_REGISTERS); |
| 1161 } | 1160 } |
| 1162 | 1161 |
| 1162 // Both Crankshaft and Turbofan expect BodyId to be right before stmt->body(). |
| 1163 PrepareForBailoutForId(stmt->BodyId(), NO_REGISTERS); |
| 1163 // Generate code for the body of the loop. | 1164 // Generate code for the body of the loop. |
| 1164 Visit(stmt->body()); | 1165 Visit(stmt->body()); |
| 1165 | 1166 |
| 1166 // Generate code for the going to the next element by incrementing | 1167 // Generate code for the going to the next element by incrementing |
| 1167 // the index (smi) stored on top of the stack. | 1168 // the index (smi) stored on top of the stack. |
| 1168 __ bind(loop_statement.continue_label()); | 1169 __ bind(loop_statement.continue_label()); |
| 1169 __ pop(r3); | 1170 __ pop(r3); |
| 1170 __ AddSmiLiteral(r3, r3, Smi::FromInt(1), r0); | 1171 __ AddSmiLiteral(r3, r3, Smi::FromInt(1), r0); |
| 1171 __ push(r3); | 1172 __ push(r3); |
| 1172 | 1173 |
| (...skipping 3969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5142 return ON_STACK_REPLACEMENT; | 5143 return ON_STACK_REPLACEMENT; |
| 5143 } | 5144 } |
| 5144 | 5145 |
| 5145 DCHECK(interrupt_address == | 5146 DCHECK(interrupt_address == |
| 5146 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5147 isolate->builtins()->OsrAfterStackCheck()->entry()); |
| 5147 return OSR_AFTER_STACK_CHECK; | 5148 return OSR_AFTER_STACK_CHECK; |
| 5148 } | 5149 } |
| 5149 } // namespace internal | 5150 } // namespace internal |
| 5150 } // namespace v8 | 5151 } // namespace v8 |
| 5151 #endif // V8_TARGET_ARCH_PPC | 5152 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |