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 #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 Loading... |
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 |
5918 void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin, | 5919 void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin, |
5919 BranchDelaySlot bd, | 5920 BranchDelaySlot bd) { |
5920 bool builtin_exit_frame) { | |
5921 PrepareCEntryFunction(builtin); | 5921 PrepareCEntryFunction(builtin); |
5922 CEntryStub stub(isolate(), 1, kDontSaveFPRegs, kArgvOnStack, | 5922 CEntryStub stub(isolate(), 1); |
5923 builtin_exit_frame); | |
5924 Jump(stub.GetCode(), | 5923 Jump(stub.GetCode(), |
5925 RelocInfo::CODE_TARGET, | 5924 RelocInfo::CODE_TARGET, |
5926 al, | 5925 al, |
5927 zero_reg, | 5926 zero_reg, |
5928 Operand(zero_reg), | 5927 Operand(zero_reg), |
5929 bd); | 5928 bd); |
5930 } | 5929 } |
5931 | 5930 |
| 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 Loading... |
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 | |
6192 // Set up the frame structure on the stack. | 6188 // Set up the frame structure on the stack. |
6193 STATIC_ASSERT(2 * kPointerSize == ExitFrameConstants::kCallerSPDisplacement); | 6189 STATIC_ASSERT(2 * kPointerSize == ExitFrameConstants::kCallerSPDisplacement); |
6194 STATIC_ASSERT(1 * kPointerSize == ExitFrameConstants::kCallerPCOffset); | 6190 STATIC_ASSERT(1 * kPointerSize == ExitFrameConstants::kCallerPCOffset); |
6195 STATIC_ASSERT(0 * kPointerSize == ExitFrameConstants::kCallerFPOffset); | 6191 STATIC_ASSERT(0 * kPointerSize == ExitFrameConstants::kCallerFPOffset); |
6196 | 6192 |
6197 // This is how the stack will look: | 6193 // This is how the stack will look: |
6198 // fp + 2 (==kCallerSPDisplacement) - old stack's end | 6194 // fp + 2 (==kCallerSPDisplacement) - old stack's end |
6199 // [fp + 1 (==kCallerPCOffset)] - saved old ra | 6195 // [fp + 1 (==kCallerPCOffset)] - saved old ra |
6200 // [fp + 0 (==kCallerFPOffset)] - saved old fp | 6196 // [fp + 0 (==kCallerFPOffset)] - saved old fp |
6201 // [fp - 1 StackFrame::EXIT Smi | 6197 // [fp - 1 StackFrame::EXIT Smi |
6202 // [fp - 2 (==kSPOffset)] - sp of the called function | 6198 // [fp - 2 (==kSPOffset)] - sp of the called function |
6203 // [fp - 3 (==kCodeOffset)] - CodeObject | 6199 // [fp - 3 (==kCodeOffset)] - CodeObject |
6204 // fp - (2 + stack_space + alignment) == sp == [fp - kSPOffset] - top of the | 6200 // fp - (2 + stack_space + alignment) == sp == [fp - kSPOffset] - top of the |
6205 // new stack (will contain saved ra) | 6201 // new stack (will contain saved ra) |
6206 | 6202 |
6207 // Save registers and reserve room for saved entry sp and code object. | 6203 // Save registers and reserve room for saved entry sp and code object. |
6208 daddiu(sp, sp, -2 * kPointerSize - ExitFrameConstants::kFixedFrameSizeFromFp); | 6204 daddiu(sp, sp, -2 * kPointerSize - ExitFrameConstants::kFixedFrameSizeFromFp); |
6209 sd(ra, MemOperand(sp, 4 * kPointerSize)); | 6205 sd(ra, MemOperand(sp, 4 * kPointerSize)); |
6210 sd(fp, MemOperand(sp, 3 * kPointerSize)); | 6206 sd(fp, MemOperand(sp, 3 * kPointerSize)); |
6211 li(at, Operand(Smi::FromInt(frame_type))); | 6207 li(at, Operand(Smi::FromInt(StackFrame::EXIT))); |
6212 sd(at, MemOperand(sp, 2 * kPointerSize)); | 6208 sd(at, MemOperand(sp, 2 * kPointerSize)); |
6213 // Set up new frame pointer. | 6209 // Set up new frame pointer. |
6214 daddiu(fp, sp, ExitFrameConstants::kFixedFrameSizeFromFp); | 6210 daddiu(fp, sp, ExitFrameConstants::kFixedFrameSizeFromFp); |
6215 | 6211 |
6216 if (emit_debug_code()) { | 6212 if (emit_debug_code()) { |
6217 sd(zero_reg, MemOperand(fp, ExitFrameConstants::kSPOffset)); | 6213 sd(zero_reg, MemOperand(fp, ExitFrameConstants::kSPOffset)); |
6218 } | 6214 } |
6219 | 6215 |
6220 // Accessed from ExitFrame::code_slot. | 6216 // Accessed from ExitFrame::code_slot. |
6221 li(t8, Operand(CodeObject()), CONSTANT_SIZE); | 6217 li(t8, Operand(CodeObject()), CONSTANT_SIZE); |
(...skipping 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7251 if (mag.shift > 0) sra(result, result, mag.shift); | 7247 if (mag.shift > 0) sra(result, result, mag.shift); |
7252 srl(at, dividend, 31); | 7248 srl(at, dividend, 31); |
7253 Addu(result, result, Operand(at)); | 7249 Addu(result, result, Operand(at)); |
7254 } | 7250 } |
7255 | 7251 |
7256 | 7252 |
7257 } // namespace internal | 7253 } // namespace internal |
7258 } // namespace v8 | 7254 } // namespace v8 |
7259 | 7255 |
7260 #endif // V8_TARGET_ARCH_MIPS64 | 7256 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |