OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
6 | 6 |
7 #include "src/arm64/frames-arm64.h" | 7 #include "src/arm64/frames-arm64.h" |
8 #include "src/codegen.h" | 8 #include "src/codegen.h" |
9 #include "src/debug/debug.h" | 9 #include "src/debug/debug.h" |
10 #include "src/deoptimizer.h" | 10 #include "src/deoptimizer.h" |
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
720 kLRHasNotBeenSaved, kDontSaveFPRegs); | 720 kLRHasNotBeenSaved, kDontSaveFPRegs); |
721 | 721 |
722 // Store resume mode into generator object. | 722 // Store resume mode into generator object. |
723 __ Str(x2, FieldMemOperand(x1, JSGeneratorObject::kResumeModeOffset)); | 723 __ Str(x2, FieldMemOperand(x1, JSGeneratorObject::kResumeModeOffset)); |
724 | 724 |
725 // Load suspended function and context. | 725 // Load suspended function and context. |
726 __ Ldr(cp, FieldMemOperand(x1, JSGeneratorObject::kContextOffset)); | 726 __ Ldr(cp, FieldMemOperand(x1, JSGeneratorObject::kContextOffset)); |
727 __ Ldr(x4, FieldMemOperand(x1, JSGeneratorObject::kFunctionOffset)); | 727 __ Ldr(x4, FieldMemOperand(x1, JSGeneratorObject::kFunctionOffset)); |
728 | 728 |
729 // Flood function if we are stepping. | 729 // Flood function if we are stepping. |
730 Label skip_flooding; | 730 Label prepare_step_in_if_stepping, prepare_step_in_suspended_generator; |
| 731 Label stepping_prepared; |
731 ExternalReference step_in_enabled = | 732 ExternalReference step_in_enabled = |
732 ExternalReference::debug_step_in_enabled_address(masm->isolate()); | 733 ExternalReference::debug_step_in_enabled_address(masm->isolate()); |
733 __ Mov(x10, Operand(step_in_enabled)); | 734 __ Mov(x10, Operand(step_in_enabled)); |
734 __ Ldrb(x10, MemOperand(x10)); | 735 __ Ldrb(x10, MemOperand(x10)); |
735 __ CompareAndBranch(x10, Operand(0), eq, &skip_flooding); | 736 __ CompareAndBranch(x10, Operand(0), ne, &prepare_step_in_if_stepping); |
736 { | 737 |
737 FrameScope scope(masm, StackFrame::INTERNAL); | 738 // Flood function if we need to continue stepping in the suspended generator. |
738 __ Push(x1, x2, x4); | 739 ExternalReference debug_suspended_generator = |
739 __ CallRuntime(Runtime::kDebugPrepareStepInIfStepping); | 740 ExternalReference::debug_suspended_generator_address(masm->isolate()); |
740 __ Pop(x2, x1); | 741 __ Mov(x10, Operand(debug_suspended_generator)); |
741 __ Ldr(x4, FieldMemOperand(x1, JSGeneratorObject::kFunctionOffset)); | 742 __ Ldr(x10, MemOperand(x10)); |
742 } | 743 __ CompareAndBranch(x10, Operand(x1), eq, |
743 __ bind(&skip_flooding); | 744 &prepare_step_in_suspended_generator); |
| 745 __ Bind(&stepping_prepared); |
744 | 746 |
745 // Push receiver. | 747 // Push receiver. |
746 __ Ldr(x5, FieldMemOperand(x1, JSGeneratorObject::kReceiverOffset)); | 748 __ Ldr(x5, FieldMemOperand(x1, JSGeneratorObject::kReceiverOffset)); |
747 __ Push(x5); | 749 __ Push(x5); |
748 | 750 |
749 // ----------- S t a t e ------------- | 751 // ----------- S t a t e ------------- |
750 // -- x1 : the JSGeneratorObject to resume | 752 // -- x1 : the JSGeneratorObject to resume |
751 // -- x2 : the resume mode (tagged) | 753 // -- x2 : the resume mode (tagged) |
752 // -- x4 : generator function | 754 // -- x4 : generator function |
753 // -- cp : generator context | 755 // -- cp : generator context |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
821 __ Ldr(x10, FieldMemOperand(x10, SharedFunctionInfo::kCodeOffset)); | 823 __ Ldr(x10, FieldMemOperand(x10, SharedFunctionInfo::kCodeOffset)); |
822 __ Add(x10, x10, Code::kHeaderSize - kHeapObjectTag); | 824 __ Add(x10, x10, Code::kHeaderSize - kHeapObjectTag); |
823 __ Ldrsw(x11, | 825 __ Ldrsw(x11, |
824 UntagSmiFieldMemOperand(x1, JSGeneratorObject::kContinuationOffset)); | 826 UntagSmiFieldMemOperand(x1, JSGeneratorObject::kContinuationOffset)); |
825 __ Add(x10, x10, x11); | 827 __ Add(x10, x10, x11); |
826 __ Mov(x12, Smi::FromInt(JSGeneratorObject::kGeneratorExecuting)); | 828 __ Mov(x12, Smi::FromInt(JSGeneratorObject::kGeneratorExecuting)); |
827 __ Str(x12, FieldMemOperand(x1, JSGeneratorObject::kContinuationOffset)); | 829 __ Str(x12, FieldMemOperand(x1, JSGeneratorObject::kContinuationOffset)); |
828 __ Move(x0, x1); // Continuation expects generator object in x0. | 830 __ Move(x0, x1); // Continuation expects generator object in x0. |
829 __ Br(x10); | 831 __ Br(x10); |
830 } | 832 } |
| 833 |
| 834 __ Bind(&prepare_step_in_if_stepping); |
| 835 { |
| 836 FrameScope scope(masm, StackFrame::INTERNAL); |
| 837 __ Push(x1, x2, x4); |
| 838 __ CallRuntime(Runtime::kDebugPrepareStepInIfStepping); |
| 839 __ Pop(x2, x1); |
| 840 __ Ldr(x4, FieldMemOperand(x1, JSGeneratorObject::kFunctionOffset)); |
| 841 } |
| 842 __ B(&stepping_prepared); |
| 843 |
| 844 __ Bind(&prepare_step_in_suspended_generator); |
| 845 { |
| 846 FrameScope scope(masm, StackFrame::INTERNAL); |
| 847 __ Push(x1, x2); |
| 848 __ CallRuntime(Runtime::kDebugPrepareStepInSuspendedGenerator); |
| 849 __ Pop(x2, x1); |
| 850 __ Ldr(x4, FieldMemOperand(x1, JSGeneratorObject::kFunctionOffset)); |
| 851 } |
| 852 __ B(&stepping_prepared); |
831 } | 853 } |
832 | 854 |
833 enum IsTagged { kArgcIsSmiTagged, kArgcIsUntaggedInt }; | 855 enum IsTagged { kArgcIsSmiTagged, kArgcIsUntaggedInt }; |
834 | 856 |
835 | 857 |
836 // Clobbers x10, x15; preserves all other registers. | 858 // Clobbers x10, x15; preserves all other registers. |
837 static void Generate_CheckStackOverflow(MacroAssembler* masm, Register argc, | 859 static void Generate_CheckStackOverflow(MacroAssembler* masm, Register argc, |
838 IsTagged argc_is_tagged) { | 860 IsTagged argc_is_tagged) { |
839 // Check the stack for overflow. | 861 // Check the stack for overflow. |
840 // We are not trying to catch interruptions (e.g. debug break and | 862 // We are not trying to catch interruptions (e.g. debug break and |
(...skipping 2046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2887 } | 2909 } |
2888 } | 2910 } |
2889 | 2911 |
2890 | 2912 |
2891 #undef __ | 2913 #undef __ |
2892 | 2914 |
2893 } // namespace internal | 2915 } // namespace internal |
2894 } // namespace v8 | 2916 } // namespace v8 |
2895 | 2917 |
2896 #endif // V8_TARGET_ARCH_ARM | 2918 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |