| 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/bootstrapper.h" | 7 #include "src/bootstrapper.h" | 
| 8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" | 
| 9 #include "src/codegen.h" | 9 #include "src/codegen.h" | 
| 10 #include "src/ic/handler-compiler.h" | 10 #include "src/ic/handler-compiler.h" | 
| (...skipping 3906 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 3917   __ bind(&need_incremental); | 3917   __ bind(&need_incremental); | 
| 3918 | 3918 | 
| 3919   // Fall through when we need to inform the incremental marker. | 3919   // Fall through when we need to inform the incremental marker. | 
| 3920 } | 3920 } | 
| 3921 | 3921 | 
| 3922 | 3922 | 
| 3923 void StubFailureTrampolineStub::Generate(MacroAssembler* masm) { | 3923 void StubFailureTrampolineStub::Generate(MacroAssembler* masm) { | 
| 3924   CEntryStub ces(isolate(), 1, kSaveFPRegs); | 3924   CEntryStub ces(isolate(), 1, kSaveFPRegs); | 
| 3925   __ Call(ces.GetCode(), RelocInfo::CODE_TARGET); | 3925   __ Call(ces.GetCode(), RelocInfo::CODE_TARGET); | 
| 3926   int parameter_count_offset = | 3926   int parameter_count_offset = | 
| 3927       StubFailureTrampolineFrame::kCallerStackParameterCountFrameOffset; | 3927       StubFailureTrampolineFrameConstants::kArgumentsLengthOffset; | 
| 3928   __ ld(a1, MemOperand(fp, parameter_count_offset)); | 3928   __ ld(a1, MemOperand(fp, parameter_count_offset)); | 
| 3929   if (function_mode() == JS_FUNCTION_STUB_MODE) { | 3929   if (function_mode() == JS_FUNCTION_STUB_MODE) { | 
| 3930     __ Daddu(a1, a1, Operand(1)); | 3930     __ Daddu(a1, a1, Operand(1)); | 
| 3931   } | 3931   } | 
| 3932   masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE); | 3932   masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE); | 
| 3933   __ dsll(a1, a1, kPointerSizeLog2); | 3933   __ dsll(a1, a1, kPointerSizeLog2); | 
| 3934   __ Ret(USE_DELAY_SLOT); | 3934   __ Ret(USE_DELAY_SLOT); | 
| 3935   __ Daddu(sp, sp, a1); | 3935   __ Daddu(sp, sp, a1); | 
| 3936 } | 3936 } | 
| 3937 | 3937 | 
| (...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 4901   // we reach the JavaScript frame for the function (similar to what the | 4901   // we reach the JavaScript frame for the function (similar to what the | 
| 4902   // runtime fallback implementation does). So make a2 point to that | 4902   // runtime fallback implementation does). So make a2 point to that | 
| 4903   // JavaScript frame. | 4903   // JavaScript frame. | 
| 4904   { | 4904   { | 
| 4905     Label loop, loop_entry; | 4905     Label loop, loop_entry; | 
| 4906     __ Branch(USE_DELAY_SLOT, &loop_entry); | 4906     __ Branch(USE_DELAY_SLOT, &loop_entry); | 
| 4907     __ mov(a2, fp);  // In delay slot. | 4907     __ mov(a2, fp);  // In delay slot. | 
| 4908     __ bind(&loop); | 4908     __ bind(&loop); | 
| 4909     __ ld(a2, MemOperand(a2, StandardFrameConstants::kCallerFPOffset)); | 4909     __ ld(a2, MemOperand(a2, StandardFrameConstants::kCallerFPOffset)); | 
| 4910     __ bind(&loop_entry); | 4910     __ bind(&loop_entry); | 
| 4911     __ ld(a3, MemOperand(a2, StandardFrameConstants::kMarkerOffset)); | 4911     __ ld(a3, MemOperand(a2, StandardFrameConstants::kFunctionOffset)); | 
| 4912     __ Branch(&loop, ne, a1, Operand(a3)); | 4912     __ Branch(&loop, ne, a1, Operand(a3)); | 
| 4913   } | 4913   } | 
| 4914 | 4914 | 
| 4915   // Check if we have rest parameters (only possible if we have an | 4915   // Check if we have rest parameters (only possible if we have an | 
| 4916   // arguments adaptor frame below the function frame). | 4916   // arguments adaptor frame below the function frame). | 
| 4917   Label no_rest_parameters; | 4917   Label no_rest_parameters; | 
| 4918   __ ld(a2, MemOperand(a2, StandardFrameConstants::kCallerFPOffset)); | 4918   __ ld(a2, MemOperand(a2, StandardFrameConstants::kCallerFPOffset)); | 
| 4919   __ ld(a3, MemOperand(a2, StandardFrameConstants::kContextOffset)); | 4919   __ ld(a3, MemOperand(a2, CommonFrameConstants::kContextOrFrameTypeOffset)); | 
| 4920   __ Branch(&no_rest_parameters, ne, a3, | 4920   __ Branch(&no_rest_parameters, ne, a3, | 
| 4921             Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 4921             Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 
| 4922 | 4922 | 
| 4923   // Check if the arguments adaptor frame contains more arguments than | 4923   // Check if the arguments adaptor frame contains more arguments than | 
| 4924   // specified by the function's internal formal parameter count. | 4924   // specified by the function's internal formal parameter count. | 
| 4925   Label rest_parameters; | 4925   Label rest_parameters; | 
| 4926   __ SmiLoadUntag( | 4926   __ SmiLoadUntag( | 
| 4927       a0, MemOperand(a2, ArgumentsAdaptorFrameConstants::kLengthOffset)); | 4927       a0, MemOperand(a2, ArgumentsAdaptorFrameConstants::kLengthOffset)); | 
| 4928   __ ld(a1, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); | 4928   __ ld(a1, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); | 
| 4929   __ lw(a1, | 4929   __ lw(a1, | 
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 5054   // a1 : function | 5054   // a1 : function | 
| 5055   // a2 : number of parameters (tagged) | 5055   // a2 : number of parameters (tagged) | 
| 5056   // a3 : parameters pointer | 5056   // a3 : parameters pointer | 
| 5057   // Registers used over whole function: | 5057   // Registers used over whole function: | 
| 5058   //  a5 : arguments count (tagged) | 5058   //  a5 : arguments count (tagged) | 
| 5059   //  a6 : mapped parameter count (tagged) | 5059   //  a6 : mapped parameter count (tagged) | 
| 5060 | 5060 | 
| 5061   // Check if the calling frame is an arguments adaptor frame. | 5061   // Check if the calling frame is an arguments adaptor frame. | 
| 5062   Label adaptor_frame, try_allocate, runtime; | 5062   Label adaptor_frame, try_allocate, runtime; | 
| 5063   __ ld(a4, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | 5063   __ ld(a4, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | 
| 5064   __ ld(a0, MemOperand(a4, StandardFrameConstants::kContextOffset)); | 5064   __ ld(a0, MemOperand(a4, CommonFrameConstants::kContextOrFrameTypeOffset)); | 
| 5065   __ Branch(&adaptor_frame, eq, a0, | 5065   __ Branch(&adaptor_frame, eq, a0, | 
| 5066             Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 5066             Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 
| 5067 | 5067 | 
| 5068   // No adaptor, parameter count = argument count. | 5068   // No adaptor, parameter count = argument count. | 
| 5069   __ mov(a5, a2); | 5069   __ mov(a5, a2); | 
| 5070   __ Branch(USE_DELAY_SLOT, &try_allocate); | 5070   __ Branch(USE_DELAY_SLOT, &try_allocate); | 
| 5071   __ mov(a6, a2);  // In delay slot. | 5071   __ mov(a6, a2);  // In delay slot. | 
| 5072 | 5072 | 
| 5073   // We have an adaptor frame. Patch the parameters pointer. | 5073   // We have an adaptor frame. Patch the parameters pointer. | 
| 5074   __ bind(&adaptor_frame); | 5074   __ bind(&adaptor_frame); | 
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 5267   // we reach the JavaScript frame for the function (similar to what the | 5267   // we reach the JavaScript frame for the function (similar to what the | 
| 5268   // runtime fallback implementation does). So make a2 point to that | 5268   // runtime fallback implementation does). So make a2 point to that | 
| 5269   // JavaScript frame. | 5269   // JavaScript frame. | 
| 5270   { | 5270   { | 
| 5271     Label loop, loop_entry; | 5271     Label loop, loop_entry; | 
| 5272     __ Branch(USE_DELAY_SLOT, &loop_entry); | 5272     __ Branch(USE_DELAY_SLOT, &loop_entry); | 
| 5273     __ mov(a2, fp);  // In delay slot. | 5273     __ mov(a2, fp);  // In delay slot. | 
| 5274     __ bind(&loop); | 5274     __ bind(&loop); | 
| 5275     __ ld(a2, MemOperand(a2, StandardFrameConstants::kCallerFPOffset)); | 5275     __ ld(a2, MemOperand(a2, StandardFrameConstants::kCallerFPOffset)); | 
| 5276     __ bind(&loop_entry); | 5276     __ bind(&loop_entry); | 
| 5277     __ ld(a3, MemOperand(a2, StandardFrameConstants::kMarkerOffset)); | 5277     __ ld(a3, MemOperand(a2, StandardFrameConstants::kFunctionOffset)); | 
| 5278     __ Branch(&loop, ne, a1, Operand(a3)); | 5278     __ Branch(&loop, ne, a1, Operand(a3)); | 
| 5279   } | 5279   } | 
| 5280 | 5280 | 
| 5281   // Check if we have an arguments adaptor frame below the function frame. | 5281   // Check if we have an arguments adaptor frame below the function frame. | 
| 5282   Label arguments_adaptor, arguments_done; | 5282   Label arguments_adaptor, arguments_done; | 
| 5283   __ ld(a3, MemOperand(a2, StandardFrameConstants::kCallerFPOffset)); | 5283   __ ld(a3, MemOperand(a2, StandardFrameConstants::kCallerFPOffset)); | 
| 5284   __ ld(a0, MemOperand(a3, StandardFrameConstants::kContextOffset)); | 5284   __ ld(a0, MemOperand(a3, CommonFrameConstants::kContextOrFrameTypeOffset)); | 
| 5285   __ Branch(&arguments_adaptor, eq, a0, | 5285   __ Branch(&arguments_adaptor, eq, a0, | 
| 5286             Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 5286             Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 
| 5287   { | 5287   { | 
| 5288     __ ld(a1, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); | 5288     __ ld(a1, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); | 
| 5289     __ lw(a0, | 5289     __ lw(a0, | 
| 5290           FieldMemOperand(a1, SharedFunctionInfo::kFormalParameterCountOffset)); | 5290           FieldMemOperand(a1, SharedFunctionInfo::kFormalParameterCountOffset)); | 
| 5291     __ Dlsa(a2, a2, a0, kPointerSizeLog2); | 5291     __ Dlsa(a2, a2, a0, kPointerSizeLog2); | 
| 5292     __ Daddu(a2, a2, Operand(StandardFrameConstants::kCallerSPOffset - | 5292     __ Daddu(a2, a2, Operand(StandardFrameConstants::kCallerSPOffset - | 
| 5293                              1 * kPointerSize)); | 5293                              1 * kPointerSize)); | 
| 5294   } | 5294   } | 
| (...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 5823                            return_value_operand, NULL); | 5823                            return_value_operand, NULL); | 
| 5824 } | 5824 } | 
| 5825 | 5825 | 
| 5826 | 5826 | 
| 5827 #undef __ | 5827 #undef __ | 
| 5828 | 5828 | 
| 5829 }  // namespace internal | 5829 }  // namespace internal | 
| 5830 }  // namespace v8 | 5830 }  // namespace v8 | 
| 5831 | 5831 | 
| 5832 #endif  // V8_TARGET_ARCH_MIPS64 | 5832 #endif  // V8_TARGET_ARCH_MIPS64 | 
| OLD | NEW | 
|---|