| 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/code-stubs.h" | 7 #include "src/code-stubs.h" |
| 8 #include "src/api-arguments.h" | 8 #include "src/api-arguments.h" |
| 9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 4826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4837 | 4837 |
| 4838 void FastNewRestParameterStub::Generate(MacroAssembler* masm) { | 4838 void FastNewRestParameterStub::Generate(MacroAssembler* masm) { |
| 4839 // ----------- S t a t e ------------- | 4839 // ----------- S t a t e ------------- |
| 4840 // -- a1 : function | 4840 // -- a1 : function |
| 4841 // -- cp : context | 4841 // -- cp : context |
| 4842 // -- fp : frame pointer | 4842 // -- fp : frame pointer |
| 4843 // -- ra : return address | 4843 // -- ra : return address |
| 4844 // ----------------------------------- | 4844 // ----------------------------------- |
| 4845 __ AssertFunction(a1); | 4845 __ AssertFunction(a1); |
| 4846 | 4846 |
| 4847 // For Ignition we need to skip all possible handler/stub frames until | 4847 // Make a2 point to the JavaScript frame. |
| 4848 // we reach the JavaScript frame for the function (similar to what the | 4848 __ mov(a2, fp); |
| 4849 // runtime fallback implementation does). So make a2 point to that | 4849 if (skip_stub_frame()) { |
| 4850 // JavaScript frame. | 4850 // For Ignition we need to skip the handler/stub frame to reach the |
| 4851 { | 4851 // JavaScript frame for the function. |
| 4852 Label loop, loop_entry; | |
| 4853 __ Branch(USE_DELAY_SLOT, &loop_entry); | |
| 4854 __ mov(a2, fp); // In delay slot. | |
| 4855 __ bind(&loop); | |
| 4856 __ ld(a2, MemOperand(a2, StandardFrameConstants::kCallerFPOffset)); | 4852 __ ld(a2, MemOperand(a2, StandardFrameConstants::kCallerFPOffset)); |
| 4857 __ bind(&loop_entry); | 4853 } |
| 4854 if (FLAG_debug_code) { |
| 4855 Label ok; |
| 4858 __ ld(a3, MemOperand(a2, StandardFrameConstants::kFunctionOffset)); | 4856 __ ld(a3, MemOperand(a2, StandardFrameConstants::kFunctionOffset)); |
| 4859 __ Branch(&loop, ne, a1, Operand(a3)); | 4857 __ Branch(&ok, eq, a1, Operand(a3)); |
| 4858 __ Abort(kInvalidFrameForFastNewRestArgumentsStub); |
| 4859 __ bind(&ok); |
| 4860 } | 4860 } |
| 4861 | 4861 |
| 4862 // Check if we have rest parameters (only possible if we have an | 4862 // Check if we have rest parameters (only possible if we have an |
| 4863 // arguments adaptor frame below the function frame). | 4863 // arguments adaptor frame below the function frame). |
| 4864 Label no_rest_parameters; | 4864 Label no_rest_parameters; |
| 4865 __ ld(a2, MemOperand(a2, StandardFrameConstants::kCallerFPOffset)); | 4865 __ ld(a2, MemOperand(a2, StandardFrameConstants::kCallerFPOffset)); |
| 4866 __ ld(a3, MemOperand(a2, CommonFrameConstants::kContextOrFrameTypeOffset)); | 4866 __ ld(a3, MemOperand(a2, CommonFrameConstants::kContextOrFrameTypeOffset)); |
| 4867 __ Branch(&no_rest_parameters, ne, a3, | 4867 __ Branch(&no_rest_parameters, ne, a3, |
| 4868 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 4868 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
| 4869 | 4869 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4983 | 4983 |
| 4984 void FastNewSloppyArgumentsStub::Generate(MacroAssembler* masm) { | 4984 void FastNewSloppyArgumentsStub::Generate(MacroAssembler* masm) { |
| 4985 // ----------- S t a t e ------------- | 4985 // ----------- S t a t e ------------- |
| 4986 // -- a1 : function | 4986 // -- a1 : function |
| 4987 // -- cp : context | 4987 // -- cp : context |
| 4988 // -- fp : frame pointer | 4988 // -- fp : frame pointer |
| 4989 // -- ra : return address | 4989 // -- ra : return address |
| 4990 // ----------------------------------- | 4990 // ----------------------------------- |
| 4991 __ AssertFunction(a1); | 4991 __ AssertFunction(a1); |
| 4992 | 4992 |
| 4993 // For Ignition we need to skip all possible handler/stub frames until | 4993 // Make t0 point to the JavaScript frame. |
| 4994 // we reach the JavaScript frame for the function (similar to what the | 4994 __ mov(t0, fp); |
| 4995 // runtime fallback implementation does). So make t0 point to that | 4995 if (skip_stub_frame()) { |
| 4996 // JavaScript frame. | 4996 // For Ignition we need to skip the handler/stub frame to reach the |
| 4997 { | 4997 // JavaScript frame for the function. |
| 4998 Label loop, loop_entry; | |
| 4999 __ Branch(USE_DELAY_SLOT, &loop_entry); | |
| 5000 __ mov(t0, fp); // In delay slot. | |
| 5001 __ bind(&loop); | |
| 5002 __ ld(t0, MemOperand(t0, StandardFrameConstants::kCallerFPOffset)); | 4998 __ ld(t0, MemOperand(t0, StandardFrameConstants::kCallerFPOffset)); |
| 5003 __ bind(&loop_entry); | 4999 } |
| 5000 if (FLAG_debug_code) { |
| 5001 Label ok; |
| 5004 __ ld(a3, MemOperand(t0, StandardFrameConstants::kFunctionOffset)); | 5002 __ ld(a3, MemOperand(t0, StandardFrameConstants::kFunctionOffset)); |
| 5005 __ Branch(&loop, ne, a1, Operand(a3)); | 5003 __ Branch(&ok, eq, a1, Operand(a3)); |
| 5004 __ Abort(kInvalidFrameForFastNewRestArgumentsStub); |
| 5005 __ bind(&ok); |
| 5006 } | 5006 } |
| 5007 | 5007 |
| 5008 // TODO(bmeurer): Cleanup to match the FastNewStrictArgumentsStub. | 5008 // TODO(bmeurer): Cleanup to match the FastNewStrictArgumentsStub. |
| 5009 __ ld(a2, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); | 5009 __ ld(a2, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); |
| 5010 __ lw(a2, | 5010 __ lw(a2, |
| 5011 FieldMemOperand(a2, SharedFunctionInfo::kFormalParameterCountOffset)); | 5011 FieldMemOperand(a2, SharedFunctionInfo::kFormalParameterCountOffset)); |
| 5012 __ Lsa(a3, t0, a2, kPointerSizeLog2); | 5012 __ Lsa(a3, t0, a2, kPointerSizeLog2); |
| 5013 __ Addu(a3, a3, Operand(StandardFrameConstants::kCallerSPOffset)); | 5013 __ Addu(a3, a3, Operand(StandardFrameConstants::kCallerSPOffset)); |
| 5014 __ SmiTag(a2); | 5014 __ SmiTag(a2); |
| 5015 | 5015 |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5219 | 5219 |
| 5220 void FastNewStrictArgumentsStub::Generate(MacroAssembler* masm) { | 5220 void FastNewStrictArgumentsStub::Generate(MacroAssembler* masm) { |
| 5221 // ----------- S t a t e ------------- | 5221 // ----------- S t a t e ------------- |
| 5222 // -- a1 : function | 5222 // -- a1 : function |
| 5223 // -- cp : context | 5223 // -- cp : context |
| 5224 // -- fp : frame pointer | 5224 // -- fp : frame pointer |
| 5225 // -- ra : return address | 5225 // -- ra : return address |
| 5226 // ----------------------------------- | 5226 // ----------------------------------- |
| 5227 __ AssertFunction(a1); | 5227 __ AssertFunction(a1); |
| 5228 | 5228 |
| 5229 // For Ignition we need to skip all possible handler/stub frames until | 5229 // Make a2 point to the JavaScript frame. |
| 5230 // we reach the JavaScript frame for the function (similar to what the | 5230 __ mov(a2, fp); |
| 5231 // runtime fallback implementation does). So make a2 point to that | 5231 if (skip_stub_frame()) { |
| 5232 // JavaScript frame. | 5232 // For Ignition we need to skip the handler/stub frame to reach the |
| 5233 { | 5233 // JavaScript frame for the function. |
| 5234 Label loop, loop_entry; | |
| 5235 __ Branch(USE_DELAY_SLOT, &loop_entry); | |
| 5236 __ mov(a2, fp); // In delay slot. | |
| 5237 __ bind(&loop); | |
| 5238 __ ld(a2, MemOperand(a2, StandardFrameConstants::kCallerFPOffset)); | 5234 __ ld(a2, MemOperand(a2, StandardFrameConstants::kCallerFPOffset)); |
| 5239 __ bind(&loop_entry); | 5235 } |
| 5236 if (FLAG_debug_code) { |
| 5237 Label ok; |
| 5240 __ ld(a3, MemOperand(a2, StandardFrameConstants::kFunctionOffset)); | 5238 __ ld(a3, MemOperand(a2, StandardFrameConstants::kFunctionOffset)); |
| 5241 __ Branch(&loop, ne, a1, Operand(a3)); | 5239 __ Branch(&ok, eq, a1, Operand(a3)); |
| 5240 __ Abort(kInvalidFrameForFastNewRestArgumentsStub); |
| 5241 __ bind(&ok); |
| 5242 } | 5242 } |
| 5243 | 5243 |
| 5244 // Check if we have an arguments adaptor frame below the function frame. | 5244 // Check if we have an arguments adaptor frame below the function frame. |
| 5245 Label arguments_adaptor, arguments_done; | 5245 Label arguments_adaptor, arguments_done; |
| 5246 __ ld(a3, MemOperand(a2, StandardFrameConstants::kCallerFPOffset)); | 5246 __ ld(a3, MemOperand(a2, StandardFrameConstants::kCallerFPOffset)); |
| 5247 __ ld(a0, MemOperand(a3, CommonFrameConstants::kContextOrFrameTypeOffset)); | 5247 __ ld(a0, MemOperand(a3, CommonFrameConstants::kContextOrFrameTypeOffset)); |
| 5248 __ Branch(&arguments_adaptor, eq, a0, | 5248 __ Branch(&arguments_adaptor, eq, a0, |
| 5249 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 5249 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
| 5250 { | 5250 { |
| 5251 __ ld(a1, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); | 5251 __ ld(a1, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); |
| (...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5780 kStackUnwindSpace, kInvalidStackOffset, | 5780 kStackUnwindSpace, kInvalidStackOffset, |
| 5781 return_value_operand, NULL); | 5781 return_value_operand, NULL); |
| 5782 } | 5782 } |
| 5783 | 5783 |
| 5784 #undef __ | 5784 #undef __ |
| 5785 | 5785 |
| 5786 } // namespace internal | 5786 } // namespace internal |
| 5787 } // namespace v8 | 5787 } // namespace v8 |
| 5788 | 5788 |
| 5789 #endif // V8_TARGET_ARCH_MIPS64 | 5789 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |