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

Side by Side Diff: src/mips64/macro-assembler-mips64.cc

Issue 2090723005: [builtins] New frame type for exits to C++ builtins (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add missing condition in SafeStackFrameIter::frame() Created 4 years, 5 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
« no previous file with comments | « src/mips64/macro-assembler-mips64.h ('k') | src/profiler/tick-sample.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include <limits.h> // For LONG_MIN, LONG_MAX. 5 #include <limits.h> // For LONG_MIN, LONG_MAX.
6 6
7 #if V8_TARGET_ARCH_MIPS64 7 #if V8_TARGET_ARCH_MIPS64
8 8
9 #include "src/base/division-by-constant.h" 9 #include "src/base/division-by-constant.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 5897 matching lines...) Expand 10 before | Expand all | Expand 10 after
5908 5908
5909 void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid) { 5909 void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid) {
5910 const Runtime::Function* function = Runtime::FunctionForId(fid); 5910 const Runtime::Function* function = Runtime::FunctionForId(fid);
5911 DCHECK_EQ(1, function->result_size); 5911 DCHECK_EQ(1, function->result_size);
5912 if (function->nargs >= 0) { 5912 if (function->nargs >= 0) {
5913 PrepareCEntryArgs(function->nargs); 5913 PrepareCEntryArgs(function->nargs);
5914 } 5914 }
5915 JumpToExternalReference(ExternalReference(fid, isolate())); 5915 JumpToExternalReference(ExternalReference(fid, isolate()));
5916 } 5916 }
5917 5917
5918
5919 void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin, 5918 void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin,
5920 BranchDelaySlot bd) { 5919 BranchDelaySlot bd,
5920 bool builtin_exit_frame) {
5921 PrepareCEntryFunction(builtin); 5921 PrepareCEntryFunction(builtin);
5922 CEntryStub stub(isolate(), 1); 5922 CEntryStub stub(isolate(), 1, kDontSaveFPRegs, kArgvOnStack,
5923 builtin_exit_frame);
5923 Jump(stub.GetCode(), 5924 Jump(stub.GetCode(),
5924 RelocInfo::CODE_TARGET, 5925 RelocInfo::CODE_TARGET,
5925 al, 5926 al,
5926 zero_reg, 5927 zero_reg,
5927 Operand(zero_reg), 5928 Operand(zero_reg),
5928 bd); 5929 bd);
5929 } 5930 }
5930 5931
5931
5932 void MacroAssembler::SetCounter(StatsCounter* counter, int value, 5932 void MacroAssembler::SetCounter(StatsCounter* counter, int value,
5933 Register scratch1, Register scratch2) { 5933 Register scratch1, Register scratch2) {
5934 if (FLAG_native_code_counters && counter->Enabled()) { 5934 if (FLAG_native_code_counters && counter->Enabled()) {
5935 li(scratch1, Operand(value)); 5935 li(scratch1, Operand(value));
5936 li(scratch2, Operand(ExternalReference(counter))); 5936 li(scratch2, Operand(ExternalReference(counter)));
5937 sd(scratch1, MemOperand(scratch2)); 5937 sd(scratch1, MemOperand(scratch2));
5938 } 5938 }
5939 } 5939 }
5940 5940
5941 5941
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
6177 Daddu(fp, sp, Operand(fp_offset)); 6177 Daddu(fp, sp, Operand(fp_offset));
6178 } 6178 }
6179 6179
6180 6180
6181 void MacroAssembler::LeaveFrame(StackFrame::Type type) { 6181 void MacroAssembler::LeaveFrame(StackFrame::Type type) {
6182 daddiu(sp, fp, 2 * kPointerSize); 6182 daddiu(sp, fp, 2 * kPointerSize);
6183 ld(ra, MemOperand(fp, 1 * kPointerSize)); 6183 ld(ra, MemOperand(fp, 1 * kPointerSize));
6184 ld(fp, MemOperand(fp, 0 * kPointerSize)); 6184 ld(fp, MemOperand(fp, 0 * kPointerSize));
6185 } 6185 }
6186 6186
6187 void MacroAssembler::EnterExitFrame(bool save_doubles, int stack_space) { 6187 void MacroAssembler::EnterExitFrame(bool save_doubles, int stack_space,
6188 StackFrame::Type frame_type) {
6189 DCHECK(frame_type == StackFrame::EXIT ||
6190 frame_type == StackFrame::BUILTIN_EXIT);
6191
6188 // Set up the frame structure on the stack. 6192 // Set up the frame structure on the stack.
6189 STATIC_ASSERT(2 * kPointerSize == ExitFrameConstants::kCallerSPDisplacement); 6193 STATIC_ASSERT(2 * kPointerSize == ExitFrameConstants::kCallerSPDisplacement);
6190 STATIC_ASSERT(1 * kPointerSize == ExitFrameConstants::kCallerPCOffset); 6194 STATIC_ASSERT(1 * kPointerSize == ExitFrameConstants::kCallerPCOffset);
6191 STATIC_ASSERT(0 * kPointerSize == ExitFrameConstants::kCallerFPOffset); 6195 STATIC_ASSERT(0 * kPointerSize == ExitFrameConstants::kCallerFPOffset);
6192 6196
6193 // This is how the stack will look: 6197 // This is how the stack will look:
6194 // fp + 2 (==kCallerSPDisplacement) - old stack's end 6198 // fp + 2 (==kCallerSPDisplacement) - old stack's end
6195 // [fp + 1 (==kCallerPCOffset)] - saved old ra 6199 // [fp + 1 (==kCallerPCOffset)] - saved old ra
6196 // [fp + 0 (==kCallerFPOffset)] - saved old fp 6200 // [fp + 0 (==kCallerFPOffset)] - saved old fp
6197 // [fp - 1 StackFrame::EXIT Smi 6201 // [fp - 1 StackFrame::EXIT Smi
6198 // [fp - 2 (==kSPOffset)] - sp of the called function 6202 // [fp - 2 (==kSPOffset)] - sp of the called function
6199 // [fp - 3 (==kCodeOffset)] - CodeObject 6203 // [fp - 3 (==kCodeOffset)] - CodeObject
6200 // fp - (2 + stack_space + alignment) == sp == [fp - kSPOffset] - top of the 6204 // fp - (2 + stack_space + alignment) == sp == [fp - kSPOffset] - top of the
6201 // new stack (will contain saved ra) 6205 // new stack (will contain saved ra)
6202 6206
6203 // Save registers and reserve room for saved entry sp and code object. 6207 // Save registers and reserve room for saved entry sp and code object.
6204 daddiu(sp, sp, -2 * kPointerSize - ExitFrameConstants::kFixedFrameSizeFromFp); 6208 daddiu(sp, sp, -2 * kPointerSize - ExitFrameConstants::kFixedFrameSizeFromFp);
6205 sd(ra, MemOperand(sp, 4 * kPointerSize)); 6209 sd(ra, MemOperand(sp, 4 * kPointerSize));
6206 sd(fp, MemOperand(sp, 3 * kPointerSize)); 6210 sd(fp, MemOperand(sp, 3 * kPointerSize));
6207 li(at, Operand(Smi::FromInt(StackFrame::EXIT))); 6211 li(at, Operand(Smi::FromInt(frame_type)));
6208 sd(at, MemOperand(sp, 2 * kPointerSize)); 6212 sd(at, MemOperand(sp, 2 * kPointerSize));
6209 // Set up new frame pointer. 6213 // Set up new frame pointer.
6210 daddiu(fp, sp, ExitFrameConstants::kFixedFrameSizeFromFp); 6214 daddiu(fp, sp, ExitFrameConstants::kFixedFrameSizeFromFp);
6211 6215
6212 if (emit_debug_code()) { 6216 if (emit_debug_code()) {
6213 sd(zero_reg, MemOperand(fp, ExitFrameConstants::kSPOffset)); 6217 sd(zero_reg, MemOperand(fp, ExitFrameConstants::kSPOffset));
6214 } 6218 }
6215 6219
6216 // Accessed from ExitFrame::code_slot. 6220 // Accessed from ExitFrame::code_slot.
6217 li(t8, Operand(CodeObject()), CONSTANT_SIZE); 6221 li(t8, Operand(CodeObject()), CONSTANT_SIZE);
(...skipping 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after
7247 if (mag.shift > 0) sra(result, result, mag.shift); 7251 if (mag.shift > 0) sra(result, result, mag.shift);
7248 srl(at, dividend, 31); 7252 srl(at, dividend, 31);
7249 Addu(result, result, Operand(at)); 7253 Addu(result, result, Operand(at));
7250 } 7254 }
7251 7255
7252 7256
7253 } // namespace internal 7257 } // namespace internal
7254 } // namespace v8 7258 } // namespace v8
7255 7259
7256 #endif // V8_TARGET_ARCH_MIPS64 7260 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips64/macro-assembler-mips64.h ('k') | src/profiler/tick-sample.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698