| 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 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 Generate_JSConstructStubHelper(masm, false, false, false); | 646 Generate_JSConstructStubHelper(masm, false, false, false); |
| 647 } | 647 } |
| 648 | 648 |
| 649 void Builtins::Generate_JSBuiltinsConstructStubForDerived( | 649 void Builtins::Generate_JSBuiltinsConstructStubForDerived( |
| 650 MacroAssembler* masm) { | 650 MacroAssembler* masm) { |
| 651 Generate_JSConstructStubHelper(masm, false, false, true); | 651 Generate_JSConstructStubHelper(masm, false, false, true); |
| 652 } | 652 } |
| 653 | 653 |
| 654 // static | 654 // static |
| 655 void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) { | 655 void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) { |
| 656 Generate_ResumeGenerator(masm, ResumeGeneratorType::kGenerator); |
| 657 } |
| 658 |
| 659 // static |
| 660 void Builtins::Generate_ResumeAsyncGeneratorTrampoline(MacroAssembler* masm) { |
| 661 Generate_ResumeGenerator(masm, ResumeGeneratorType::kAsyncGenerator); |
| 662 } |
| 663 |
| 664 // static |
| 665 void Builtins::Generate_ResumeAwaitedAsyncGeneratorTrampoline( |
| 666 MacroAssembler* masm) { |
| 667 Generate_ResumeGenerator(masm, ResumeGeneratorType::kAwaitedAsyncGenerator); |
| 668 } |
| 669 |
| 670 void Builtins::Generate_ResumeGenerator(MacroAssembler* masm, |
| 671 ResumeGeneratorType type) { |
| 656 // ----------- S t a t e ------------- | 672 // ----------- S t a t e ------------- |
| 657 // -- r2 : the value to pass to the generator | 673 // -- r2 : the value to pass to the generator |
| 658 // -- r3 : the JSGeneratorObject to resume | 674 // -- r3 : the JSGeneratorObject to resume |
| 659 // -- r4 : the resume mode (tagged) | 675 // -- r4 : the resume mode (tagged) |
| 660 // -- lr : return address | 676 // -- lr : return address |
| 661 // ----------------------------------- | 677 // ----------------------------------- |
| 662 __ AssertGeneratorObject(r3); | 678 if (type == ResumeGeneratorType::kGenerator) { |
| 679 __ AssertGeneratorObject(r3); |
| 680 } else { |
| 681 __ AssertAsyncGeneratorObject(r3); |
| 682 } |
| 663 | 683 |
| 664 // Store input value into generator object. | 684 // Store input value into generator object. |
| 665 __ StoreP(r2, FieldMemOperand(r3, JSGeneratorObject::kInputOrDebugPosOffset), | 685 int offset = type == ResumeGeneratorType::kAwaitedAsyncGenerator |
| 666 r0); | 686 ? JSAsyncGeneratorObject::kAwaitInputOrDebugPosOffset |
| 667 __ RecordWriteField(r3, JSGeneratorObject::kInputOrDebugPosOffset, r2, r5, | 687 : JSGeneratorObject::kInputOrDebugPosOffset; |
| 668 kLRHasNotBeenSaved, kDontSaveFPRegs); | 688 __ StoreP(r2, FieldMemOperand(r3, offset), r0); |
| 689 __ RecordWriteField(r3, offset, r2, r5, kLRHasNotBeenSaved, kDontSaveFPRegs); |
| 669 | 690 |
| 670 // Store resume mode into generator object. | 691 // Store resume mode into generator object. |
| 671 __ StoreP(r4, FieldMemOperand(r3, JSGeneratorObject::kResumeModeOffset)); | 692 __ StoreP(r4, FieldMemOperand(r3, JSGeneratorObject::kResumeModeOffset)); |
| 672 | 693 |
| 673 // Load suspended function and context. | 694 // Load suspended function and context. |
| 674 __ LoadP(r6, FieldMemOperand(r3, JSGeneratorObject::kFunctionOffset)); | 695 __ LoadP(r6, FieldMemOperand(r3, JSGeneratorObject::kFunctionOffset)); |
| 675 __ LoadP(cp, FieldMemOperand(r6, JSFunction::kContextOffset)); | 696 __ LoadP(cp, FieldMemOperand(r6, JSFunction::kContextOffset)); |
| 676 | 697 |
| 677 // Flood function if we are stepping. | 698 // Flood function if we are stepping. |
| 678 Label prepare_step_in_if_stepping, prepare_step_in_suspended_generator; | 699 Label prepare_step_in_if_stepping, prepare_step_in_suspended_generator; |
| (...skipping 2388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3067 // Now jump to the instructions of the returned code object. | 3088 // Now jump to the instructions of the returned code object. |
| 3068 __ Jump(ip); | 3089 __ Jump(ip); |
| 3069 } | 3090 } |
| 3070 | 3091 |
| 3071 #undef __ | 3092 #undef __ |
| 3072 | 3093 |
| 3073 } // namespace internal | 3094 } // namespace internal |
| 3074 } // namespace v8 | 3095 } // namespace v8 |
| 3075 | 3096 |
| 3076 #endif // V8_TARGET_ARCH_S390 | 3097 #endif // V8_TARGET_ARCH_S390 |
| OLD | NEW |