OLD | NEW |
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/codegen.h" | 7 #include "src/codegen.h" |
8 #include "src/debug/debug.h" | 8 #include "src/debug/debug.h" |
9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
10 #include "src/full-codegen/full-codegen.h" | 10 #include "src/full-codegen/full-codegen.h" |
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
713 // -- r5 : the resume mode (tagged) | 713 // -- r5 : the resume mode (tagged) |
714 // -- lr : return address | 714 // -- lr : return address |
715 // ----------------------------------- | 715 // ----------------------------------- |
716 __ AssertGeneratorObject(r4); | 716 __ AssertGeneratorObject(r4); |
717 | 717 |
718 // Store input value into generator object. | 718 // Store input value into generator object. |
719 __ StoreP(r3, FieldMemOperand(r4, JSGeneratorObject::kInputOffset), r0); | 719 __ StoreP(r3, FieldMemOperand(r4, JSGeneratorObject::kInputOffset), r0); |
720 __ RecordWriteField(r4, JSGeneratorObject::kInputOffset, r3, r6, | 720 __ RecordWriteField(r4, JSGeneratorObject::kInputOffset, r3, r6, |
721 kLRHasNotBeenSaved, kDontSaveFPRegs); | 721 kLRHasNotBeenSaved, kDontSaveFPRegs); |
722 | 722 |
| 723 // Store resume mode into generator object. |
| 724 __ StoreP(r5, FieldMemOperand(r4, JSGeneratorObject::kResumeModeOffset), r0); |
| 725 |
723 // Load suspended function and context. | 726 // Load suspended function and context. |
724 __ LoadP(cp, FieldMemOperand(r4, JSGeneratorObject::kContextOffset)); | 727 __ LoadP(cp, FieldMemOperand(r4, JSGeneratorObject::kContextOffset)); |
725 __ LoadP(r7, FieldMemOperand(r4, JSGeneratorObject::kFunctionOffset)); | 728 __ LoadP(r7, FieldMemOperand(r4, JSGeneratorObject::kFunctionOffset)); |
726 | 729 |
727 // Flood function if we are stepping. | 730 // Flood function if we are stepping. |
728 Label skip_flooding; | 731 Label skip_flooding; |
729 ExternalReference step_in_enabled = | 732 ExternalReference step_in_enabled = |
730 ExternalReference::debug_step_in_enabled_address(masm->isolate()); | 733 ExternalReference::debug_step_in_enabled_address(masm->isolate()); |
731 __ mov(ip, Operand(step_in_enabled)); | 734 __ mov(ip, Operand(step_in_enabled)); |
732 __ lbz(ip, MemOperand(ip)); | 735 __ lbz(ip, MemOperand(ip)); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
793 __ SmiUntag(r6, SetRC); | 796 __ SmiUntag(r6, SetRC); |
794 __ beq(&done_loop, cr0); | 797 __ beq(&done_loop, cr0); |
795 __ mtctr(r6); | 798 __ mtctr(r6); |
796 __ bind(&loop); | 799 __ bind(&loop); |
797 __ LoadPU(ip, MemOperand(r3, kPointerSize)); | 800 __ LoadPU(ip, MemOperand(r3, kPointerSize)); |
798 __ Push(ip); | 801 __ Push(ip); |
799 __ bdnz(&loop); | 802 __ bdnz(&loop); |
800 __ bind(&done_loop); | 803 __ bind(&done_loop); |
801 } | 804 } |
802 | 805 |
803 // Push resume mode (consumed in continuation). | |
804 __ Push(r5); | |
805 | |
806 // Reset operand stack so we don't leak. | 806 // Reset operand stack so we don't leak. |
807 __ LoadRoot(ip, Heap::kEmptyFixedArrayRootIndex); | 807 __ LoadRoot(ip, Heap::kEmptyFixedArrayRootIndex); |
808 __ StoreP(ip, FieldMemOperand(r4, JSGeneratorObject::kOperandStackOffset), | 808 __ StoreP(ip, FieldMemOperand(r4, JSGeneratorObject::kOperandStackOffset), |
809 r0); | 809 r0); |
810 | 810 |
811 // Restore value. | |
812 __ LoadP(r3, FieldMemOperand(r4, JSGeneratorObject::kInputOffset)); | |
813 | |
814 // Resume the generator function at the continuation. | 811 // Resume the generator function at the continuation. |
815 __ LoadP(r6, FieldMemOperand(r7, JSFunction::kSharedFunctionInfoOffset)); | 812 __ LoadP(r6, FieldMemOperand(r7, JSFunction::kSharedFunctionInfoOffset)); |
816 __ LoadP(r6, FieldMemOperand(r6, SharedFunctionInfo::kCodeOffset)); | 813 __ LoadP(r6, FieldMemOperand(r6, SharedFunctionInfo::kCodeOffset)); |
817 __ addi(r6, r6, Operand(Code::kHeaderSize - kHeapObjectTag)); | 814 __ addi(r6, r6, Operand(Code::kHeaderSize - kHeapObjectTag)); |
818 { | 815 { |
819 ConstantPoolUnavailableScope constant_pool_unavailable(masm); | 816 ConstantPoolUnavailableScope constant_pool_unavailable(masm); |
820 if (FLAG_enable_embedded_constant_pool) { | 817 if (FLAG_enable_embedded_constant_pool) { |
821 __ LoadConstantPoolPointerRegisterFromCodeTargetAddress(r6); | 818 __ LoadConstantPoolPointerRegisterFromCodeTargetAddress(r6); |
822 } | 819 } |
823 __ LoadP(r5, FieldMemOperand(r4, JSGeneratorObject::kContinuationOffset)); | 820 __ LoadP(r5, FieldMemOperand(r4, JSGeneratorObject::kContinuationOffset)); |
824 __ SmiUntag(r5); | 821 __ SmiUntag(r5); |
825 __ add(r6, r6, r5); | 822 __ add(r6, r6, r5); |
826 __ LoadSmiLiteral(r5, Smi::FromInt(JSGeneratorObject::kGeneratorExecuting)); | 823 __ LoadSmiLiteral(r5, Smi::FromInt(JSGeneratorObject::kGeneratorExecuting)); |
827 __ StoreP(r5, FieldMemOperand(r4, JSGeneratorObject::kContinuationOffset), | 824 __ StoreP(r5, FieldMemOperand(r4, JSGeneratorObject::kContinuationOffset), |
828 r0); | 825 r0); |
| 826 __ mr(r3, r4); // Continuation expects generator object in r3. |
829 __ Jump(r6); | 827 __ Jump(r6); |
830 } | 828 } |
831 } | 829 } |
832 | 830 |
833 void Builtins::Generate_ConstructedNonConstructable(MacroAssembler* masm) { | 831 void Builtins::Generate_ConstructedNonConstructable(MacroAssembler* masm) { |
834 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); | 832 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); |
835 __ push(r4); | 833 __ push(r4); |
836 __ CallRuntime(Runtime::kThrowConstructedNonConstructable); | 834 __ CallRuntime(Runtime::kThrowConstructedNonConstructable); |
837 } | 835 } |
838 | 836 |
(...skipping 1878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2717 __ bkpt(0); | 2715 __ bkpt(0); |
2718 } | 2716 } |
2719 } | 2717 } |
2720 | 2718 |
2721 | 2719 |
2722 #undef __ | 2720 #undef __ |
2723 } // namespace internal | 2721 } // namespace internal |
2724 } // namespace v8 | 2722 } // namespace v8 |
2725 | 2723 |
2726 #endif // V8_TARGET_ARCH_PPC | 2724 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |