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_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
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 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
699 kRAHasNotBeenSaved, kDontSaveFPRegs); | 699 kRAHasNotBeenSaved, kDontSaveFPRegs); |
700 | 700 |
701 // Store resume mode into generator object. | 701 // Store resume mode into generator object. |
702 __ sd(a2, FieldMemOperand(a1, JSGeneratorObject::kResumeModeOffset)); | 702 __ sd(a2, FieldMemOperand(a1, JSGeneratorObject::kResumeModeOffset)); |
703 | 703 |
704 // Load suspended function and context. | 704 // Load suspended function and context. |
705 __ ld(cp, FieldMemOperand(a1, JSGeneratorObject::kContextOffset)); | 705 __ ld(cp, FieldMemOperand(a1, JSGeneratorObject::kContextOffset)); |
706 __ ld(a4, FieldMemOperand(a1, JSGeneratorObject::kFunctionOffset)); | 706 __ ld(a4, FieldMemOperand(a1, JSGeneratorObject::kFunctionOffset)); |
707 | 707 |
708 // Flood function if we are stepping. | 708 // Flood function if we are stepping. |
709 Label skip_flooding; | 709 Label prepare_step_in_if_stepping, prepare_step_in_suspended_generator; |
| 710 Label stepping_prepared; |
710 ExternalReference step_in_enabled = | 711 ExternalReference step_in_enabled = |
711 ExternalReference::debug_step_in_enabled_address(masm->isolate()); | 712 ExternalReference::debug_step_in_enabled_address(masm->isolate()); |
712 __ li(t1, Operand(step_in_enabled)); | 713 __ li(t1, Operand(step_in_enabled)); |
713 __ lb(t1, MemOperand(t1)); | 714 __ lb(t1, MemOperand(t1)); |
714 __ Branch(&skip_flooding, eq, t1, Operand(zero_reg)); | 715 __ Branch(&prepare_step_in_if_stepping, ne, t1, Operand(zero_reg)); |
715 { | 716 |
716 FrameScope scope(masm, StackFrame::INTERNAL); | 717 // Flood function if we need to continue stepping in the suspended generator. |
717 __ Push(a1, a2, a4); | 718 ExternalReference debug_suspended_generator = |
718 __ CallRuntime(Runtime::kDebugPrepareStepInIfStepping); | 719 ExternalReference::debug_suspended_generator_address(masm->isolate()); |
719 __ Pop(a1, a2); | 720 __ li(t1, Operand(debug_suspended_generator)); |
720 __ ld(a4, FieldMemOperand(a1, JSGeneratorObject::kFunctionOffset)); | 721 __ lw(t1, MemOperand(t1)); |
721 } | 722 __ Branch(&prepare_step_in_suspended_generator, eq, t1, Operand(zero_reg)); |
722 __ bind(&skip_flooding); | 723 __ bind(&stepping_prepared); |
723 | 724 |
724 // Push receiver. | 725 // Push receiver. |
725 __ ld(a5, FieldMemOperand(a1, JSGeneratorObject::kReceiverOffset)); | 726 __ ld(a5, FieldMemOperand(a1, JSGeneratorObject::kReceiverOffset)); |
726 __ Push(a5); | 727 __ Push(a5); |
727 | 728 |
728 // ----------- S t a t e ------------- | 729 // ----------- S t a t e ------------- |
729 // -- a1 : the JSGeneratorObject to resume | 730 // -- a1 : the JSGeneratorObject to resume |
730 // -- a2 : the resume mode (tagged) | 731 // -- a2 : the resume mode (tagged) |
731 // -- a4 : generator function | 732 // -- a4 : generator function |
732 // -- cp : generator context | 733 // -- cp : generator context |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
808 __ ld(a3, FieldMemOperand(a3, SharedFunctionInfo::kCodeOffset)); | 809 __ ld(a3, FieldMemOperand(a3, SharedFunctionInfo::kCodeOffset)); |
809 __ Daddu(a3, a3, Operand(Code::kHeaderSize - kHeapObjectTag)); | 810 __ Daddu(a3, a3, Operand(Code::kHeaderSize - kHeapObjectTag)); |
810 __ ld(a2, FieldMemOperand(a1, JSGeneratorObject::kContinuationOffset)); | 811 __ ld(a2, FieldMemOperand(a1, JSGeneratorObject::kContinuationOffset)); |
811 __ SmiUntag(a2); | 812 __ SmiUntag(a2); |
812 __ Daddu(a3, a3, Operand(a2)); | 813 __ Daddu(a3, a3, Operand(a2)); |
813 __ li(a2, Operand(Smi::FromInt(JSGeneratorObject::kGeneratorExecuting))); | 814 __ li(a2, Operand(Smi::FromInt(JSGeneratorObject::kGeneratorExecuting))); |
814 __ sd(a2, FieldMemOperand(a1, JSGeneratorObject::kContinuationOffset)); | 815 __ sd(a2, FieldMemOperand(a1, JSGeneratorObject::kContinuationOffset)); |
815 __ Move(v0, a1); // Continuation expects generator object in v0. | 816 __ Move(v0, a1); // Continuation expects generator object in v0. |
816 __ Jump(a3); | 817 __ Jump(a3); |
817 } | 818 } |
| 819 |
| 820 __ bind(&prepare_step_in_if_stepping); |
| 821 { |
| 822 FrameScope scope(masm, StackFrame::INTERNAL); |
| 823 __ Push(a1, a2, a4); |
| 824 __ CallRuntime(Runtime::kDebugPrepareStepInIfStepping); |
| 825 __ Pop(a1, a2); |
| 826 } |
| 827 __ Branch(USE_DELAY_SLOT, &stepping_prepared); |
| 828 __ ld(a4, FieldMemOperand(a1, JSGeneratorObject::kFunctionOffset)); |
| 829 |
| 830 __ bind(&prepare_step_in_suspended_generator); |
| 831 { |
| 832 FrameScope scope(masm, StackFrame::INTERNAL); |
| 833 __ Push(a1, a2); |
| 834 __ CallRuntime(Runtime::kDebugPrepareStepInSuspendedGenerator); |
| 835 __ Pop(a1, a2); |
| 836 } |
| 837 __ Branch(USE_DELAY_SLOT, &stepping_prepared); |
| 838 __ ld(a4, FieldMemOperand(a1, JSGeneratorObject::kFunctionOffset)); |
818 } | 839 } |
819 | 840 |
820 void Builtins::Generate_ConstructedNonConstructable(MacroAssembler* masm) { | 841 void Builtins::Generate_ConstructedNonConstructable(MacroAssembler* masm) { |
821 FrameScope scope(masm, StackFrame::INTERNAL); | 842 FrameScope scope(masm, StackFrame::INTERNAL); |
822 __ Push(a1); | 843 __ Push(a1); |
823 __ CallRuntime(Runtime::kThrowConstructedNonConstructable); | 844 __ CallRuntime(Runtime::kThrowConstructedNonConstructable); |
824 } | 845 } |
825 | 846 |
826 | 847 |
827 enum IsTagged { kArgcIsSmiTagged, kArgcIsUntaggedInt }; | 848 enum IsTagged { kArgcIsSmiTagged, kArgcIsUntaggedInt }; |
(...skipping 2021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2849 } | 2870 } |
2850 } | 2871 } |
2851 | 2872 |
2852 | 2873 |
2853 #undef __ | 2874 #undef __ |
2854 | 2875 |
2855 } // namespace internal | 2876 } // namespace internal |
2856 } // namespace v8 | 2877 } // namespace v8 |
2857 | 2878 |
2858 #endif // V8_TARGET_ARCH_MIPS64 | 2879 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |