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_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
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 823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 kRAHasNotBeenSaved, kDontSaveFPRegs); | 834 kRAHasNotBeenSaved, kDontSaveFPRegs); |
835 | 835 |
836 // Store resume mode into generator object. | 836 // Store resume mode into generator object. |
837 __ sw(a2, FieldMemOperand(a1, JSGeneratorObject::kResumeModeOffset)); | 837 __ sw(a2, FieldMemOperand(a1, JSGeneratorObject::kResumeModeOffset)); |
838 | 838 |
839 // Load suspended function and context. | 839 // Load suspended function and context. |
840 __ lw(cp, FieldMemOperand(a1, JSGeneratorObject::kContextOffset)); | 840 __ lw(cp, FieldMemOperand(a1, JSGeneratorObject::kContextOffset)); |
841 __ lw(t0, FieldMemOperand(a1, JSGeneratorObject::kFunctionOffset)); | 841 __ lw(t0, FieldMemOperand(a1, JSGeneratorObject::kFunctionOffset)); |
842 | 842 |
843 // Flood function if we are stepping. | 843 // Flood function if we are stepping. |
844 Label skip_flooding; | 844 Label prepare_step_in_if_stepping, prepare_step_in_suspended_generator; |
| 845 Label stepping_prepared; |
845 ExternalReference step_in_enabled = | 846 ExternalReference step_in_enabled = |
846 ExternalReference::debug_step_in_enabled_address(masm->isolate()); | 847 ExternalReference::debug_step_in_enabled_address(masm->isolate()); |
847 __ li(t1, Operand(step_in_enabled)); | 848 __ li(t1, Operand(step_in_enabled)); |
848 __ lb(t1, MemOperand(t1)); | 849 __ lb(t1, MemOperand(t1)); |
849 __ Branch(&skip_flooding, eq, t1, Operand(zero_reg)); | 850 __ Branch(&prepare_step_in_if_stepping, ne, t1, Operand(zero_reg)); |
850 { | 851 |
851 FrameScope scope(masm, StackFrame::INTERNAL); | 852 // Flood function if we need to continue stepping in the suspended generator. |
852 __ Push(a1, a2, t0); | 853 ExternalReference debug_suspended_generator = |
853 __ CallRuntime(Runtime::kDebugPrepareStepInIfStepping); | 854 ExternalReference::debug_suspended_generator_address(masm->isolate()); |
854 __ Pop(a1, a2); | 855 __ li(t1, Operand(debug_suspended_generator)); |
855 __ lw(t0, FieldMemOperand(a1, JSGeneratorObject::kFunctionOffset)); | 856 __ lw(t1, MemOperand(t1)); |
856 } | 857 __ Branch(&prepare_step_in_suspended_generator, eq, t1, Operand(zero_reg)); |
857 __ bind(&skip_flooding); | 858 __ bind(&stepping_prepared); |
858 | 859 |
859 // Push receiver. | 860 // Push receiver. |
860 __ lw(t1, FieldMemOperand(a1, JSGeneratorObject::kReceiverOffset)); | 861 __ lw(t1, FieldMemOperand(a1, JSGeneratorObject::kReceiverOffset)); |
861 __ Push(t1); | 862 __ Push(t1); |
862 | 863 |
863 // ----------- S t a t e ------------- | 864 // ----------- S t a t e ------------- |
864 // -- a1 : the JSGeneratorObject to resume | 865 // -- a1 : the JSGeneratorObject to resume |
865 // -- a2 : the resume mode (tagged) | 866 // -- a2 : the resume mode (tagged) |
866 // -- t0 : generator function | 867 // -- t0 : generator function |
867 // -- cp : generator context | 868 // -- cp : generator context |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
943 __ lw(a3, FieldMemOperand(a3, SharedFunctionInfo::kCodeOffset)); | 944 __ lw(a3, FieldMemOperand(a3, SharedFunctionInfo::kCodeOffset)); |
944 __ Addu(a3, a3, Operand(Code::kHeaderSize - kHeapObjectTag)); | 945 __ Addu(a3, a3, Operand(Code::kHeaderSize - kHeapObjectTag)); |
945 __ lw(a2, FieldMemOperand(a1, JSGeneratorObject::kContinuationOffset)); | 946 __ lw(a2, FieldMemOperand(a1, JSGeneratorObject::kContinuationOffset)); |
946 __ SmiUntag(a2); | 947 __ SmiUntag(a2); |
947 __ Addu(a3, a3, Operand(a2)); | 948 __ Addu(a3, a3, Operand(a2)); |
948 __ li(a2, Operand(Smi::FromInt(JSGeneratorObject::kGeneratorExecuting))); | 949 __ li(a2, Operand(Smi::FromInt(JSGeneratorObject::kGeneratorExecuting))); |
949 __ sw(a2, FieldMemOperand(a1, JSGeneratorObject::kContinuationOffset)); | 950 __ sw(a2, FieldMemOperand(a1, JSGeneratorObject::kContinuationOffset)); |
950 __ Move(v0, a1); // Continuation expects generator object in v0. | 951 __ Move(v0, a1); // Continuation expects generator object in v0. |
951 __ Jump(a3); | 952 __ Jump(a3); |
952 } | 953 } |
| 954 |
| 955 __ bind(&prepare_step_in_if_stepping); |
| 956 { |
| 957 FrameScope scope(masm, StackFrame::INTERNAL); |
| 958 __ Push(a1, a2, t0); |
| 959 __ CallRuntime(Runtime::kDebugPrepareStepInIfStepping); |
| 960 __ Pop(a1, a2); |
| 961 } |
| 962 __ Branch(USE_DELAY_SLOT, &stepping_prepared); |
| 963 __ lw(t0, FieldMemOperand(a1, JSGeneratorObject::kFunctionOffset)); |
| 964 |
| 965 __ bind(&prepare_step_in_suspended_generator); |
| 966 { |
| 967 FrameScope scope(masm, StackFrame::INTERNAL); |
| 968 __ Push(a1, a2); |
| 969 __ CallRuntime(Runtime::kDebugPrepareStepInSuspendedGenerator); |
| 970 __ Pop(a1, a2); |
| 971 } |
| 972 __ Branch(USE_DELAY_SLOT, &stepping_prepared); |
| 973 __ lw(t0, FieldMemOperand(a1, JSGeneratorObject::kFunctionOffset)); |
953 } | 974 } |
954 | 975 |
955 static void LeaveInterpreterFrame(MacroAssembler* masm, Register scratch) { | 976 static void LeaveInterpreterFrame(MacroAssembler* masm, Register scratch) { |
956 Register args_count = scratch; | 977 Register args_count = scratch; |
957 | 978 |
958 // Get the arguments + receiver count. | 979 // Get the arguments + receiver count. |
959 __ lw(args_count, | 980 __ lw(args_count, |
960 MemOperand(fp, InterpreterFrameConstants::kBytecodeArrayFromFp)); | 981 MemOperand(fp, InterpreterFrameConstants::kBytecodeArrayFromFp)); |
961 __ lw(args_count, | 982 __ lw(args_count, |
962 FieldMemOperand(args_count, BytecodeArray::kParameterSizeOffset)); | 983 FieldMemOperand(args_count, BytecodeArray::kParameterSizeOffset)); |
(...skipping 1897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2860 } | 2881 } |
2861 } | 2882 } |
2862 | 2883 |
2863 | 2884 |
2864 #undef __ | 2885 #undef __ |
2865 | 2886 |
2866 } // namespace internal | 2887 } // namespace internal |
2867 } // namespace v8 | 2888 } // namespace v8 |
2868 | 2889 |
2869 #endif // V8_TARGET_ARCH_MIPS | 2890 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |