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/code-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/api-arguments.h" | 8 #include "src/api-arguments.h" |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 4973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4984 | 4984 |
4985 void FastNewSloppyArgumentsStub::Generate(MacroAssembler* masm) { | 4985 void FastNewSloppyArgumentsStub::Generate(MacroAssembler* masm) { |
4986 // ----------- S t a t e ------------- | 4986 // ----------- S t a t e ------------- |
4987 // -- a1 : function | 4987 // -- a1 : function |
4988 // -- cp : context | 4988 // -- cp : context |
4989 // -- fp : frame pointer | 4989 // -- fp : frame pointer |
4990 // -- ra : return address | 4990 // -- ra : return address |
4991 // ----------------------------------- | 4991 // ----------------------------------- |
4992 __ AssertFunction(a1); | 4992 __ AssertFunction(a1); |
4993 | 4993 |
| 4994 // For Ignition we need to skip all possible handler/stub frames until |
| 4995 // we reach the JavaScript frame for the function (similar to what the |
| 4996 // runtime fallback implementation does). So make t0 point to that |
| 4997 // JavaScript frame. |
| 4998 { |
| 4999 Label loop, loop_entry; |
| 5000 __ Branch(USE_DELAY_SLOT, &loop_entry); |
| 5001 __ mov(t0, fp); // In delay slot. |
| 5002 __ bind(&loop); |
| 5003 __ lw(t0, MemOperand(t0, StandardFrameConstants::kCallerFPOffset)); |
| 5004 __ bind(&loop_entry); |
| 5005 __ lw(a3, MemOperand(t0, StandardFrameConstants::kFunctionOffset)); |
| 5006 __ Branch(&loop, ne, a1, Operand(a3)); |
| 5007 } |
| 5008 |
4994 // TODO(bmeurer): Cleanup to match the FastNewStrictArgumentsStub. | 5009 // TODO(bmeurer): Cleanup to match the FastNewStrictArgumentsStub. |
4995 __ lw(a2, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); | 5010 __ lw(a2, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); |
4996 __ lw(a2, | 5011 __ lw(a2, |
4997 FieldMemOperand(a2, SharedFunctionInfo::kFormalParameterCountOffset)); | 5012 FieldMemOperand(a2, SharedFunctionInfo::kFormalParameterCountOffset)); |
4998 __ Lsa(a3, fp, a2, kPointerSizeLog2 - 1); | 5013 __ Lsa(a3, t0, a2, kPointerSizeLog2 - 1); |
4999 __ Addu(a3, a3, Operand(StandardFrameConstants::kCallerSPOffset)); | 5014 __ Addu(a3, a3, Operand(StandardFrameConstants::kCallerSPOffset)); |
5000 | 5015 |
5001 // a1 : function | 5016 // a1 : function |
5002 // a2 : number of parameters (tagged) | 5017 // a2 : number of parameters (tagged) |
5003 // a3 : parameters pointer | 5018 // a3 : parameters pointer |
| 5019 // t0 : Javascript frame pointer |
5004 // Registers used over whole function: | 5020 // Registers used over whole function: |
5005 // t1 : arguments count (tagged) | 5021 // t1 : arguments count (tagged) |
5006 // t2 : mapped parameter count (tagged) | 5022 // t2 : mapped parameter count (tagged) |
5007 | 5023 |
5008 // Check if the calling frame is an arguments adaptor frame. | 5024 // Check if the calling frame is an arguments adaptor frame. |
5009 Label adaptor_frame, try_allocate, runtime; | 5025 Label adaptor_frame, try_allocate, runtime; |
5010 __ lw(t0, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | 5026 __ lw(t0, MemOperand(t0, StandardFrameConstants::kCallerFPOffset)); |
5011 __ lw(a0, MemOperand(t0, CommonFrameConstants::kContextOrFrameTypeOffset)); | 5027 __ lw(a0, MemOperand(t0, CommonFrameConstants::kContextOrFrameTypeOffset)); |
5012 __ Branch(&adaptor_frame, eq, a0, | 5028 __ Branch(&adaptor_frame, eq, a0, |
5013 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 5029 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
5014 | 5030 |
5015 // No adaptor, parameter count = argument count. | 5031 // No adaptor, parameter count = argument count. |
5016 __ mov(t1, a2); | 5032 __ mov(t1, a2); |
5017 __ Branch(USE_DELAY_SLOT, &try_allocate); | 5033 __ Branch(USE_DELAY_SLOT, &try_allocate); |
5018 __ mov(t2, a2); // In delay slot. | 5034 __ mov(t2, a2); // In delay slot. |
5019 | 5035 |
5020 // We have an adaptor frame. Patch the parameters pointer. | 5036 // We have an adaptor frame. Patch the parameters pointer. |
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5737 kStackUnwindSpace, kInvalidStackOffset, | 5753 kStackUnwindSpace, kInvalidStackOffset, |
5738 return_value_operand, NULL); | 5754 return_value_operand, NULL); |
5739 } | 5755 } |
5740 | 5756 |
5741 #undef __ | 5757 #undef __ |
5742 | 5758 |
5743 } // namespace internal | 5759 } // namespace internal |
5744 } // namespace v8 | 5760 } // namespace v8 |
5745 | 5761 |
5746 #endif // V8_TARGET_ARCH_MIPS | 5762 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |