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_ARM | 5 #if V8_TARGET_ARCH_ARM |
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 4782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4793 | 4793 |
4794 void FastNewSloppyArgumentsStub::Generate(MacroAssembler* masm) { | 4794 void FastNewSloppyArgumentsStub::Generate(MacroAssembler* masm) { |
4795 // ----------- S t a t e ------------- | 4795 // ----------- S t a t e ------------- |
4796 // -- r1 : function | 4796 // -- r1 : function |
4797 // -- cp : context | 4797 // -- cp : context |
4798 // -- fp : frame pointer | 4798 // -- fp : frame pointer |
4799 // -- lr : return address | 4799 // -- lr : return address |
4800 // ----------------------------------- | 4800 // ----------------------------------- |
4801 __ AssertFunction(r1); | 4801 __ AssertFunction(r1); |
4802 | 4802 |
| 4803 // For Ignition we need to skip all possible handler/stub frames until |
| 4804 // we reach the JavaScript frame for the function (similar to what the |
| 4805 // runtime fallback implementation does). So make r9 point to that |
| 4806 // JavaScript frame. |
| 4807 { |
| 4808 Label loop, loop_entry; |
| 4809 __ mov(r9, fp); |
| 4810 __ b(&loop_entry); |
| 4811 __ bind(&loop); |
| 4812 __ ldr(r9, MemOperand(r9, StandardFrameConstants::kCallerFPOffset)); |
| 4813 __ bind(&loop_entry); |
| 4814 __ ldr(ip, MemOperand(r9, StandardFrameConstants::kFunctionOffset)); |
| 4815 __ cmp(ip, r1); |
| 4816 __ b(ne, &loop); |
| 4817 } |
| 4818 |
4803 // TODO(bmeurer): Cleanup to match the FastNewStrictArgumentsStub. | 4819 // TODO(bmeurer): Cleanup to match the FastNewStrictArgumentsStub. |
4804 __ ldr(r2, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset)); | 4820 __ ldr(r2, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset)); |
4805 __ ldr(r2, | 4821 __ ldr(r2, |
4806 FieldMemOperand(r2, SharedFunctionInfo::kFormalParameterCountOffset)); | 4822 FieldMemOperand(r2, SharedFunctionInfo::kFormalParameterCountOffset)); |
4807 __ add(r3, fp, Operand(r2, LSL, kPointerSizeLog2 - 1)); | 4823 __ add(r3, r9, Operand(r2, LSL, kPointerSizeLog2 - 1)); |
4808 __ add(r3, r3, Operand(StandardFrameConstants::kCallerSPOffset)); | 4824 __ add(r3, r3, Operand(StandardFrameConstants::kCallerSPOffset)); |
4809 | 4825 |
4810 // r1 : function | 4826 // r1 : function |
4811 // r2 : number of parameters (tagged) | 4827 // r2 : number of parameters (tagged) |
4812 // r3 : parameters pointer | 4828 // r3 : parameters pointer |
| 4829 // r9 : JavaScript frame pointer |
4813 // Registers used over whole function: | 4830 // Registers used over whole function: |
4814 // r5 : arguments count (tagged) | 4831 // r5 : arguments count (tagged) |
4815 // r6 : mapped parameter count (tagged) | 4832 // r6 : mapped parameter count (tagged) |
4816 | 4833 |
4817 // Check if the calling frame is an arguments adaptor frame. | 4834 // Check if the calling frame is an arguments adaptor frame. |
4818 Label adaptor_frame, try_allocate, runtime; | 4835 Label adaptor_frame, try_allocate, runtime; |
4819 __ ldr(r4, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | 4836 __ ldr(r4, MemOperand(r9, StandardFrameConstants::kCallerFPOffset)); |
4820 __ ldr(r0, MemOperand(r4, CommonFrameConstants::kContextOrFrameTypeOffset)); | 4837 __ ldr(r0, MemOperand(r4, CommonFrameConstants::kContextOrFrameTypeOffset)); |
4821 __ cmp(r0, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 4838 __ cmp(r0, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
4822 __ b(eq, &adaptor_frame); | 4839 __ b(eq, &adaptor_frame); |
4823 | 4840 |
4824 // No adaptor, parameter count = argument count. | 4841 // No adaptor, parameter count = argument count. |
4825 __ mov(r5, r2); | 4842 __ mov(r5, r2); |
4826 __ mov(r6, r2); | 4843 __ mov(r6, r2); |
4827 __ b(&try_allocate); | 4844 __ b(&try_allocate); |
4828 | 4845 |
4829 // We have an adaptor frame. Patch the parameters pointer. | 4846 // We have an adaptor frame. Patch the parameters pointer. |
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5560 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, | 5577 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, |
5561 kStackUnwindSpace, NULL, return_value_operand, NULL); | 5578 kStackUnwindSpace, NULL, return_value_operand, NULL); |
5562 } | 5579 } |
5563 | 5580 |
5564 #undef __ | 5581 #undef __ |
5565 | 5582 |
5566 } // namespace internal | 5583 } // namespace internal |
5567 } // namespace v8 | 5584 } // namespace v8 |
5568 | 5585 |
5569 #endif // V8_TARGET_ARCH_ARM | 5586 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |