| 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_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 1748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1759 context()->Plug(v0); | 1759 context()->Plug(v0); |
| 1760 break; | 1760 break; |
| 1761 case KEYED_PROPERTY: | 1761 case KEYED_PROPERTY: |
| 1762 EmitKeyedPropertyAssignment(expr); | 1762 EmitKeyedPropertyAssignment(expr); |
| 1763 break; | 1763 break; |
| 1764 } | 1764 } |
| 1765 } | 1765 } |
| 1766 | 1766 |
| 1767 | 1767 |
| 1768 void FullCodeGenerator::VisitYield(Yield* expr) { | 1768 void FullCodeGenerator::VisitYield(Yield* expr) { |
| 1769 Comment cmnt(masm_, "[ Yield"); | 1769 // Resumable functions are not supported. |
| 1770 SetExpressionPosition(expr); | 1770 UNREACHABLE(); |
| 1771 | |
| 1772 // Evaluate yielded value first; the initial iterator definition depends on | |
| 1773 // this. It stays on the stack while we update the iterator. | |
| 1774 VisitForStackValue(expr->expression()); | |
| 1775 | |
| 1776 Label suspend, continuation, post_runtime, resume, exception; | |
| 1777 | |
| 1778 __ jmp(&suspend); | |
| 1779 __ bind(&continuation); | |
| 1780 // When we arrive here, v0 holds the generator object. | |
| 1781 __ RecordGeneratorContinuation(); | |
| 1782 __ lw(a1, FieldMemOperand(v0, JSGeneratorObject::kResumeModeOffset)); | |
| 1783 __ lw(v0, FieldMemOperand(v0, JSGeneratorObject::kInputOrDebugPosOffset)); | |
| 1784 __ Branch(&resume, eq, a1, Operand(Smi::FromInt(JSGeneratorObject::kNext))); | |
| 1785 __ Push(result_register()); | |
| 1786 __ Branch(&exception, eq, a1, | |
| 1787 Operand(Smi::FromInt(JSGeneratorObject::kThrow))); | |
| 1788 EmitCreateIteratorResult(true); | |
| 1789 EmitUnwindAndReturn(); | |
| 1790 | |
| 1791 __ bind(&exception); | |
| 1792 __ CallRuntime(expr->rethrow_on_exception() ? Runtime::kReThrow | |
| 1793 : Runtime::kThrow); | |
| 1794 | |
| 1795 __ bind(&suspend); | |
| 1796 OperandStackDepthIncrement(1); // Not popped on this path. | |
| 1797 VisitForAccumulatorValue(expr->generator_object()); | |
| 1798 DCHECK(continuation.pos() > 0 && Smi::IsValid(continuation.pos())); | |
| 1799 __ li(a1, Operand(Smi::FromInt(continuation.pos()))); | |
| 1800 __ sw(a1, FieldMemOperand(v0, JSGeneratorObject::kContinuationOffset)); | |
| 1801 __ sw(cp, FieldMemOperand(v0, JSGeneratorObject::kContextOffset)); | |
| 1802 __ mov(a1, cp); | |
| 1803 __ RecordWriteField(v0, JSGeneratorObject::kContextOffset, a1, a2, | |
| 1804 kRAHasBeenSaved, kDontSaveFPRegs); | |
| 1805 __ Addu(a1, fp, Operand(StandardFrameConstants::kExpressionsOffset)); | |
| 1806 __ Branch(&post_runtime, eq, sp, Operand(a1)); | |
| 1807 __ push(v0); // generator object | |
| 1808 __ CallRuntime(Runtime::kSuspendJSGeneratorObject, 1); | |
| 1809 RestoreContext(); | |
| 1810 __ bind(&post_runtime); | |
| 1811 PopOperand(result_register()); | |
| 1812 EmitReturnSequence(); | |
| 1813 | |
| 1814 __ bind(&resume); | |
| 1815 context()->Plug(result_register()); | |
| 1816 } | 1771 } |
| 1817 | 1772 |
| 1818 void FullCodeGenerator::PushOperands(Register reg1, Register reg2) { | 1773 void FullCodeGenerator::PushOperands(Register reg1, Register reg2) { |
| 1819 OperandStackDepthIncrement(2); | 1774 OperandStackDepthIncrement(2); |
| 1820 __ Push(reg1, reg2); | 1775 __ Push(reg1, reg2); |
| 1821 } | 1776 } |
| 1822 | 1777 |
| 1823 void FullCodeGenerator::PushOperands(Register reg1, Register reg2, | 1778 void FullCodeGenerator::PushOperands(Register reg1, Register reg2, |
| 1824 Register reg3) { | 1779 Register reg3) { |
| 1825 OperandStackDepthIncrement(3); | 1780 OperandStackDepthIncrement(3); |
| (...skipping 1815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3641 reinterpret_cast<uint32_t>( | 3596 reinterpret_cast<uint32_t>( |
| 3642 isolate->builtins()->OnStackReplacement()->entry())); | 3597 isolate->builtins()->OnStackReplacement()->entry())); |
| 3643 return ON_STACK_REPLACEMENT; | 3598 return ON_STACK_REPLACEMENT; |
| 3644 } | 3599 } |
| 3645 | 3600 |
| 3646 | 3601 |
| 3647 } // namespace internal | 3602 } // namespace internal |
| 3648 } // namespace v8 | 3603 } // namespace v8 |
| 3649 | 3604 |
| 3650 #endif // V8_TARGET_ARCH_MIPS | 3605 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |