OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_ARM | 5 #if V8_TARGET_ARCH_ARM |
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 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
713 kLRHasNotBeenSaved, kDontSaveFPRegs); | 713 kLRHasNotBeenSaved, kDontSaveFPRegs); |
714 | 714 |
715 // Store resume mode into generator object. | 715 // Store resume mode into generator object. |
716 __ str(r2, FieldMemOperand(r1, JSGeneratorObject::kResumeModeOffset)); | 716 __ str(r2, FieldMemOperand(r1, JSGeneratorObject::kResumeModeOffset)); |
717 | 717 |
718 // Load suspended function and context. | 718 // Load suspended function and context. |
719 __ ldr(cp, FieldMemOperand(r1, JSGeneratorObject::kContextOffset)); | 719 __ ldr(cp, FieldMemOperand(r1, JSGeneratorObject::kContextOffset)); |
720 __ ldr(r4, FieldMemOperand(r1, JSGeneratorObject::kFunctionOffset)); | 720 __ ldr(r4, FieldMemOperand(r1, JSGeneratorObject::kFunctionOffset)); |
721 | 721 |
722 // Flood function if we are stepping. | 722 // Flood function if we are stepping. |
723 Label skip_flooding; | 723 Label prepare_step_in_if_stepping, prepare_step_in_suspended_generator; |
| 724 Label stepping_prepared; |
724 ExternalReference step_in_enabled = | 725 ExternalReference step_in_enabled = |
725 ExternalReference::debug_step_in_enabled_address(masm->isolate()); | 726 ExternalReference::debug_step_in_enabled_address(masm->isolate()); |
726 __ mov(ip, Operand(step_in_enabled)); | 727 __ mov(ip, Operand(step_in_enabled)); |
727 __ ldrb(ip, MemOperand(ip)); | 728 __ ldrb(ip, MemOperand(ip)); |
728 __ cmp(ip, Operand(0)); | 729 __ cmp(ip, Operand(0)); |
729 __ b(eq, &skip_flooding); | 730 __ b(ne, &prepare_step_in_if_stepping); |
730 { | 731 |
731 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); | 732 // Flood function if we need to continue stepping in the suspended generator. |
732 __ Push(r1, r2, r4); | 733 ExternalReference debug_suspended_generator = |
733 __ CallRuntime(Runtime::kDebugPrepareStepInIfStepping); | 734 ExternalReference::debug_suspended_generator_address(masm->isolate()); |
734 __ Pop(r1, r2); | 735 __ mov(ip, Operand(debug_suspended_generator)); |
735 __ ldr(r4, FieldMemOperand(r1, JSGeneratorObject::kFunctionOffset)); | 736 __ ldr(ip, MemOperand(ip)); |
736 } | 737 __ cmp(ip, Operand(r1)); |
737 __ bind(&skip_flooding); | 738 __ b(eq, &prepare_step_in_suspended_generator); |
| 739 __ bind(&stepping_prepared); |
738 | 740 |
739 // Push receiver. | 741 // Push receiver. |
740 __ ldr(ip, FieldMemOperand(r1, JSGeneratorObject::kReceiverOffset)); | 742 __ ldr(ip, FieldMemOperand(r1, JSGeneratorObject::kReceiverOffset)); |
741 __ Push(ip); | 743 __ Push(ip); |
742 | 744 |
743 // ----------- S t a t e ------------- | 745 // ----------- S t a t e ------------- |
744 // -- r1 : the JSGeneratorObject to resume | 746 // -- r1 : the JSGeneratorObject to resume |
745 // -- r2 : the resume mode (tagged) | 747 // -- r2 : the resume mode (tagged) |
746 // -- r4 : generator function | 748 // -- r4 : generator function |
747 // -- cp : generator context | 749 // -- cp : generator context |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
823 __ ldr(r3, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset)); | 825 __ ldr(r3, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset)); |
824 __ ldr(r3, FieldMemOperand(r3, SharedFunctionInfo::kCodeOffset)); | 826 __ ldr(r3, FieldMemOperand(r3, SharedFunctionInfo::kCodeOffset)); |
825 __ add(r3, r3, Operand(Code::kHeaderSize - kHeapObjectTag)); | 827 __ add(r3, r3, Operand(Code::kHeaderSize - kHeapObjectTag)); |
826 __ ldr(r2, FieldMemOperand(r1, JSGeneratorObject::kContinuationOffset)); | 828 __ ldr(r2, FieldMemOperand(r1, JSGeneratorObject::kContinuationOffset)); |
827 __ add(r3, r3, Operand(r2, ASR, 1)); | 829 __ add(r3, r3, Operand(r2, ASR, 1)); |
828 __ mov(r2, Operand(Smi::FromInt(JSGeneratorObject::kGeneratorExecuting))); | 830 __ mov(r2, Operand(Smi::FromInt(JSGeneratorObject::kGeneratorExecuting))); |
829 __ str(r2, FieldMemOperand(r1, JSGeneratorObject::kContinuationOffset)); | 831 __ str(r2, FieldMemOperand(r1, JSGeneratorObject::kContinuationOffset)); |
830 __ Move(r0, r1); // Continuation expects generator object in r0. | 832 __ Move(r0, r1); // Continuation expects generator object in r0. |
831 __ Jump(r3); | 833 __ Jump(r3); |
832 } | 834 } |
| 835 |
| 836 __ bind(&prepare_step_in_if_stepping); |
| 837 { |
| 838 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); |
| 839 __ Push(r1, r2, r4); |
| 840 __ CallRuntime(Runtime::kDebugPrepareStepInIfStepping); |
| 841 __ Pop(r1, r2); |
| 842 __ ldr(r4, FieldMemOperand(r1, JSGeneratorObject::kFunctionOffset)); |
| 843 } |
| 844 __ b(&stepping_prepared); |
| 845 |
| 846 __ bind(&prepare_step_in_suspended_generator); |
| 847 { |
| 848 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); |
| 849 __ Push(r1, r2); |
| 850 __ CallRuntime(Runtime::kDebugPrepareStepInSuspendedGenerator); |
| 851 __ Pop(r1, r2); |
| 852 __ ldr(r4, FieldMemOperand(r1, JSGeneratorObject::kFunctionOffset)); |
| 853 } |
| 854 __ b(&stepping_prepared); |
833 } | 855 } |
834 | 856 |
835 void Builtins::Generate_ConstructedNonConstructable(MacroAssembler* masm) { | 857 void Builtins::Generate_ConstructedNonConstructable(MacroAssembler* masm) { |
836 FrameScope scope(masm, StackFrame::INTERNAL); | 858 FrameScope scope(masm, StackFrame::INTERNAL); |
837 __ push(r1); | 859 __ push(r1); |
838 __ CallRuntime(Runtime::kThrowConstructedNonConstructable); | 860 __ CallRuntime(Runtime::kThrowConstructedNonConstructable); |
839 } | 861 } |
840 | 862 |
841 | 863 |
842 enum IsTagged { kArgcIsSmiTagged, kArgcIsUntaggedInt }; | 864 enum IsTagged { kArgcIsSmiTagged, kArgcIsUntaggedInt }; |
(...skipping 1932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2775 } | 2797 } |
2776 } | 2798 } |
2777 | 2799 |
2778 | 2800 |
2779 #undef __ | 2801 #undef __ |
2780 | 2802 |
2781 } // namespace internal | 2803 } // namespace internal |
2782 } // namespace v8 | 2804 } // namespace v8 |
2783 | 2805 |
2784 #endif // V8_TARGET_ARCH_ARM | 2806 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |