| 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) { | |
| 672 // ----------- S t a t e ------------- | 656 // ----------- S t a t e ------------- |
| 673 // -- r2 : the value to pass to the generator | 657 // -- r2 : the value to pass to the generator |
| 674 // -- r3 : the JSGeneratorObject to resume | 658 // -- r3 : the JSGeneratorObject to resume |
| 675 // -- r4 : the resume mode (tagged) | 659 // -- r4 : the resume mode (tagged) |
| 660 // -- r5 : the SuspendFlags of the earlier suspend call (tagged) |
| 676 // -- lr : return address | 661 // -- lr : return address |
| 677 // ----------------------------------- | 662 // ----------------------------------- |
| 678 if (type == ResumeGeneratorType::kGenerator) { | 663 __ SmiUntag(r5); |
| 679 __ AssertGeneratorObject(r3); | 664 __ AssertGeneratorObject(r3, r5); |
| 680 } else { | |
| 681 __ AssertAsyncGeneratorObject(r3); | |
| 682 } | |
| 683 | 665 |
| 684 // Store input value into generator object. | 666 // Store input value into generator object. |
| 685 int offset = type == ResumeGeneratorType::kAwaitedAsyncGenerator | 667 Label async_await, done_store_input; |
| 686 ? JSAsyncGeneratorObject::kAwaitInputOrDebugPosOffset | 668 |
| 687 : JSGeneratorObject::kInputOrDebugPosOffset; | 669 __ And(r5, r5, Operand(static_cast<int>(SuspendFlags::kAsyncGeneratorAwait))); |
| 688 __ StoreP(r2, FieldMemOperand(r3, offset), r0); | 670 __ CmpP(r5, Operand(static_cast<int>(SuspendFlags::kAsyncGeneratorAwait))); |
| 689 __ RecordWriteField(r3, offset, r2, r5, kLRHasNotBeenSaved, kDontSaveFPRegs); | 671 __ beq(&async_await); |
| 672 |
| 673 __ StoreP(r2, FieldMemOperand(r3, JSGeneratorObject::kInputOrDebugPosOffset), |
| 674 r0); |
| 675 __ RecordWriteField(r3, JSGeneratorObject::kInputOrDebugPosOffset, r2, r5, |
| 676 kLRHasNotBeenSaved, kDontSaveFPRegs); |
| 677 __ b(&done_store_input); |
| 678 |
| 679 __ bind(&async_await); |
| 680 __ StoreP( |
| 681 r2, |
| 682 FieldMemOperand(r3, JSAsyncGeneratorObject::kAwaitInputOrDebugPosOffset), |
| 683 r0); |
| 684 __ RecordWriteField(r3, JSAsyncGeneratorObject::kAwaitInputOrDebugPosOffset, |
| 685 r2, r5, kLRHasNotBeenSaved, kDontSaveFPRegs); |
| 686 __ b(&done_store_input); |
| 687 |
| 688 __ bind(&done_store_input); |
| 689 // `r5` no longer holds SuspendFlags |
| 690 | 690 |
| 691 // Store resume mode into generator object. | 691 // Store resume mode into generator object. |
| 692 __ StoreP(r4, FieldMemOperand(r3, JSGeneratorObject::kResumeModeOffset)); | 692 __ StoreP(r4, FieldMemOperand(r3, JSGeneratorObject::kResumeModeOffset)); |
| 693 | 693 |
| 694 // Load suspended function and context. | 694 // Load suspended function and context. |
| 695 __ LoadP(r6, FieldMemOperand(r3, JSGeneratorObject::kFunctionOffset)); | 695 __ LoadP(r6, FieldMemOperand(r3, JSGeneratorObject::kFunctionOffset)); |
| 696 __ LoadP(cp, FieldMemOperand(r6, JSFunction::kContextOffset)); | 696 __ LoadP(cp, FieldMemOperand(r6, JSFunction::kContextOffset)); |
| 697 | 697 |
| 698 // Flood function if we are stepping. | 698 // Flood function if we are stepping. |
| 699 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... |
| 3088 // Now jump to the instructions of the returned code object. | 3088 // Now jump to the instructions of the returned code object. |
| 3089 __ Jump(ip); | 3089 __ Jump(ip); |
| 3090 } | 3090 } |
| 3091 | 3091 |
| 3092 #undef __ | 3092 #undef __ |
| 3093 | 3093 |
| 3094 } // namespace internal | 3094 } // namespace internal |
| 3095 } // namespace v8 | 3095 } // namespace v8 |
| 3096 | 3096 |
| 3097 #endif // V8_TARGET_ARCH_S390 | 3097 #endif // V8_TARGET_ARCH_S390 |
| OLD | NEW |