Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(819)

Side by Side Diff: src/mips64/code-stubs-mips64.cc

Issue 1696043002: [runtime] Unify and simplify how frames are marked (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix merge problems Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/bootstrapper.h" 7 #include "src/bootstrapper.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/codegen.h" 9 #include "src/codegen.h"
10 #include "src/ic/handler-compiler.h" 10 #include "src/ic/handler-compiler.h"
(...skipping 3880 matching lines...) Expand 10 before | Expand all | Expand 10 after
3891 __ bind(&need_incremental); 3891 __ bind(&need_incremental);
3892 3892
3893 // Fall through when we need to inform the incremental marker. 3893 // Fall through when we need to inform the incremental marker.
3894 } 3894 }
3895 3895
3896 3896
3897 void StubFailureTrampolineStub::Generate(MacroAssembler* masm) { 3897 void StubFailureTrampolineStub::Generate(MacroAssembler* masm) {
3898 CEntryStub ces(isolate(), 1, kSaveFPRegs); 3898 CEntryStub ces(isolate(), 1, kSaveFPRegs);
3899 __ Call(ces.GetCode(), RelocInfo::CODE_TARGET); 3899 __ Call(ces.GetCode(), RelocInfo::CODE_TARGET);
3900 int parameter_count_offset = 3900 int parameter_count_offset =
3901 StubFailureTrampolineFrame::kCallerStackParameterCountFrameOffset; 3901 StubFailureTrampolineFrameConstants::kArgumentsLengthOffset;
3902 __ ld(a1, MemOperand(fp, parameter_count_offset)); 3902 __ ld(a1, MemOperand(fp, parameter_count_offset));
3903 if (function_mode() == JS_FUNCTION_STUB_MODE) { 3903 if (function_mode() == JS_FUNCTION_STUB_MODE) {
3904 __ Daddu(a1, a1, Operand(1)); 3904 __ Daddu(a1, a1, Operand(1));
3905 } 3905 }
3906 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE); 3906 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE);
3907 __ dsll(a1, a1, kPointerSizeLog2); 3907 __ dsll(a1, a1, kPointerSizeLog2);
3908 __ Ret(USE_DELAY_SLOT); 3908 __ Ret(USE_DELAY_SLOT);
3909 __ Daddu(sp, sp, a1); 3909 __ Daddu(sp, sp, a1);
3910 } 3910 }
3911 3911
(...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after
4876 // we reach the JavaScript frame for the function (similar to what the 4876 // we reach the JavaScript frame for the function (similar to what the
4877 // runtime fallback implementation does). So make a2 point to that 4877 // runtime fallback implementation does). So make a2 point to that
4878 // JavaScript frame. 4878 // JavaScript frame.
4879 { 4879 {
4880 Label loop, loop_entry; 4880 Label loop, loop_entry;
4881 __ Branch(USE_DELAY_SLOT, &loop_entry); 4881 __ Branch(USE_DELAY_SLOT, &loop_entry);
4882 __ mov(a2, fp); // In delay slot. 4882 __ mov(a2, fp); // In delay slot.
4883 __ bind(&loop); 4883 __ bind(&loop);
4884 __ ld(a2, MemOperand(a2, StandardFrameConstants::kCallerFPOffset)); 4884 __ ld(a2, MemOperand(a2, StandardFrameConstants::kCallerFPOffset));
4885 __ bind(&loop_entry); 4885 __ bind(&loop_entry);
4886 __ ld(a3, MemOperand(a2, StandardFrameConstants::kMarkerOffset)); 4886 __ ld(a3, MemOperand(a2, StandardFrameConstants::kFunctionOffset));
4887 __ Branch(&loop, ne, a1, Operand(a3)); 4887 __ Branch(&loop, ne, a1, Operand(a3));
4888 } 4888 }
4889 4889
4890 // Check if we have rest parameters (only possible if we have an 4890 // Check if we have rest parameters (only possible if we have an
4891 // arguments adaptor frame below the function frame). 4891 // arguments adaptor frame below the function frame).
4892 Label no_rest_parameters; 4892 Label no_rest_parameters;
4893 __ ld(a2, MemOperand(a2, StandardFrameConstants::kCallerFPOffset)); 4893 __ ld(a2, MemOperand(a2, StandardFrameConstants::kCallerFPOffset));
4894 __ ld(a3, MemOperand(a2, StandardFrameConstants::kContextOffset)); 4894 __ ld(a3, MemOperand(a2, CommonFrameConstants::kContextOrFrameTypeOffset));
4895 __ Branch(&no_rest_parameters, ne, a3, 4895 __ Branch(&no_rest_parameters, ne, a3,
4896 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); 4896 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)));
4897 4897
4898 // Check if the arguments adaptor frame contains more arguments than 4898 // Check if the arguments adaptor frame contains more arguments than
4899 // specified by the function's internal formal parameter count. 4899 // specified by the function's internal formal parameter count.
4900 Label rest_parameters; 4900 Label rest_parameters;
4901 __ SmiLoadUntag( 4901 __ SmiLoadUntag(
4902 a0, MemOperand(a2, ArgumentsAdaptorFrameConstants::kLengthOffset)); 4902 a0, MemOperand(a2, ArgumentsAdaptorFrameConstants::kLengthOffset));
4903 __ ld(a1, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); 4903 __ ld(a1, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset));
4904 __ lw(a1, 4904 __ lw(a1,
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
5029 // a1 : function 5029 // a1 : function
5030 // a2 : number of parameters (tagged) 5030 // a2 : number of parameters (tagged)
5031 // a3 : parameters pointer 5031 // a3 : parameters pointer
5032 // Registers used over whole function: 5032 // Registers used over whole function:
5033 // a5 : arguments count (tagged) 5033 // a5 : arguments count (tagged)
5034 // a6 : mapped parameter count (tagged) 5034 // a6 : mapped parameter count (tagged)
5035 5035
5036 // Check if the calling frame is an arguments adaptor frame. 5036 // Check if the calling frame is an arguments adaptor frame.
5037 Label adaptor_frame, try_allocate, runtime; 5037 Label adaptor_frame, try_allocate, runtime;
5038 __ ld(a4, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); 5038 __ ld(a4, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
5039 __ ld(a0, MemOperand(a4, StandardFrameConstants::kContextOffset)); 5039 __ ld(a0, MemOperand(a4, CommonFrameConstants::kContextOrFrameTypeOffset));
5040 __ Branch(&adaptor_frame, eq, a0, 5040 __ Branch(&adaptor_frame, eq, a0,
5041 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); 5041 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)));
5042 5042
5043 // No adaptor, parameter count = argument count. 5043 // No adaptor, parameter count = argument count.
5044 __ mov(a5, a2); 5044 __ mov(a5, a2);
5045 __ Branch(USE_DELAY_SLOT, &try_allocate); 5045 __ Branch(USE_DELAY_SLOT, &try_allocate);
5046 __ mov(a6, a2); // In delay slot. 5046 __ mov(a6, a2); // In delay slot.
5047 5047
5048 // We have an adaptor frame. Patch the parameters pointer. 5048 // We have an adaptor frame. Patch the parameters pointer.
5049 __ bind(&adaptor_frame); 5049 __ bind(&adaptor_frame);
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
5242 // we reach the JavaScript frame for the function (similar to what the 5242 // we reach the JavaScript frame for the function (similar to what the
5243 // runtime fallback implementation does). So make a2 point to that 5243 // runtime fallback implementation does). So make a2 point to that
5244 // JavaScript frame. 5244 // JavaScript frame.
5245 { 5245 {
5246 Label loop, loop_entry; 5246 Label loop, loop_entry;
5247 __ Branch(USE_DELAY_SLOT, &loop_entry); 5247 __ Branch(USE_DELAY_SLOT, &loop_entry);
5248 __ mov(a2, fp); // In delay slot. 5248 __ mov(a2, fp); // In delay slot.
5249 __ bind(&loop); 5249 __ bind(&loop);
5250 __ ld(a2, MemOperand(a2, StandardFrameConstants::kCallerFPOffset)); 5250 __ ld(a2, MemOperand(a2, StandardFrameConstants::kCallerFPOffset));
5251 __ bind(&loop_entry); 5251 __ bind(&loop_entry);
5252 __ ld(a3, MemOperand(a2, StandardFrameConstants::kMarkerOffset)); 5252 __ ld(a3, MemOperand(a2, StandardFrameConstants::kFunctionOffset));
5253 __ Branch(&loop, ne, a1, Operand(a3)); 5253 __ Branch(&loop, ne, a1, Operand(a3));
5254 } 5254 }
5255 5255
5256 // Check if we have an arguments adaptor frame below the function frame. 5256 // Check if we have an arguments adaptor frame below the function frame.
5257 Label arguments_adaptor, arguments_done; 5257 Label arguments_adaptor, arguments_done;
5258 __ ld(a3, MemOperand(a2, StandardFrameConstants::kCallerFPOffset)); 5258 __ ld(a3, MemOperand(a2, StandardFrameConstants::kCallerFPOffset));
5259 __ ld(a0, MemOperand(a3, StandardFrameConstants::kContextOffset)); 5259 __ ld(a0, MemOperand(a3, CommonFrameConstants::kContextOrFrameTypeOffset));
5260 __ Branch(&arguments_adaptor, eq, a0, 5260 __ Branch(&arguments_adaptor, eq, a0,
5261 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); 5261 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)));
5262 { 5262 {
5263 __ ld(a1, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); 5263 __ ld(a1, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset));
5264 __ lw(a0, 5264 __ lw(a0,
5265 FieldMemOperand(a1, SharedFunctionInfo::kFormalParameterCountOffset)); 5265 FieldMemOperand(a1, SharedFunctionInfo::kFormalParameterCountOffset));
5266 __ Dlsa(a2, a2, a0, kPointerSizeLog2); 5266 __ Dlsa(a2, a2, a0, kPointerSizeLog2);
5267 __ Daddu(a2, a2, Operand(StandardFrameConstants::kCallerSPOffset - 5267 __ Daddu(a2, a2, Operand(StandardFrameConstants::kCallerSPOffset -
5268 1 * kPointerSize)); 5268 1 * kPointerSize));
5269 } 5269 }
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
5798 return_value_operand, NULL); 5798 return_value_operand, NULL);
5799 } 5799 }
5800 5800
5801 5801
5802 #undef __ 5802 #undef __
5803 5803
5804 } // namespace internal 5804 } // namespace internal
5805 } // namespace v8 5805 } // namespace v8
5806 5806
5807 #endif // V8_TARGET_ARCH_MIPS64 5807 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698