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

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: All platforms 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 963 matching lines...) Expand 10 before | Expand all | Expand 10 after
4875 // we reach the JavaScript frame for the function (similar to what the 4875 // we reach the JavaScript frame for the function (similar to what the
4876 // runtime fallback implementation does). So make a2 point to that 4876 // runtime fallback implementation does). So make a2 point to that
4877 // JavaScript frame. 4877 // JavaScript frame.
4878 { 4878 {
4879 Label loop, loop_entry; 4879 Label loop, loop_entry;
4880 __ Branch(USE_DELAY_SLOT, &loop_entry); 4880 __ Branch(USE_DELAY_SLOT, &loop_entry);
4881 __ mov(a2, fp); // In delay slot. 4881 __ mov(a2, fp); // In delay slot.
4882 __ bind(&loop); 4882 __ bind(&loop);
4883 __ ld(a2, MemOperand(a2, StandardFrameConstants::kCallerFPOffset)); 4883 __ ld(a2, MemOperand(a2, StandardFrameConstants::kCallerFPOffset));
4884 __ bind(&loop_entry); 4884 __ bind(&loop_entry);
4885 __ ld(a3, MemOperand(a2, StandardFrameConstants::kMarkerOffset)); 4885 __ ld(a3, MemOperand(a2, StandardFrameConstants::kFunctionOffset));
4886 __ Branch(&loop, ne, a1, Operand(a3)); 4886 __ Branch(&loop, ne, a1, Operand(a3));
4887 } 4887 }
4888 4888
4889 // Check if we have rest parameters (only possible if we have an 4889 // Check if we have rest parameters (only possible if we have an
4890 // arguments adaptor frame below the function frame). 4890 // arguments adaptor frame below the function frame).
4891 Label no_rest_parameters; 4891 Label no_rest_parameters;
4892 __ ld(a2, MemOperand(a2, StandardFrameConstants::kCallerFPOffset)); 4892 __ ld(a2, MemOperand(a2, StandardFrameConstants::kCallerFPOffset));
4893 __ ld(a3, MemOperand(a2, StandardFrameConstants::kContextOffset)); 4893 __ ld(a3, MemOperand(a2, CommonFrameConstants::kContextOrFrameTypeOffset));
4894 __ Branch(&no_rest_parameters, ne, a3, 4894 __ Branch(&no_rest_parameters, ne, a3,
4895 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); 4895 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)));
4896 4896
4897 // Check if the arguments adaptor frame contains more arguments than 4897 // Check if the arguments adaptor frame contains more arguments than
4898 // specified by the function's internal formal parameter count. 4898 // specified by the function's internal formal parameter count.
4899 Label rest_parameters; 4899 Label rest_parameters;
4900 __ SmiLoadUntag( 4900 __ SmiLoadUntag(
4901 a0, MemOperand(a2, ArgumentsAdaptorFrameConstants::kLengthOffset)); 4901 a0, MemOperand(a2, ArgumentsAdaptorFrameConstants::kLengthOffset));
4902 __ ld(a1, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); 4902 __ ld(a1, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset));
4903 __ lw(a1, 4903 __ lw(a1,
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
5028 // a1 : function 5028 // a1 : function
5029 // a2 : number of parameters (tagged) 5029 // a2 : number of parameters (tagged)
5030 // a3 : parameters pointer 5030 // a3 : parameters pointer
5031 // Registers used over whole function: 5031 // Registers used over whole function:
5032 // a5 : arguments count (tagged) 5032 // a5 : arguments count (tagged)
5033 // a6 : mapped parameter count (tagged) 5033 // a6 : mapped parameter count (tagged)
5034 5034
5035 // Check if the calling frame is an arguments adaptor frame. 5035 // Check if the calling frame is an arguments adaptor frame.
5036 Label adaptor_frame, try_allocate, runtime; 5036 Label adaptor_frame, try_allocate, runtime;
5037 __ ld(a4, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); 5037 __ ld(a4, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
5038 __ ld(a0, MemOperand(a4, StandardFrameConstants::kContextOffset)); 5038 __ ld(a0, MemOperand(a4, CommonFrameConstants::kContextOrFrameTypeOffset));
5039 __ Branch(&adaptor_frame, eq, a0, 5039 __ Branch(&adaptor_frame, eq, a0,
5040 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); 5040 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)));
5041 5041
5042 // No adaptor, parameter count = argument count. 5042 // No adaptor, parameter count = argument count.
5043 __ mov(a5, a2); 5043 __ mov(a5, a2);
5044 __ Branch(USE_DELAY_SLOT, &try_allocate); 5044 __ Branch(USE_DELAY_SLOT, &try_allocate);
5045 __ mov(a6, a2); // In delay slot. 5045 __ mov(a6, a2); // In delay slot.
5046 5046
5047 // We have an adaptor frame. Patch the parameters pointer. 5047 // We have an adaptor frame. Patch the parameters pointer.
5048 __ bind(&adaptor_frame); 5048 __ bind(&adaptor_frame);
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
5241 // we reach the JavaScript frame for the function (similar to what the 5241 // we reach the JavaScript frame for the function (similar to what the
5242 // runtime fallback implementation does). So make a2 point to that 5242 // runtime fallback implementation does). So make a2 point to that
5243 // JavaScript frame. 5243 // JavaScript frame.
5244 { 5244 {
5245 Label loop, loop_entry; 5245 Label loop, loop_entry;
5246 __ Branch(USE_DELAY_SLOT, &loop_entry); 5246 __ Branch(USE_DELAY_SLOT, &loop_entry);
5247 __ mov(a2, fp); // In delay slot. 5247 __ mov(a2, fp); // In delay slot.
5248 __ bind(&loop); 5248 __ bind(&loop);
5249 __ ld(a2, MemOperand(a2, StandardFrameConstants::kCallerFPOffset)); 5249 __ ld(a2, MemOperand(a2, StandardFrameConstants::kCallerFPOffset));
5250 __ bind(&loop_entry); 5250 __ bind(&loop_entry);
5251 __ ld(a3, MemOperand(a2, StandardFrameConstants::kMarkerOffset)); 5251 __ ld(a3, MemOperand(a2, StandardFrameConstants::kFunctionOffset));
5252 __ Branch(&loop, ne, a1, Operand(a3)); 5252 __ Branch(&loop, ne, a1, Operand(a3));
5253 } 5253 }
5254 5254
5255 // Check if we have an arguments adaptor frame below the function frame. 5255 // Check if we have an arguments adaptor frame below the function frame.
5256 Label arguments_adaptor, arguments_done; 5256 Label arguments_adaptor, arguments_done;
5257 __ ld(a3, MemOperand(a2, StandardFrameConstants::kCallerFPOffset)); 5257 __ ld(a3, MemOperand(a2, StandardFrameConstants::kCallerFPOffset));
5258 __ ld(a0, MemOperand(a3, StandardFrameConstants::kContextOffset)); 5258 __ ld(a0, MemOperand(a3, CommonFrameConstants::kContextOrFrameTypeOffset));
5259 __ Branch(&arguments_adaptor, eq, a0, 5259 __ Branch(&arguments_adaptor, eq, a0,
5260 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); 5260 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)));
5261 { 5261 {
5262 __ ld(a1, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); 5262 __ ld(a1, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset));
5263 __ lw(a0, 5263 __ lw(a0,
5264 FieldMemOperand(a1, SharedFunctionInfo::kFormalParameterCountOffset)); 5264 FieldMemOperand(a1, SharedFunctionInfo::kFormalParameterCountOffset));
5265 __ Dlsa(a2, a2, a0, kPointerSizeLog2); 5265 __ Dlsa(a2, a2, a0, kPointerSizeLog2);
5266 __ Daddu(a2, a2, Operand(StandardFrameConstants::kCallerSPOffset - 5266 __ Daddu(a2, a2, Operand(StandardFrameConstants::kCallerSPOffset -
5267 1 * kPointerSize)); 5267 1 * kPointerSize));
5268 } 5268 }
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
5797 return_value_operand, NULL); 5797 return_value_operand, NULL);
5798 } 5798 }
5799 5799
5800 5800
5801 #undef __ 5801 #undef __
5802 5802
5803 } // namespace internal 5803 } // namespace internal
5804 } // namespace v8 5804 } // namespace v8
5805 5805
5806 #endif // V8_TARGET_ARCH_MIPS64 5806 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« src/frames.cc ('K') | « src/mips64/builtins-mips64.cc ('k') | src/mips64/codegen-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698