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_S390 | 5 #if V8_TARGET_ARCH_S390 |
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 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
701 // -- r4 : the resume mode (tagged) | 701 // -- r4 : the resume mode (tagged) |
702 // -- lr : return address | 702 // -- lr : return address |
703 // ----------------------------------- | 703 // ----------------------------------- |
704 __ AssertGeneratorObject(r3); | 704 __ AssertGeneratorObject(r3); |
705 | 705 |
706 // Store input value into generator object. | 706 // Store input value into generator object. |
707 __ StoreP(r2, FieldMemOperand(r3, JSGeneratorObject::kInputOffset), r0); | 707 __ StoreP(r2, FieldMemOperand(r3, JSGeneratorObject::kInputOffset), r0); |
708 __ RecordWriteField(r3, JSGeneratorObject::kInputOffset, r2, r5, | 708 __ RecordWriteField(r3, JSGeneratorObject::kInputOffset, r2, r5, |
709 kLRHasNotBeenSaved, kDontSaveFPRegs); | 709 kLRHasNotBeenSaved, kDontSaveFPRegs); |
710 | 710 |
| 711 // Store resume mode into generator object. |
| 712 __ StoreP(r4, FieldMemOperand(r3, JSGeneratorObject::kResumeModeOffset)); |
| 713 |
711 // Load suspended function and context. | 714 // Load suspended function and context. |
712 __ LoadP(cp, FieldMemOperand(r3, JSGeneratorObject::kContextOffset)); | 715 __ LoadP(cp, FieldMemOperand(r3, JSGeneratorObject::kContextOffset)); |
713 __ LoadP(r6, FieldMemOperand(r3, JSGeneratorObject::kFunctionOffset)); | 716 __ LoadP(r6, FieldMemOperand(r3, JSGeneratorObject::kFunctionOffset)); |
714 | 717 |
715 // Flood function if we are stepping. | 718 // Flood function if we are stepping. |
716 Label skip_flooding; | 719 Label skip_flooding; |
717 ExternalReference step_in_enabled = | 720 ExternalReference step_in_enabled = |
718 ExternalReference::debug_step_in_enabled_address(masm->isolate()); | 721 ExternalReference::debug_step_in_enabled_address(masm->isolate()); |
719 __ mov(ip, Operand(step_in_enabled)); | 722 __ mov(ip, Operand(step_in_enabled)); |
720 __ LoadlB(ip, MemOperand(ip)); | 723 __ LoadlB(ip, MemOperand(ip)); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
784 __ beq(&done_loop); | 787 __ beq(&done_loop); |
785 __ LoadRR(r1, r5); | 788 __ LoadRR(r1, r5); |
786 __ bind(&loop); | 789 __ bind(&loop); |
787 __ LoadP(ip, MemOperand(r2, kPointerSize)); | 790 __ LoadP(ip, MemOperand(r2, kPointerSize)); |
788 __ la(r2, MemOperand(r2, kPointerSize)); | 791 __ la(r2, MemOperand(r2, kPointerSize)); |
789 __ Push(ip); | 792 __ Push(ip); |
790 __ BranchOnCount(r1, &loop); | 793 __ BranchOnCount(r1, &loop); |
791 __ bind(&done_loop); | 794 __ bind(&done_loop); |
792 } | 795 } |
793 | 796 |
794 // Push resume mode (consumed in continuation). | |
795 __ Push(r4); | |
796 | |
797 // Reset operand stack so we don't leak. | 797 // Reset operand stack so we don't leak. |
798 __ LoadRoot(ip, Heap::kEmptyFixedArrayRootIndex); | 798 __ LoadRoot(ip, Heap::kEmptyFixedArrayRootIndex); |
799 __ StoreP(ip, FieldMemOperand(r3, JSGeneratorObject::kOperandStackOffset), | 799 __ StoreP(ip, FieldMemOperand(r3, JSGeneratorObject::kOperandStackOffset), |
800 r0); | 800 r0); |
801 | 801 |
802 // Restore value. | |
803 __ LoadP(r2, FieldMemOperand(r3, JSGeneratorObject::kInputOffset)); | |
804 | |
805 // Resume the generator function at the continuation. | 802 // Resume the generator function at the continuation. |
806 __ LoadP(r5, FieldMemOperand(r6, JSFunction::kSharedFunctionInfoOffset)); | 803 __ LoadP(r5, FieldMemOperand(r6, JSFunction::kSharedFunctionInfoOffset)); |
807 __ LoadP(r5, FieldMemOperand(r5, SharedFunctionInfo::kCodeOffset)); | 804 __ LoadP(r5, FieldMemOperand(r5, SharedFunctionInfo::kCodeOffset)); |
808 __ AddP(r5, r5, Operand(Code::kHeaderSize - kHeapObjectTag)); | 805 __ AddP(r5, r5, Operand(Code::kHeaderSize - kHeapObjectTag)); |
809 { | 806 { |
810 ConstantPoolUnavailableScope constant_pool_unavailable(masm); | 807 ConstantPoolUnavailableScope constant_pool_unavailable(masm); |
811 __ LoadP(r4, FieldMemOperand(r3, JSGeneratorObject::kContinuationOffset)); | 808 __ LoadP(r4, FieldMemOperand(r3, JSGeneratorObject::kContinuationOffset)); |
812 __ SmiUntag(r4); | 809 __ SmiUntag(r4); |
813 __ AddP(r5, r5, r4); | 810 __ AddP(r5, r5, r4); |
814 __ LoadSmiLiteral(r4, Smi::FromInt(JSGeneratorObject::kGeneratorExecuting)); | 811 __ LoadSmiLiteral(r4, Smi::FromInt(JSGeneratorObject::kGeneratorExecuting)); |
815 __ StoreP(r4, FieldMemOperand(r3, JSGeneratorObject::kContinuationOffset), | 812 __ StoreP(r4, FieldMemOperand(r3, JSGeneratorObject::kContinuationOffset), |
816 r0); | 813 r0); |
| 814 __ LoadRR(r2, r3); // Continuation expects generator object in r2. |
817 __ Jump(r5); | 815 __ Jump(r5); |
818 } | 816 } |
819 } | 817 } |
820 | 818 |
821 void Builtins::Generate_ConstructedNonConstructable(MacroAssembler* masm) { | 819 void Builtins::Generate_ConstructedNonConstructable(MacroAssembler* masm) { |
822 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); | 820 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); |
823 __ push(r3); | 821 __ push(r3); |
824 __ CallRuntime(Runtime::kThrowConstructedNonConstructable); | 822 __ CallRuntime(Runtime::kThrowConstructedNonConstructable); |
825 } | 823 } |
826 | 824 |
(...skipping 1844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2671 __ bkpt(0); | 2669 __ bkpt(0); |
2672 } | 2670 } |
2673 } | 2671 } |
2674 | 2672 |
2675 #undef __ | 2673 #undef __ |
2676 | 2674 |
2677 } // namespace internal | 2675 } // namespace internal |
2678 } // namespace v8 | 2676 } // namespace v8 |
2679 | 2677 |
2680 #endif // V8_TARGET_ARCH_S390 | 2678 #endif // V8_TARGET_ARCH_S390 |
OLD | NEW |