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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
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 1742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1753 SetExpressionPosition(expr); | 1753 SetExpressionPosition(expr); |
1754 | 1754 |
1755 // Evaluate yielded value first; the initial iterator definition depends on | 1755 // Evaluate yielded value first; the initial iterator definition depends on |
1756 // this. It stays on the stack while we update the iterator. | 1756 // this. It stays on the stack while we update the iterator. |
1757 VisitForStackValue(expr->expression()); | 1757 VisitForStackValue(expr->expression()); |
1758 | 1758 |
1759 Label suspend, continuation, post_runtime, resume, exception; | 1759 Label suspend, continuation, post_runtime, resume, exception; |
1760 | 1760 |
1761 __ jmp(&suspend); | 1761 __ jmp(&suspend); |
1762 __ bind(&continuation); | 1762 __ bind(&continuation); |
1763 // When we arrive here, the stack top is the resume mode and | 1763 // When we arrive here, eax holds the generator object. |
1764 // result_register() holds the input value (the argument given to the | |
1765 // respective resume operation). | |
1766 __ RecordGeneratorContinuation(); | 1764 __ RecordGeneratorContinuation(); |
1767 __ pop(ebx); | 1765 __ mov(ebx, FieldOperand(eax, JSGeneratorObject::kResumeModeOffset)); |
| 1766 __ mov(eax, FieldOperand(eax, JSGeneratorObject::kInputOffset)); |
1768 STATIC_ASSERT(JSGeneratorObject::kNext < JSGeneratorObject::kReturn); | 1767 STATIC_ASSERT(JSGeneratorObject::kNext < JSGeneratorObject::kReturn); |
1769 STATIC_ASSERT(JSGeneratorObject::kThrow > JSGeneratorObject::kReturn); | 1768 STATIC_ASSERT(JSGeneratorObject::kThrow > JSGeneratorObject::kReturn); |
1770 __ cmp(ebx, Immediate(Smi::FromInt(JSGeneratorObject::kReturn))); | 1769 __ cmp(ebx, Immediate(Smi::FromInt(JSGeneratorObject::kReturn))); |
1771 __ j(less, &resume); | 1770 __ j(less, &resume); |
1772 __ Push(result_register()); | 1771 __ Push(result_register()); |
1773 __ j(greater, &exception); | 1772 __ j(greater, &exception); |
1774 EmitCreateIteratorResult(true); | 1773 EmitCreateIteratorResult(true); |
1775 EmitUnwindAndReturn(); | 1774 EmitUnwindAndReturn(); |
1776 | 1775 |
1777 __ bind(&exception); | 1776 __ bind(&exception); |
(...skipping 2118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3896 isolate->builtins()->OnStackReplacement()->entry(), | 3895 isolate->builtins()->OnStackReplacement()->entry(), |
3897 Assembler::target_address_at(call_target_address, unoptimized_code)); | 3896 Assembler::target_address_at(call_target_address, unoptimized_code)); |
3898 return ON_STACK_REPLACEMENT; | 3897 return ON_STACK_REPLACEMENT; |
3899 } | 3898 } |
3900 | 3899 |
3901 | 3900 |
3902 } // namespace internal | 3901 } // namespace internal |
3903 } // namespace v8 | 3902 } // namespace v8 |
3904 | 3903 |
3905 #endif // V8_TARGET_ARCH_IA32 | 3904 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |