OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_S390 | 5 #if V8_TARGET_ARCH_S390 |
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 4690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4701 | 4701 |
4702 void FastNewRestParameterStub::Generate(MacroAssembler* masm) { | 4702 void FastNewRestParameterStub::Generate(MacroAssembler* masm) { |
4703 // ----------- S t a t e ------------- | 4703 // ----------- S t a t e ------------- |
4704 // -- r3 : function | 4704 // -- r3 : function |
4705 // -- cp : context | 4705 // -- cp : context |
4706 // -- fp : frame pointer | 4706 // -- fp : frame pointer |
4707 // -- lr : return address | 4707 // -- lr : return address |
4708 // ----------------------------------- | 4708 // ----------------------------------- |
4709 __ AssertFunction(r3); | 4709 __ AssertFunction(r3); |
4710 | 4710 |
4711 // For Ignition we need to skip all possible handler/stub frames until | 4711 // Make r4 point to the JavaScript frame. |
4712 // we reach the JavaScript frame for the function (similar to what the | 4712 __ LoadRR(r4, fp); |
4713 // runtime fallback implementation does). So make r4 point to that | 4713 if (skip_stub_frame()) { |
4714 // JavaScript frame. | 4714 // For Ignition we need to skip the handler/stub frame to reach the |
4715 { | 4715 // JavaScript frame for the function. |
4716 Label loop, loop_entry; | |
4717 __ LoadRR(r4, fp); | |
4718 __ b(&loop_entry, Label::kNear); | |
4719 __ bind(&loop); | |
4720 __ LoadP(r4, MemOperand(r4, StandardFrameConstants::kCallerFPOffset)); | 4716 __ LoadP(r4, MemOperand(r4, StandardFrameConstants::kCallerFPOffset)); |
4721 __ bind(&loop_entry); | 4717 } |
| 4718 if (FLAG_debug_code) { |
| 4719 Label ok; |
4722 __ LoadP(ip, MemOperand(r4, StandardFrameConstants::kFunctionOffset)); | 4720 __ LoadP(ip, MemOperand(r4, StandardFrameConstants::kFunctionOffset)); |
4723 __ CmpP(ip, r3); | 4721 __ CmpP(ip, r3); |
4724 __ bne(&loop, Label::kNear); | 4722 __ b(&ok, Label::kNear); |
| 4723 __ Abort(kInvalidFrameForFastNewRestArgumentsStub); |
| 4724 __ bind(&ok); |
4725 } | 4725 } |
4726 | 4726 |
4727 // Check if we have rest parameters (only possible if we have an | 4727 // Check if we have rest parameters (only possible if we have an |
4728 // arguments adaptor frame below the function frame). | 4728 // arguments adaptor frame below the function frame). |
4729 Label no_rest_parameters; | 4729 Label no_rest_parameters; |
4730 __ LoadP(r4, MemOperand(r4, StandardFrameConstants::kCallerFPOffset)); | 4730 __ LoadP(r4, MemOperand(r4, StandardFrameConstants::kCallerFPOffset)); |
4731 __ LoadP(ip, MemOperand(r4, CommonFrameConstants::kContextOrFrameTypeOffset)); | 4731 __ LoadP(ip, MemOperand(r4, CommonFrameConstants::kContextOrFrameTypeOffset)); |
4732 __ CmpSmiLiteral(ip, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR), r0); | 4732 __ CmpSmiLiteral(ip, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR), r0); |
4733 __ bne(&no_rest_parameters); | 4733 __ bne(&no_rest_parameters); |
4734 | 4734 |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4848 | 4848 |
4849 void FastNewSloppyArgumentsStub::Generate(MacroAssembler* masm) { | 4849 void FastNewSloppyArgumentsStub::Generate(MacroAssembler* masm) { |
4850 // ----------- S t a t e ------------- | 4850 // ----------- S t a t e ------------- |
4851 // -- r3 : function | 4851 // -- r3 : function |
4852 // -- cp : context | 4852 // -- cp : context |
4853 // -- fp : frame pointer | 4853 // -- fp : frame pointer |
4854 // -- lr : return address | 4854 // -- lr : return address |
4855 // ----------------------------------- | 4855 // ----------------------------------- |
4856 __ AssertFunction(r3); | 4856 __ AssertFunction(r3); |
4857 | 4857 |
4858 // For Ignition we need to skip all possible handler/stub frames until | 4858 // Make r9 point to the JavaScript frame. |
4859 // we reach the JavaScript frame for the function (similar to what the | 4859 __ LoadRR(r9, fp); |
4860 // runtime fallback implementation does). So make r9 point to that | 4860 if (skip_stub_frame()) { |
4861 // JavaScript frame. | 4861 // For Ignition we need to skip the handler/stub frame to reach the |
4862 { | 4862 // JavaScript frame for the function. |
4863 Label loop, loop_entry; | |
4864 __ LoadRR(r9, fp); | |
4865 __ b(&loop_entry); | |
4866 __ bind(&loop); | |
4867 __ LoadP(r9, MemOperand(r9, StandardFrameConstants::kCallerFPOffset)); | 4863 __ LoadP(r9, MemOperand(r9, StandardFrameConstants::kCallerFPOffset)); |
4868 __ bind(&loop_entry); | 4864 } |
| 4865 if (FLAG_debug_code) { |
| 4866 Label ok; |
4869 __ LoadP(ip, MemOperand(r9, StandardFrameConstants::kFunctionOffset)); | 4867 __ LoadP(ip, MemOperand(r9, StandardFrameConstants::kFunctionOffset)); |
4870 __ CmpP(ip, r3); | 4868 __ CmpP(ip, r3); |
4871 __ bne(&loop); | 4869 __ beq(&ok, Label::kNear); |
| 4870 __ Abort(kInvalidFrameForFastNewRestArgumentsStub); |
| 4871 __ bind(&ok); |
4872 } | 4872 } |
4873 | 4873 |
4874 // TODO(bmeurer): Cleanup to match the FastNewStrictArgumentsStub. | 4874 // TODO(bmeurer): Cleanup to match the FastNewStrictArgumentsStub. |
4875 __ LoadP(r4, FieldMemOperand(r3, JSFunction::kSharedFunctionInfoOffset)); | 4875 __ LoadP(r4, FieldMemOperand(r3, JSFunction::kSharedFunctionInfoOffset)); |
4876 __ LoadW( | 4876 __ LoadW( |
4877 r4, FieldMemOperand(r4, SharedFunctionInfo::kFormalParameterCountOffset)); | 4877 r4, FieldMemOperand(r4, SharedFunctionInfo::kFormalParameterCountOffset)); |
4878 #if V8_TARGET_ARCH_S390X | 4878 #if V8_TARGET_ARCH_S390X |
4879 __ SmiTag(r4); | 4879 __ SmiTag(r4); |
4880 #endif | 4880 #endif |
4881 __ SmiToPtrArrayOffset(r5, r4); | 4881 __ SmiToPtrArrayOffset(r5, r4); |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5102 | 5102 |
5103 void FastNewStrictArgumentsStub::Generate(MacroAssembler* masm) { | 5103 void FastNewStrictArgumentsStub::Generate(MacroAssembler* masm) { |
5104 // ----------- S t a t e ------------- | 5104 // ----------- S t a t e ------------- |
5105 // -- r3 : function | 5105 // -- r3 : function |
5106 // -- cp : context | 5106 // -- cp : context |
5107 // -- fp : frame pointer | 5107 // -- fp : frame pointer |
5108 // -- lr : return address | 5108 // -- lr : return address |
5109 // ----------------------------------- | 5109 // ----------------------------------- |
5110 __ AssertFunction(r3); | 5110 __ AssertFunction(r3); |
5111 | 5111 |
5112 // For Ignition we need to skip all possible handler/stub frames until | 5112 // Make r4 point to the JavaScript frame. |
5113 // we reach the JavaScript frame for the function (similar to what the | 5113 __ LoadRR(r4, fp); |
5114 // runtime fallback implementation does). So make r4 point to that | 5114 if (skip_stub_frame()) { |
5115 // JavaScript frame. | 5115 // For Ignition we need to skip the handler/stub frame to reach the |
5116 { | 5116 // JavaScript frame for the function. |
5117 Label loop, loop_entry; | |
5118 __ LoadRR(r4, fp); | |
5119 __ b(&loop_entry); | |
5120 __ bind(&loop); | |
5121 __ LoadP(r4, MemOperand(r4, StandardFrameConstants::kCallerFPOffset)); | 5117 __ LoadP(r4, MemOperand(r4, StandardFrameConstants::kCallerFPOffset)); |
5122 __ bind(&loop_entry); | 5118 } |
| 5119 if (FLAG_debug_code) { |
| 5120 Label ok; |
5123 __ LoadP(ip, MemOperand(r4, StandardFrameConstants::kFunctionOffset)); | 5121 __ LoadP(ip, MemOperand(r4, StandardFrameConstants::kFunctionOffset)); |
5124 __ CmpP(ip, r3); | 5122 __ CmpP(ip, r3); |
5125 __ bne(&loop); | 5123 __ beq(&ok, Label::kNear); |
| 5124 __ Abort(kInvalidFrameForFastNewRestArgumentsStub); |
| 5125 __ bind(&ok); |
5126 } | 5126 } |
5127 | 5127 |
5128 // Check if we have an arguments adaptor frame below the function frame. | 5128 // Check if we have an arguments adaptor frame below the function frame. |
5129 Label arguments_adaptor, arguments_done; | 5129 Label arguments_adaptor, arguments_done; |
5130 __ LoadP(r5, MemOperand(r4, StandardFrameConstants::kCallerFPOffset)); | 5130 __ LoadP(r5, MemOperand(r4, StandardFrameConstants::kCallerFPOffset)); |
5131 __ LoadP(ip, MemOperand(r5, CommonFrameConstants::kContextOrFrameTypeOffset)); | 5131 __ LoadP(ip, MemOperand(r5, CommonFrameConstants::kContextOrFrameTypeOffset)); |
5132 __ CmpSmiLiteral(ip, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR), r0); | 5132 __ CmpSmiLiteral(ip, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR), r0); |
5133 __ beq(&arguments_adaptor); | 5133 __ beq(&arguments_adaptor); |
5134 { | 5134 { |
5135 __ LoadP(r3, FieldMemOperand(r3, JSFunction::kSharedFunctionInfoOffset)); | 5135 __ LoadP(r3, FieldMemOperand(r3, JSFunction::kSharedFunctionInfoOffset)); |
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5714 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, | 5714 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, |
5715 kStackUnwindSpace, NULL, return_value_operand, NULL); | 5715 kStackUnwindSpace, NULL, return_value_operand, NULL); |
5716 } | 5716 } |
5717 | 5717 |
5718 #undef __ | 5718 #undef __ |
5719 | 5719 |
5720 } // namespace internal | 5720 } // namespace internal |
5721 } // namespace v8 | 5721 } // namespace v8 |
5722 | 5722 |
5723 #endif // V8_TARGET_ARCH_S390 | 5723 #endif // V8_TARGET_ARCH_S390 |
OLD | NEW |