| 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 3733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3744 // and suchlike. The implementation changes a little by bleeding_edge so I | 3744 // and suchlike. The implementation changes a little by bleeding_edge so I |
| 3745 // don't want to spend too much time on it now. | 3745 // don't want to spend too much time on it now. |
| 3746 | 3746 |
| 3747 Label suspend, continuation, post_runtime, resume, exception; | 3747 Label suspend, continuation, post_runtime, resume, exception; |
| 3748 | 3748 |
| 3749 __ B(&suspend); | 3749 __ B(&suspend); |
| 3750 // TODO(jbramley): This label is bound here because the following code | 3750 // TODO(jbramley): This label is bound here because the following code |
| 3751 // looks at its pos(). Is it possible to do something more efficient here, | 3751 // looks at its pos(). Is it possible to do something more efficient here, |
| 3752 // perhaps using Adr? | 3752 // perhaps using Adr? |
| 3753 __ Bind(&continuation); | 3753 __ Bind(&continuation); |
| 3754 // When we arrive here, the stack top is the resume mode and | 3754 // When we arrive here, x0 holds the generator object. |
| 3755 // result_register() holds the input value (the argument given to the | |
| 3756 // respective resume operation). | |
| 3757 __ RecordGeneratorContinuation(); | 3755 __ RecordGeneratorContinuation(); |
| 3758 __ Pop(x1); | 3756 __ Ldr(x1, FieldMemOperand(x0, JSGeneratorObject::kResumeModeOffset)); |
| 3757 __ Ldr(x0, FieldMemOperand(x0, JSGeneratorObject::kInputOffset)); |
| 3759 STATIC_ASSERT(JSGeneratorObject::kNext < JSGeneratorObject::kReturn); | 3758 STATIC_ASSERT(JSGeneratorObject::kNext < JSGeneratorObject::kReturn); |
| 3760 STATIC_ASSERT(JSGeneratorObject::kThrow > JSGeneratorObject::kReturn); | 3759 STATIC_ASSERT(JSGeneratorObject::kThrow > JSGeneratorObject::kReturn); |
| 3761 __ Cmp(x1, Operand(Smi::FromInt(JSGeneratorObject::kReturn))); | 3760 __ Cmp(x1, Operand(Smi::FromInt(JSGeneratorObject::kReturn))); |
| 3762 __ B(lt, &resume); | 3761 __ B(lt, &resume); |
| 3763 __ Push(result_register()); | 3762 __ Push(result_register()); |
| 3764 __ B(gt, &exception); | 3763 __ B(gt, &exception); |
| 3765 EmitCreateIteratorResult(true); | 3764 EmitCreateIteratorResult(true); |
| 3766 EmitUnwindAndReturn(); | 3765 EmitUnwindAndReturn(); |
| 3767 | 3766 |
| 3768 __ Bind(&exception); | 3767 __ Bind(&exception); |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4055 } | 4054 } |
| 4056 | 4055 |
| 4057 return INTERRUPT; | 4056 return INTERRUPT; |
| 4058 } | 4057 } |
| 4059 | 4058 |
| 4060 | 4059 |
| 4061 } // namespace internal | 4060 } // namespace internal |
| 4062 } // namespace v8 | 4061 } // namespace v8 |
| 4063 | 4062 |
| 4064 #endif // V8_TARGET_ARCH_ARM64 | 4063 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |