| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
| 6 | 6 |
| 7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
| 8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 1102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1113 } | 1113 } |
| 1114 | 1114 |
| 1115 // Both Crankshaft and Turbofan expect BodyId to be right before stmt->body(). | 1115 // Both Crankshaft and Turbofan expect BodyId to be right before stmt->body(). |
| 1116 PrepareForBailoutForId(stmt->BodyId(), BailoutState::NO_REGISTERS); | 1116 PrepareForBailoutForId(stmt->BodyId(), BailoutState::NO_REGISTERS); |
| 1117 // Generate code for the body of the loop. | 1117 // Generate code for the body of the loop. |
| 1118 Visit(stmt->body()); | 1118 Visit(stmt->body()); |
| 1119 | 1119 |
| 1120 // Generate code for going to the next element by incrementing | 1120 // Generate code for going to the next element by incrementing |
| 1121 // the index (smi) stored on top of the stack. | 1121 // the index (smi) stored on top of the stack. |
| 1122 __ Bind(loop_statement.continue_label()); | 1122 __ Bind(loop_statement.continue_label()); |
| 1123 PrepareForBailoutForId(stmt->IncrementId(), BailoutState::NO_REGISTERS); |
| 1123 // TODO(all): We could use a callee saved register to avoid popping. | 1124 // TODO(all): We could use a callee saved register to avoid popping. |
| 1124 __ Pop(x0); | 1125 __ Pop(x0); |
| 1125 __ Add(x0, x0, Smi::FromInt(1)); | 1126 __ Add(x0, x0, Smi::FromInt(1)); |
| 1126 __ Push(x0); | 1127 __ Push(x0); |
| 1127 | 1128 |
| 1128 EmitBackEdgeBookkeeping(stmt, &loop); | 1129 EmitBackEdgeBookkeeping(stmt, &loop); |
| 1129 __ B(&loop); | 1130 __ B(&loop); |
| 1130 | 1131 |
| 1131 // Remove the pointers stored on the stack. | 1132 // Remove the pointers stored on the stack. |
| 1132 __ Bind(loop_statement.break_label()); | 1133 __ Bind(loop_statement.break_label()); |
| (...skipping 2692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3825 } | 3826 } |
| 3826 | 3827 |
| 3827 return INTERRUPT; | 3828 return INTERRUPT; |
| 3828 } | 3829 } |
| 3829 | 3830 |
| 3830 | 3831 |
| 3831 } // namespace internal | 3832 } // namespace internal |
| 3832 } // namespace v8 | 3833 } // namespace v8 |
| 3833 | 3834 |
| 3834 #endif // V8_TARGET_ARCH_ARM64 | 3835 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |