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

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

Issue 1867263002: [generators] Store the resume mode in the generator object. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Other platforms 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
OLDNEW
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_MIPS 5 #if V8_TARGET_ARCH_MIPS
6 6
7 // Note on Mips implementation: 7 // Note on Mips implementation:
8 // 8 //
9 // The result_register() for mips is the 'v0' register, which is defined 9 // The result_register() for mips is the 'v0' register, which is defined
10 // by the ABI to contain function return values. However, the first 10 // by the ABI to contain function return values. However, the first
(...skipping 1824 matching lines...) Expand 10 before | Expand all | Expand 10 after
1835 SetExpressionPosition(expr); 1835 SetExpressionPosition(expr);
1836 1836
1837 // Evaluate yielded value first; the initial iterator definition depends on 1837 // Evaluate yielded value first; the initial iterator definition depends on
1838 // this. It stays on the stack while we update the iterator. 1838 // this. It stays on the stack while we update the iterator.
1839 VisitForStackValue(expr->expression()); 1839 VisitForStackValue(expr->expression());
1840 1840
1841 Label suspend, continuation, post_runtime, resume, exception; 1841 Label suspend, continuation, post_runtime, resume, exception;
1842 1842
1843 __ jmp(&suspend); 1843 __ jmp(&suspend);
1844 __ bind(&continuation); 1844 __ bind(&continuation);
1845 // When we arrive here, the stack top is the resume mode and 1845 // When we arrive here, v0 holds the generator object.
1846 // result_register() holds the input value (the argument given to the
1847 // respective resume operation).
1848 __ RecordGeneratorContinuation(); 1846 __ RecordGeneratorContinuation();
1849 __ pop(a1); 1847 __ lw(a1, FieldMemOperand(v0, JSGeneratorObject::kResumeModeOffset));
1848 __ lw(v0, FieldMemOperand(v0, JSGeneratorObject::kInputOffset));
1850 __ Branch(&resume, eq, a1, Operand(Smi::FromInt(JSGeneratorObject::kNext))); 1849 __ Branch(&resume, eq, a1, Operand(Smi::FromInt(JSGeneratorObject::kNext)));
1851 __ Push(result_register()); 1850 __ Push(result_register());
1852 __ Branch(&exception, eq, a1, 1851 __ Branch(&exception, eq, a1,
1853 Operand(Smi::FromInt(JSGeneratorObject::kThrow))); 1852 Operand(Smi::FromInt(JSGeneratorObject::kThrow)));
1854 EmitCreateIteratorResult(true); 1853 EmitCreateIteratorResult(true);
1855 EmitUnwindAndReturn(); 1854 EmitUnwindAndReturn();
1856 1855
1857 __ bind(&exception); 1856 __ bind(&exception);
1858 __ CallRuntime(Runtime::kThrow); 1857 __ CallRuntime(Runtime::kThrow);
1859 1858
(...skipping 2150 matching lines...) Expand 10 before | Expand all | Expand 10 after
4010 reinterpret_cast<uint32_t>( 4009 reinterpret_cast<uint32_t>(
4011 isolate->builtins()->OnStackReplacement()->entry())); 4010 isolate->builtins()->OnStackReplacement()->entry()));
4012 return ON_STACK_REPLACEMENT; 4011 return ON_STACK_REPLACEMENT;
4013 } 4012 }
4014 4013
4015 4014
4016 } // namespace internal 4015 } // namespace internal
4017 } // namespace v8 4016 } // namespace v8
4018 4017
4019 #endif // V8_TARGET_ARCH_MIPS 4018 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/full-codegen/ia32/full-codegen-ia32.cc ('k') | src/full-codegen/mips64/full-codegen-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698