OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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_S390 | 5 #if V8_TARGET_ARCH_S390 |
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 1740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1751 SetExpressionPosition(expr); | 1751 SetExpressionPosition(expr); |
1752 | 1752 |
1753 // Evaluate yielded value first; the initial iterator definition depends on | 1753 // Evaluate yielded value first; the initial iterator definition depends on |
1754 // this. It stays on the stack while we update the iterator. | 1754 // this. It stays on the stack while we update the iterator. |
1755 VisitForStackValue(expr->expression()); | 1755 VisitForStackValue(expr->expression()); |
1756 | 1756 |
1757 Label suspend, continuation, post_runtime, resume, exception; | 1757 Label suspend, continuation, post_runtime, resume, exception; |
1758 | 1758 |
1759 __ b(&suspend); | 1759 __ b(&suspend); |
1760 __ bind(&continuation); | 1760 __ bind(&continuation); |
1761 // When we arrive here, the stack top is the resume mode and | 1761 // When we arrive here, r2 holds the generator object. |
1762 // result_register() holds the input value (the argument given to the | |
1763 // respective resume operation). | |
1764 __ RecordGeneratorContinuation(); | 1762 __ RecordGeneratorContinuation(); |
1765 __ pop(r3); | 1763 __ LoadP(r3, FieldMemOperand(r2, JSGeneratorObject::kResumeModeOffset)); |
| 1764 __ LoadP(r2, FieldMemOperand(r2, JSGeneratorObject::kInputOffset)); |
1766 STATIC_ASSERT(JSGeneratorObject::kNext < JSGeneratorObject::kReturn); | 1765 STATIC_ASSERT(JSGeneratorObject::kNext < JSGeneratorObject::kReturn); |
1767 STATIC_ASSERT(JSGeneratorObject::kThrow > JSGeneratorObject::kReturn); | 1766 STATIC_ASSERT(JSGeneratorObject::kThrow > JSGeneratorObject::kReturn); |
1768 __ CmpSmiLiteral(r3, Smi::FromInt(JSGeneratorObject::kReturn), r0); | 1767 __ CmpSmiLiteral(r3, Smi::FromInt(JSGeneratorObject::kReturn), r0); |
1769 __ blt(&resume); | 1768 __ blt(&resume); |
1770 __ Push(result_register()); | 1769 __ Push(result_register()); |
1771 __ bgt(&exception); | 1770 __ bgt(&exception); |
1772 EmitCreateIteratorResult(true); | 1771 EmitCreateIteratorResult(true); |
1773 EmitUnwindAndReturn(); | 1772 EmitUnwindAndReturn(); |
1774 | 1773 |
1775 __ bind(&exception); | 1774 __ bind(&exception); |
(...skipping 2094 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3870 DCHECK(kOSRBranchInstruction == br_instr); | 3869 DCHECK(kOSRBranchInstruction == br_instr); |
3871 | 3870 |
3872 DCHECK(interrupt_address == | 3871 DCHECK(interrupt_address == |
3873 isolate->builtins()->OnStackReplacement()->entry()); | 3872 isolate->builtins()->OnStackReplacement()->entry()); |
3874 return ON_STACK_REPLACEMENT; | 3873 return ON_STACK_REPLACEMENT; |
3875 } | 3874 } |
3876 | 3875 |
3877 } // namespace internal | 3876 } // namespace internal |
3878 } // namespace v8 | 3877 } // namespace v8 |
3879 #endif // V8_TARGET_ARCH_S390 | 3878 #endif // V8_TARGET_ARCH_S390 |
OLD | NEW |