| 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/base/bits.h" | 7 #include "src/base/bits.h" |
| 8 #include "src/bootstrapper.h" | 8 #include "src/bootstrapper.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 3902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3913 __ bind(&need_incremental); | 3913 __ bind(&need_incremental); |
| 3914 | 3914 |
| 3915 // Fall through when we need to inform the incremental marker. | 3915 // Fall through when we need to inform the incremental marker. |
| 3916 } | 3916 } |
| 3917 | 3917 |
| 3918 | 3918 |
| 3919 void StubFailureTrampolineStub::Generate(MacroAssembler* masm) { | 3919 void StubFailureTrampolineStub::Generate(MacroAssembler* masm) { |
| 3920 CEntryStub ces(isolate(), 1, kSaveFPRegs); | 3920 CEntryStub ces(isolate(), 1, kSaveFPRegs); |
| 3921 __ Call(ces.GetCode(), RelocInfo::CODE_TARGET); | 3921 __ Call(ces.GetCode(), RelocInfo::CODE_TARGET); |
| 3922 int parameter_count_offset = | 3922 int parameter_count_offset = |
| 3923 StubFailureTrampolineFrame::kCallerStackParameterCountFrameOffset; | 3923 StubFailureTrampolineFrameConstants::kArgumentsLengthOffset; |
| 3924 __ lw(a1, MemOperand(fp, parameter_count_offset)); | 3924 __ lw(a1, MemOperand(fp, parameter_count_offset)); |
| 3925 if (function_mode() == JS_FUNCTION_STUB_MODE) { | 3925 if (function_mode() == JS_FUNCTION_STUB_MODE) { |
| 3926 __ Addu(a1, a1, Operand(1)); | 3926 __ Addu(a1, a1, Operand(1)); |
| 3927 } | 3927 } |
| 3928 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE); | 3928 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE); |
| 3929 __ sll(a1, a1, kPointerSizeLog2); | 3929 __ sll(a1, a1, kPointerSizeLog2); |
| 3930 __ Ret(USE_DELAY_SLOT); | 3930 __ Ret(USE_DELAY_SLOT); |
| 3931 __ Addu(sp, sp, a1); | 3931 __ Addu(sp, sp, a1); |
| 3932 } | 3932 } |
| 3933 | 3933 |
| (...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4895 // we reach the JavaScript frame for the function (similar to what the | 4895 // we reach the JavaScript frame for the function (similar to what the |
| 4896 // runtime fallback implementation does). So make a2 point to that | 4896 // runtime fallback implementation does). So make a2 point to that |
| 4897 // JavaScript frame. | 4897 // JavaScript frame. |
| 4898 { | 4898 { |
| 4899 Label loop, loop_entry; | 4899 Label loop, loop_entry; |
| 4900 __ Branch(USE_DELAY_SLOT, &loop_entry); | 4900 __ Branch(USE_DELAY_SLOT, &loop_entry); |
| 4901 __ mov(a2, fp); // In delay slot. | 4901 __ mov(a2, fp); // In delay slot. |
| 4902 __ bind(&loop); | 4902 __ bind(&loop); |
| 4903 __ lw(a2, MemOperand(a2, StandardFrameConstants::kCallerFPOffset)); | 4903 __ lw(a2, MemOperand(a2, StandardFrameConstants::kCallerFPOffset)); |
| 4904 __ bind(&loop_entry); | 4904 __ bind(&loop_entry); |
| 4905 __ lw(a3, MemOperand(a2, StandardFrameConstants::kMarkerOffset)); | 4905 __ lw(a3, MemOperand(a2, StandardFrameConstants::kFunctionOffset)); |
| 4906 __ Branch(&loop, ne, a1, Operand(a3)); | 4906 __ Branch(&loop, ne, a1, Operand(a3)); |
| 4907 } | 4907 } |
| 4908 | 4908 |
| 4909 // Check if we have rest parameters (only possible if we have an | 4909 // Check if we have rest parameters (only possible if we have an |
| 4910 // arguments adaptor frame below the function frame). | 4910 // arguments adaptor frame below the function frame). |
| 4911 Label no_rest_parameters; | 4911 Label no_rest_parameters; |
| 4912 __ lw(a2, MemOperand(a2, StandardFrameConstants::kCallerFPOffset)); | 4912 __ lw(a2, MemOperand(a2, StandardFrameConstants::kCallerFPOffset)); |
| 4913 __ lw(a3, MemOperand(a2, StandardFrameConstants::kContextOffset)); | 4913 __ lw(a3, MemOperand(a2, CommonFrameConstants::kContextOrFrameTypeOffset)); |
| 4914 __ Branch(&no_rest_parameters, ne, a3, | 4914 __ Branch(&no_rest_parameters, ne, a3, |
| 4915 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 4915 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
| 4916 | 4916 |
| 4917 // Check if the arguments adaptor frame contains more arguments than | 4917 // Check if the arguments adaptor frame contains more arguments than |
| 4918 // specified by the function's internal formal parameter count. | 4918 // specified by the function's internal formal parameter count. |
| 4919 Label rest_parameters; | 4919 Label rest_parameters; |
| 4920 __ lw(a0, MemOperand(a2, ArgumentsAdaptorFrameConstants::kLengthOffset)); | 4920 __ lw(a0, MemOperand(a2, ArgumentsAdaptorFrameConstants::kLengthOffset)); |
| 4921 __ lw(a1, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); | 4921 __ lw(a1, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); |
| 4922 __ lw(a1, | 4922 __ lw(a1, |
| 4923 FieldMemOperand(a1, SharedFunctionInfo::kFormalParameterCountOffset)); | 4923 FieldMemOperand(a1, SharedFunctionInfo::kFormalParameterCountOffset)); |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5042 // a1 : function | 5042 // a1 : function |
| 5043 // a2 : number of parameters (tagged) | 5043 // a2 : number of parameters (tagged) |
| 5044 // a3 : parameters pointer | 5044 // a3 : parameters pointer |
| 5045 // Registers used over whole function: | 5045 // Registers used over whole function: |
| 5046 // t1 : arguments count (tagged) | 5046 // t1 : arguments count (tagged) |
| 5047 // t2 : mapped parameter count (tagged) | 5047 // t2 : mapped parameter count (tagged) |
| 5048 | 5048 |
| 5049 // Check if the calling frame is an arguments adaptor frame. | 5049 // Check if the calling frame is an arguments adaptor frame. |
| 5050 Label adaptor_frame, try_allocate, runtime; | 5050 Label adaptor_frame, try_allocate, runtime; |
| 5051 __ lw(t0, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | 5051 __ lw(t0, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
| 5052 __ lw(a0, MemOperand(t0, StandardFrameConstants::kContextOffset)); | 5052 __ lw(a0, MemOperand(t0, CommonFrameConstants::kContextOrFrameTypeOffset)); |
| 5053 __ Branch(&adaptor_frame, eq, a0, | 5053 __ Branch(&adaptor_frame, eq, a0, |
| 5054 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 5054 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
| 5055 | 5055 |
| 5056 // No adaptor, parameter count = argument count. | 5056 // No adaptor, parameter count = argument count. |
| 5057 __ mov(t1, a2); | 5057 __ mov(t1, a2); |
| 5058 __ Branch(USE_DELAY_SLOT, &try_allocate); | 5058 __ Branch(USE_DELAY_SLOT, &try_allocate); |
| 5059 __ mov(t2, a2); // In delay slot. | 5059 __ mov(t2, a2); // In delay slot. |
| 5060 | 5060 |
| 5061 // We have an adaptor frame. Patch the parameters pointer. | 5061 // We have an adaptor frame. Patch the parameters pointer. |
| 5062 __ bind(&adaptor_frame); | 5062 __ bind(&adaptor_frame); |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5250 // we reach the JavaScript frame for the function (similar to what the | 5250 // we reach the JavaScript frame for the function (similar to what the |
| 5251 // runtime fallback implementation does). So make a2 point to that | 5251 // runtime fallback implementation does). So make a2 point to that |
| 5252 // JavaScript frame. | 5252 // JavaScript frame. |
| 5253 { | 5253 { |
| 5254 Label loop, loop_entry; | 5254 Label loop, loop_entry; |
| 5255 __ Branch(USE_DELAY_SLOT, &loop_entry); | 5255 __ Branch(USE_DELAY_SLOT, &loop_entry); |
| 5256 __ mov(a2, fp); // In delay slot. | 5256 __ mov(a2, fp); // In delay slot. |
| 5257 __ bind(&loop); | 5257 __ bind(&loop); |
| 5258 __ lw(a2, MemOperand(a2, StandardFrameConstants::kCallerFPOffset)); | 5258 __ lw(a2, MemOperand(a2, StandardFrameConstants::kCallerFPOffset)); |
| 5259 __ bind(&loop_entry); | 5259 __ bind(&loop_entry); |
| 5260 __ lw(a3, MemOperand(a2, StandardFrameConstants::kMarkerOffset)); | 5260 __ lw(a3, MemOperand(a2, StandardFrameConstants::kFunctionOffset)); |
| 5261 __ Branch(&loop, ne, a1, Operand(a3)); | 5261 __ Branch(&loop, ne, a1, Operand(a3)); |
| 5262 } | 5262 } |
| 5263 | 5263 |
| 5264 // Check if we have an arguments adaptor frame below the function frame. | 5264 // Check if we have an arguments adaptor frame below the function frame. |
| 5265 Label arguments_adaptor, arguments_done; | 5265 Label arguments_adaptor, arguments_done; |
| 5266 __ lw(a3, MemOperand(a2, StandardFrameConstants::kCallerFPOffset)); | 5266 __ lw(a3, MemOperand(a2, StandardFrameConstants::kCallerFPOffset)); |
| 5267 __ lw(a0, MemOperand(a3, StandardFrameConstants::kContextOffset)); | 5267 __ lw(a0, MemOperand(a3, CommonFrameConstants::kContextOrFrameTypeOffset)); |
| 5268 __ Branch(&arguments_adaptor, eq, a0, | 5268 __ Branch(&arguments_adaptor, eq, a0, |
| 5269 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 5269 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
| 5270 { | 5270 { |
| 5271 __ lw(a1, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); | 5271 __ lw(a1, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); |
| 5272 __ lw(a0, | 5272 __ lw(a0, |
| 5273 FieldMemOperand(a1, SharedFunctionInfo::kFormalParameterCountOffset)); | 5273 FieldMemOperand(a1, SharedFunctionInfo::kFormalParameterCountOffset)); |
| 5274 __ Lsa(a2, a2, a0, kPointerSizeLog2 - 1); | 5274 __ Lsa(a2, a2, a0, kPointerSizeLog2 - 1); |
| 5275 __ Addu(a2, a2, Operand(StandardFrameConstants::kCallerSPOffset - | 5275 __ Addu(a2, a2, Operand(StandardFrameConstants::kCallerSPOffset - |
| 5276 1 * kPointerSize)); | 5276 1 * kPointerSize)); |
| 5277 } | 5277 } |
| (...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5795 return_value_operand, NULL); | 5795 return_value_operand, NULL); |
| 5796 } | 5796 } |
| 5797 | 5797 |
| 5798 | 5798 |
| 5799 #undef __ | 5799 #undef __ |
| 5800 | 5800 |
| 5801 } // namespace internal | 5801 } // namespace internal |
| 5802 } // namespace v8 | 5802 } // namespace v8 |
| 5803 | 5803 |
| 5804 #endif // V8_TARGET_ARCH_MIPS | 5804 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |