| 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_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
| 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 1825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1836 SetExpressionPosition(expr); | 1836 SetExpressionPosition(expr); |
| 1837 | 1837 |
| 1838 // Evaluate yielded value first; the initial iterator definition depends on | 1838 // Evaluate yielded value first; the initial iterator definition depends on |
| 1839 // this. It stays on the stack while we update the iterator. | 1839 // this. It stays on the stack while we update the iterator. |
| 1840 VisitForStackValue(expr->expression()); | 1840 VisitForStackValue(expr->expression()); |
| 1841 | 1841 |
| 1842 Label suspend, continuation, post_runtime, resume, exception; | 1842 Label suspend, continuation, post_runtime, resume, exception; |
| 1843 | 1843 |
| 1844 __ jmp(&suspend); | 1844 __ jmp(&suspend); |
| 1845 __ bind(&continuation); | 1845 __ bind(&continuation); |
| 1846 // When we arrive here, the stack top is the resume mode and | 1846 // When we arrive here, v0 holds the generator object. |
| 1847 // result_register() holds the input value (the argument given to the | |
| 1848 // respective resume operation). | |
| 1849 __ RecordGeneratorContinuation(); | 1847 __ RecordGeneratorContinuation(); |
| 1850 __ pop(a1); | 1848 __ ld(a1, FieldMemOperand(v0, JSGeneratorObject::kResumeModeOffset)); |
| 1849 __ ld(v0, FieldMemOperand(v0, JSGeneratorObject::kInputOffset)); |
| 1851 __ Branch(&resume, eq, a1, Operand(Smi::FromInt(JSGeneratorObject::kNext))); | 1850 __ Branch(&resume, eq, a1, Operand(Smi::FromInt(JSGeneratorObject::kNext))); |
| 1852 __ Push(result_register()); | 1851 __ Push(result_register()); |
| 1853 __ Branch(&exception, eq, a1, | 1852 __ Branch(&exception, eq, a1, |
| 1854 Operand(Smi::FromInt(JSGeneratorObject::kThrow))); | 1853 Operand(Smi::FromInt(JSGeneratorObject::kThrow))); |
| 1855 EmitCreateIteratorResult(true); | 1854 EmitCreateIteratorResult(true); |
| 1856 EmitUnwindAndReturn(); | 1855 EmitUnwindAndReturn(); |
| 1857 | 1856 |
| 1858 __ bind(&exception); | 1857 __ bind(&exception); |
| 1859 __ CallRuntime(Runtime::kThrow); | 1858 __ CallRuntime(Runtime::kThrow); |
| 1860 | 1859 |
| (...skipping 2157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4018 reinterpret_cast<uint64_t>( | 4017 reinterpret_cast<uint64_t>( |
| 4019 isolate->builtins()->OnStackReplacement()->entry())); | 4018 isolate->builtins()->OnStackReplacement()->entry())); |
| 4020 return ON_STACK_REPLACEMENT; | 4019 return ON_STACK_REPLACEMENT; |
| 4021 } | 4020 } |
| 4022 | 4021 |
| 4023 | 4022 |
| 4024 } // namespace internal | 4023 } // namespace internal |
| 4025 } // namespace v8 | 4024 } // namespace v8 |
| 4026 | 4025 |
| 4027 #endif // V8_TARGET_ARCH_MIPS64 | 4026 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |