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/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 1826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1837 SetExpressionPosition(expr); | 1837 SetExpressionPosition(expr); |
1838 | 1838 |
1839 // Evaluate yielded value first; the initial iterator definition depends on | 1839 // Evaluate yielded value first; the initial iterator definition depends on |
1840 // this. It stays on the stack while we update the iterator. | 1840 // this. It stays on the stack while we update the iterator. |
1841 VisitForStackValue(expr->expression()); | 1841 VisitForStackValue(expr->expression()); |
1842 | 1842 |
1843 Label suspend, continuation, post_runtime, resume, exception; | 1843 Label suspend, continuation, post_runtime, resume, exception; |
1844 | 1844 |
1845 __ jmp(&suspend); | 1845 __ jmp(&suspend); |
1846 __ bind(&continuation); | 1846 __ bind(&continuation); |
1847 // When we arrive here, the stack top is the resume mode and | 1847 // When we arrive here, r0 holds the generator object. |
1848 // result_register() holds the input value (the argument given to the | |
1849 // respective resume operation). | |
1850 __ RecordGeneratorContinuation(); | 1848 __ RecordGeneratorContinuation(); |
1851 __ pop(r1); | 1849 __ ldr(r1, FieldMemOperand(r0, JSGeneratorObject::kResumeModeOffset)); |
| 1850 __ ldr(r0, FieldMemOperand(r0, JSGeneratorObject::kInputOffset)); |
1852 STATIC_ASSERT(JSGeneratorObject::kNext < JSGeneratorObject::kReturn); | 1851 STATIC_ASSERT(JSGeneratorObject::kNext < JSGeneratorObject::kReturn); |
1853 STATIC_ASSERT(JSGeneratorObject::kThrow > JSGeneratorObject::kReturn); | 1852 STATIC_ASSERT(JSGeneratorObject::kThrow > JSGeneratorObject::kReturn); |
1854 __ cmp(r1, Operand(Smi::FromInt(JSGeneratorObject::kReturn))); | 1853 __ cmp(r1, Operand(Smi::FromInt(JSGeneratorObject::kReturn))); |
1855 __ b(lt, &resume); | 1854 __ b(lt, &resume); |
1856 __ Push(result_register()); | 1855 __ Push(result_register()); |
1857 __ b(gt, &exception); | 1856 __ b(gt, &exception); |
1858 EmitCreateIteratorResult(true); | 1857 EmitCreateIteratorResult(true); |
1859 EmitUnwindAndReturn(); | 1858 EmitUnwindAndReturn(); |
1860 | 1859 |
1861 __ bind(&exception); | 1860 __ bind(&exception); |
(...skipping 2193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4055 DCHECK(interrupt_address == | 4054 DCHECK(interrupt_address == |
4056 isolate->builtins()->OnStackReplacement()->entry()); | 4055 isolate->builtins()->OnStackReplacement()->entry()); |
4057 return ON_STACK_REPLACEMENT; | 4056 return ON_STACK_REPLACEMENT; |
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_ARM | 4063 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |