Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(333)

Side by Side Diff: src/full-codegen/ppc/full-codegen-ppc.cc

Issue 1874323002: PPC: [generators] Store the resume mode in the generator object. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/ppc/builtins-ppc.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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_PPC 5 #if V8_TARGET_ARCH_PPC
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 1784 matching lines...) Expand 10 before | Expand all | Expand 10 after
1795 SetExpressionPosition(expr); 1795 SetExpressionPosition(expr);
1796 1796
1797 // Evaluate yielded value first; the initial iterator definition depends on 1797 // Evaluate yielded value first; the initial iterator definition depends on
1798 // this. It stays on the stack while we update the iterator. 1798 // this. It stays on the stack while we update the iterator.
1799 VisitForStackValue(expr->expression()); 1799 VisitForStackValue(expr->expression());
1800 1800
1801 Label suspend, continuation, post_runtime, resume, exception; 1801 Label suspend, continuation, post_runtime, resume, exception;
1802 1802
1803 __ b(&suspend); 1803 __ b(&suspend);
1804 __ bind(&continuation); 1804 __ bind(&continuation);
1805 // When we arrive here, the stack top is the resume mode and 1805 // When we arrive here, r3 holds the generator object.
1806 // result_register() holds the input value (the argument given to the
1807 // respective resume operation).
1808 __ RecordGeneratorContinuation(); 1806 __ RecordGeneratorContinuation();
1809 __ pop(r4); 1807 __ LoadP(r4, FieldMemOperand(r3, JSGeneratorObject::kResumeModeOffset));
1808 __ LoadP(r3, FieldMemOperand(r3, JSGeneratorObject::kInputOffset));
1810 STATIC_ASSERT(JSGeneratorObject::kNext < JSGeneratorObject::kReturn); 1809 STATIC_ASSERT(JSGeneratorObject::kNext < JSGeneratorObject::kReturn);
1811 STATIC_ASSERT(JSGeneratorObject::kThrow > JSGeneratorObject::kReturn); 1810 STATIC_ASSERT(JSGeneratorObject::kThrow > JSGeneratorObject::kReturn);
1812 __ CmpSmiLiteral(r4, Smi::FromInt(JSGeneratorObject::kReturn), r0); 1811 __ CmpSmiLiteral(r4, Smi::FromInt(JSGeneratorObject::kReturn), r0);
1813 __ blt(&resume); 1812 __ blt(&resume);
1814 __ Push(result_register()); 1813 __ Push(result_register());
1815 __ bgt(&exception); 1814 __ bgt(&exception);
1816 EmitCreateIteratorResult(true); 1815 EmitCreateIteratorResult(true);
1817 EmitUnwindAndReturn(); 1816 EmitUnwindAndReturn();
1818 1817
1819 __ bind(&exception); 1818 __ bind(&exception);
(...skipping 2144 matching lines...) Expand 10 before | Expand all | Expand 10 after
3964 3963
3965 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); 3964 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address)));
3966 3965
3967 DCHECK(interrupt_address == 3966 DCHECK(interrupt_address ==
3968 isolate->builtins()->OnStackReplacement()->entry()); 3967 isolate->builtins()->OnStackReplacement()->entry());
3969 return ON_STACK_REPLACEMENT; 3968 return ON_STACK_REPLACEMENT;
3970 } 3969 }
3971 } // namespace internal 3970 } // namespace internal
3972 } // namespace v8 3971 } // namespace v8
3973 #endif // V8_TARGET_ARCH_PPC 3972 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« no previous file with comments | « no previous file | src/ppc/builtins-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698