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/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 3674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3685 __ bind(&need_incremental); | 3685 __ bind(&need_incremental); |
3686 | 3686 |
3687 // Fall through when we need to inform the incremental marker. | 3687 // Fall through when we need to inform the incremental marker. |
3688 } | 3688 } |
3689 | 3689 |
3690 | 3690 |
3691 void StubFailureTrampolineStub::Generate(MacroAssembler* masm) { | 3691 void StubFailureTrampolineStub::Generate(MacroAssembler* masm) { |
3692 CEntryStub ces(isolate(), 1, kSaveFPRegs); | 3692 CEntryStub ces(isolate(), 1, kSaveFPRegs); |
3693 __ Call(ces.GetCode(), RelocInfo::CODE_TARGET); | 3693 __ Call(ces.GetCode(), RelocInfo::CODE_TARGET); |
3694 int parameter_count_offset = | 3694 int parameter_count_offset = |
3695 StubFailureTrampolineFrame::kCallerStackParameterCountFrameOffset; | 3695 StubFailureTrampolineFrameConstants::kArgumentsLengthOffset; |
3696 __ ldr(r1, MemOperand(fp, parameter_count_offset)); | 3696 __ ldr(r1, MemOperand(fp, parameter_count_offset)); |
3697 if (function_mode() == JS_FUNCTION_STUB_MODE) { | 3697 if (function_mode() == JS_FUNCTION_STUB_MODE) { |
3698 __ add(r1, r1, Operand(1)); | 3698 __ add(r1, r1, Operand(1)); |
3699 } | 3699 } |
3700 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE); | 3700 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE); |
3701 __ mov(r1, Operand(r1, LSL, kPointerSizeLog2)); | 3701 __ mov(r1, Operand(r1, LSL, kPointerSizeLog2)); |
3702 __ add(sp, sp, r1); | 3702 __ add(sp, sp, r1); |
3703 __ Ret(); | 3703 __ Ret(); |
3704 } | 3704 } |
3705 | 3705 |
(...skipping 972 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4678 // we reach the JavaScript frame for the function (similar to what the | 4678 // we reach the JavaScript frame for the function (similar to what the |
4679 // runtime fallback implementation does). So make r2 point to that | 4679 // runtime fallback implementation does). So make r2 point to that |
4680 // JavaScript frame. | 4680 // JavaScript frame. |
4681 { | 4681 { |
4682 Label loop, loop_entry; | 4682 Label loop, loop_entry; |
4683 __ mov(r2, fp); | 4683 __ mov(r2, fp); |
4684 __ b(&loop_entry); | 4684 __ b(&loop_entry); |
4685 __ bind(&loop); | 4685 __ bind(&loop); |
4686 __ ldr(r2, MemOperand(r2, StandardFrameConstants::kCallerFPOffset)); | 4686 __ ldr(r2, MemOperand(r2, StandardFrameConstants::kCallerFPOffset)); |
4687 __ bind(&loop_entry); | 4687 __ bind(&loop_entry); |
4688 __ ldr(ip, MemOperand(r2, StandardFrameConstants::kMarkerOffset)); | 4688 __ ldr(ip, MemOperand(r2, StandardFrameConstants::kFunctionOffset)); |
4689 __ cmp(ip, r1); | 4689 __ cmp(ip, r1); |
4690 __ b(ne, &loop); | 4690 __ b(ne, &loop); |
4691 } | 4691 } |
4692 | 4692 |
4693 // Check if we have rest parameters (only possible if we have an | 4693 // Check if we have rest parameters (only possible if we have an |
4694 // arguments adaptor frame below the function frame). | 4694 // arguments adaptor frame below the function frame). |
4695 Label no_rest_parameters; | 4695 Label no_rest_parameters; |
4696 __ ldr(r2, MemOperand(r2, StandardFrameConstants::kCallerFPOffset)); | 4696 __ ldr(r2, MemOperand(r2, StandardFrameConstants::kCallerFPOffset)); |
4697 __ ldr(ip, MemOperand(r2, StandardFrameConstants::kContextOffset)); | 4697 __ ldr(ip, MemOperand(r2, CommonFrameConstants::kContextOrFrameTypeOffset)); |
4698 __ cmp(ip, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 4698 __ cmp(ip, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
4699 __ b(ne, &no_rest_parameters); | 4699 __ b(ne, &no_rest_parameters); |
4700 | 4700 |
4701 // Check if the arguments adaptor frame contains more arguments than | 4701 // Check if the arguments adaptor frame contains more arguments than |
4702 // specified by the function's internal formal parameter count. | 4702 // specified by the function's internal formal parameter count. |
4703 Label rest_parameters; | 4703 Label rest_parameters; |
4704 __ ldr(r0, MemOperand(r2, ArgumentsAdaptorFrameConstants::kLengthOffset)); | 4704 __ ldr(r0, MemOperand(r2, ArgumentsAdaptorFrameConstants::kLengthOffset)); |
4705 __ ldr(r1, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset)); | 4705 __ ldr(r1, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset)); |
4706 __ ldr(r1, | 4706 __ ldr(r1, |
4707 FieldMemOperand(r1, SharedFunctionInfo::kFormalParameterCountOffset)); | 4707 FieldMemOperand(r1, SharedFunctionInfo::kFormalParameterCountOffset)); |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4826 // r1 : function | 4826 // r1 : function |
4827 // r2 : number of parameters (tagged) | 4827 // r2 : number of parameters (tagged) |
4828 // r3 : parameters pointer | 4828 // r3 : parameters pointer |
4829 // Registers used over whole function: | 4829 // Registers used over whole function: |
4830 // r5 : arguments count (tagged) | 4830 // r5 : arguments count (tagged) |
4831 // r6 : mapped parameter count (tagged) | 4831 // r6 : mapped parameter count (tagged) |
4832 | 4832 |
4833 // Check if the calling frame is an arguments adaptor frame. | 4833 // Check if the calling frame is an arguments adaptor frame. |
4834 Label adaptor_frame, try_allocate, runtime; | 4834 Label adaptor_frame, try_allocate, runtime; |
4835 __ ldr(r4, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | 4835 __ ldr(r4, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
4836 __ ldr(r0, MemOperand(r4, StandardFrameConstants::kContextOffset)); | 4836 __ ldr(r0, MemOperand(r4, CommonFrameConstants::kContextOrFrameTypeOffset)); |
4837 __ cmp(r0, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 4837 __ cmp(r0, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
4838 __ b(eq, &adaptor_frame); | 4838 __ b(eq, &adaptor_frame); |
4839 | 4839 |
4840 // No adaptor, parameter count = argument count. | 4840 // No adaptor, parameter count = argument count. |
4841 __ mov(r5, r2); | 4841 __ mov(r5, r2); |
4842 __ mov(r6, r2); | 4842 __ mov(r6, r2); |
4843 __ b(&try_allocate); | 4843 __ b(&try_allocate); |
4844 | 4844 |
4845 // We have an adaptor frame. Patch the parameters pointer. | 4845 // We have an adaptor frame. Patch the parameters pointer. |
4846 __ bind(&adaptor_frame); | 4846 __ bind(&adaptor_frame); |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5025 // we reach the JavaScript frame for the function (similar to what the | 5025 // we reach the JavaScript frame for the function (similar to what the |
5026 // runtime fallback implementation does). So make r2 point to that | 5026 // runtime fallback implementation does). So make r2 point to that |
5027 // JavaScript frame. | 5027 // JavaScript frame. |
5028 { | 5028 { |
5029 Label loop, loop_entry; | 5029 Label loop, loop_entry; |
5030 __ mov(r2, fp); | 5030 __ mov(r2, fp); |
5031 __ b(&loop_entry); | 5031 __ b(&loop_entry); |
5032 __ bind(&loop); | 5032 __ bind(&loop); |
5033 __ ldr(r2, MemOperand(r2, StandardFrameConstants::kCallerFPOffset)); | 5033 __ ldr(r2, MemOperand(r2, StandardFrameConstants::kCallerFPOffset)); |
5034 __ bind(&loop_entry); | 5034 __ bind(&loop_entry); |
5035 __ ldr(ip, MemOperand(r2, StandardFrameConstants::kMarkerOffset)); | 5035 __ ldr(ip, MemOperand(r2, StandardFrameConstants::kFunctionOffset)); |
5036 __ cmp(ip, r1); | 5036 __ cmp(ip, r1); |
5037 __ b(ne, &loop); | 5037 __ b(ne, &loop); |
5038 } | 5038 } |
5039 | 5039 |
5040 // Check if we have an arguments adaptor frame below the function frame. | 5040 // Check if we have an arguments adaptor frame below the function frame. |
5041 Label arguments_adaptor, arguments_done; | 5041 Label arguments_adaptor, arguments_done; |
5042 __ ldr(r3, MemOperand(r2, StandardFrameConstants::kCallerFPOffset)); | 5042 __ ldr(r3, MemOperand(r2, StandardFrameConstants::kCallerFPOffset)); |
5043 __ ldr(ip, MemOperand(r3, StandardFrameConstants::kContextOffset)); | 5043 __ ldr(ip, MemOperand(r3, CommonFrameConstants::kContextOrFrameTypeOffset)); |
5044 __ cmp(ip, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 5044 __ cmp(ip, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
5045 __ b(eq, &arguments_adaptor); | 5045 __ b(eq, &arguments_adaptor); |
5046 { | 5046 { |
5047 __ ldr(r1, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset)); | 5047 __ ldr(r1, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset)); |
5048 __ ldr(r0, FieldMemOperand( | 5048 __ ldr(r0, FieldMemOperand( |
5049 r1, SharedFunctionInfo::kFormalParameterCountOffset)); | 5049 r1, SharedFunctionInfo::kFormalParameterCountOffset)); |
5050 __ add(r2, r2, Operand(r0, LSL, kPointerSizeLog2 - 1)); | 5050 __ add(r2, r2, Operand(r0, LSL, kPointerSizeLog2 - 1)); |
5051 __ add(r2, r2, | 5051 __ add(r2, r2, |
5052 Operand(StandardFrameConstants::kCallerSPOffset - 1 * kPointerSize)); | 5052 Operand(StandardFrameConstants::kCallerSPOffset - 1 * kPointerSize)); |
5053 } | 5053 } |
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5591 kStackUnwindSpace, NULL, return_value_operand, NULL); | 5591 kStackUnwindSpace, NULL, return_value_operand, NULL); |
5592 } | 5592 } |
5593 | 5593 |
5594 | 5594 |
5595 #undef __ | 5595 #undef __ |
5596 | 5596 |
5597 } // namespace internal | 5597 } // namespace internal |
5598 } // namespace v8 | 5598 } // namespace v8 |
5599 | 5599 |
5600 #endif // V8_TARGET_ARCH_ARM | 5600 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |