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_X87 | 5 #if V8_TARGET_ARCH_X87 |
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 1734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1745 SetExpressionPosition(expr); | 1745 SetExpressionPosition(expr); |
1746 | 1746 |
1747 // Evaluate yielded value first; the initial iterator definition depends on | 1747 // Evaluate yielded value first; the initial iterator definition depends on |
1748 // this. It stays on the stack while we update the iterator. | 1748 // this. It stays on the stack while we update the iterator. |
1749 VisitForStackValue(expr->expression()); | 1749 VisitForStackValue(expr->expression()); |
1750 | 1750 |
1751 Label suspend, continuation, post_runtime, resume, exception; | 1751 Label suspend, continuation, post_runtime, resume, exception; |
1752 | 1752 |
1753 __ jmp(&suspend); | 1753 __ jmp(&suspend); |
1754 __ bind(&continuation); | 1754 __ bind(&continuation); |
1755 // When we arrive here, the stack top is the resume mode and | 1755 // When we arrive here, eax holds the generator object. |
1756 // result_register() holds the input value (the argument given to the | |
1757 // respective resume operation). | |
1758 __ RecordGeneratorContinuation(); | 1756 __ RecordGeneratorContinuation(); |
1759 __ pop(ebx); | 1757 __ mov(ebx, FieldOperand(eax, JSGeneratorObject::kResumeModeOffset)); |
| 1758 __ mov(eax, FieldOperand(eax, JSGeneratorObject::kInputOffset)); |
1760 STATIC_ASSERT(JSGeneratorObject::kNext < JSGeneratorObject::kReturn); | 1759 STATIC_ASSERT(JSGeneratorObject::kNext < JSGeneratorObject::kReturn); |
1761 STATIC_ASSERT(JSGeneratorObject::kThrow > JSGeneratorObject::kReturn); | 1760 STATIC_ASSERT(JSGeneratorObject::kThrow > JSGeneratorObject::kReturn); |
1762 __ cmp(ebx, Immediate(Smi::FromInt(JSGeneratorObject::kReturn))); | 1761 __ cmp(ebx, Immediate(Smi::FromInt(JSGeneratorObject::kReturn))); |
1763 __ j(less, &resume); | 1762 __ j(less, &resume); |
1764 __ Push(result_register()); | 1763 __ Push(result_register()); |
1765 __ j(greater, &exception); | 1764 __ j(greater, &exception); |
1766 EmitCreateIteratorResult(true); | 1765 EmitCreateIteratorResult(true); |
1767 EmitUnwindAndReturn(); | 1766 EmitUnwindAndReturn(); |
1768 | 1767 |
1769 __ bind(&exception); | 1768 __ bind(&exception); |
(...skipping 2118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3888 isolate->builtins()->OnStackReplacement()->entry(), | 3887 isolate->builtins()->OnStackReplacement()->entry(), |
3889 Assembler::target_address_at(call_target_address, unoptimized_code)); | 3888 Assembler::target_address_at(call_target_address, unoptimized_code)); |
3890 return ON_STACK_REPLACEMENT; | 3889 return ON_STACK_REPLACEMENT; |
3891 } | 3890 } |
3892 | 3891 |
3893 | 3892 |
3894 } // namespace internal | 3893 } // namespace internal |
3895 } // namespace v8 | 3894 } // namespace v8 |
3896 | 3895 |
3897 #endif // V8_TARGET_ARCH_X87 | 3896 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |