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 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
648 Generate_JSConstructStubHelper(masm, false, false, false); | 648 Generate_JSConstructStubHelper(masm, false, false, false); |
649 } | 649 } |
650 | 650 |
651 void Builtins::Generate_JSBuiltinsConstructStubForDerived( | 651 void Builtins::Generate_JSBuiltinsConstructStubForDerived( |
652 MacroAssembler* masm) { | 652 MacroAssembler* masm) { |
653 Generate_JSConstructStubHelper(masm, false, false, true); | 653 Generate_JSConstructStubHelper(masm, false, false, true); |
654 } | 654 } |
655 | 655 |
656 // static | 656 // static |
657 void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) { | 657 void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) { |
| 658 Generate_ResumeGenerator(masm, ResumeGeneratorType::kGenerator); |
| 659 } |
| 660 |
| 661 // static |
| 662 void Builtins::Generate_ResumeAsyncGeneratorTrampoline(MacroAssembler* masm) { |
| 663 Generate_ResumeGenerator(masm, ResumeGeneratorType::kAsyncGenerator); |
| 664 } |
| 665 |
| 666 // static |
| 667 void Builtins::Generate_ResumeAwaitedAsyncGeneratorTrampoline( |
| 668 MacroAssembler* masm) { |
| 669 Generate_ResumeGenerator(masm, ResumeGeneratorType::kAwaitedAsyncGenerator); |
| 670 } |
| 671 |
| 672 void Builtins::Generate_ResumeGenerator(MacroAssembler* masm, |
| 673 ResumeGeneratorType type) { |
658 // ----------- S t a t e ------------- | 674 // ----------- S t a t e ------------- |
659 // -- r3 : the value to pass to the generator | 675 // -- r3 : the value to pass to the generator |
660 // -- r4 : the JSGeneratorObject to resume | 676 // -- r4 : the JSGeneratorObject to resume |
661 // -- r5 : the resume mode (tagged) | 677 // -- r5 : the resume mode (tagged) |
662 // -- lr : return address | 678 // -- lr : return address |
663 // ----------------------------------- | 679 // ----------------------------------- |
664 __ AssertGeneratorObject(r4); | 680 if (type == ResumeGeneratorType::kGenerator) { |
| 681 __ AssertGeneratorObject(r4); |
| 682 } else { |
| 683 __ AssertAsyncGeneratorObject(r4); |
| 684 } |
665 | 685 |
666 // Store input value into generator object. | 686 // Store input value into generator object. |
667 __ StoreP(r3, FieldMemOperand(r4, JSGeneratorObject::kInputOrDebugPosOffset), | 687 int offset = type == ResumeGeneratorType::kAwaitedAsyncGenerator |
668 r0); | 688 ? JSAsyncGeneratorObject::kAwaitInputOrDebugPosOffset |
669 __ RecordWriteField(r4, JSGeneratorObject::kInputOrDebugPosOffset, r3, r6, | 689 : JSGeneratorObject::kInputOrDebugPosOffset; |
670 kLRHasNotBeenSaved, kDontSaveFPRegs); | 690 __ StoreP(r3, FieldMemOperand(r4, offset), r0); |
| 691 __ RecordWriteField(r4, offset, r3, r6, kLRHasNotBeenSaved, kDontSaveFPRegs); |
671 | 692 |
672 // Store resume mode into generator object. | 693 // Store resume mode into generator object. |
673 __ StoreP(r5, FieldMemOperand(r4, JSGeneratorObject::kResumeModeOffset), r0); | 694 __ StoreP(r5, FieldMemOperand(r4, JSGeneratorObject::kResumeModeOffset), r0); |
674 | 695 |
675 // Load suspended function and context. | 696 // Load suspended function and context. |
676 __ LoadP(r7, FieldMemOperand(r4, JSGeneratorObject::kFunctionOffset)); | 697 __ LoadP(r7, FieldMemOperand(r4, JSGeneratorObject::kFunctionOffset)); |
677 __ LoadP(cp, FieldMemOperand(r7, JSFunction::kContextOffset)); | 698 __ LoadP(cp, FieldMemOperand(r7, JSFunction::kContextOffset)); |
678 | 699 |
679 // Flood function if we are stepping. | 700 // Flood function if we are stepping. |
680 Label prepare_step_in_if_stepping, prepare_step_in_suspended_generator; | 701 Label prepare_step_in_if_stepping, prepare_step_in_suspended_generator; |
(...skipping 2371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3052 } | 3073 } |
3053 // Now jump to the instructions of the returned code object. | 3074 // Now jump to the instructions of the returned code object. |
3054 __ Jump(r11); | 3075 __ Jump(r11); |
3055 } | 3076 } |
3056 | 3077 |
3057 #undef __ | 3078 #undef __ |
3058 } // namespace internal | 3079 } // namespace internal |
3059 } // namespace v8 | 3080 } // namespace v8 |
3060 | 3081 |
3061 #endif // V8_TARGET_ARCH_PPC | 3082 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |