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_ARM | 7 #if V8_TARGET_ARCH_ARM |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/base/division-by-constant.h" | 10 #include "src/base/division-by-constant.h" |
(...skipping 1268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1279 frame_ends = pc_offset(); | 1279 frame_ends = pc_offset(); |
1280 ldm(ia_w, sp, pp.bit() | fp.bit() | lr.bit()); | 1280 ldm(ia_w, sp, pp.bit() | fp.bit() | lr.bit()); |
1281 } else { | 1281 } else { |
1282 mov(sp, fp); | 1282 mov(sp, fp); |
1283 frame_ends = pc_offset(); | 1283 frame_ends = pc_offset(); |
1284 ldm(ia_w, sp, fp.bit() | lr.bit()); | 1284 ldm(ia_w, sp, fp.bit() | lr.bit()); |
1285 } | 1285 } |
1286 return frame_ends; | 1286 return frame_ends; |
1287 } | 1287 } |
1288 | 1288 |
1289 void MacroAssembler::EnterExitFrame(bool save_doubles, int stack_space, | |
1290 StackFrame::Type frame_type) { | |
1291 DCHECK(frame_type == StackFrame::EXIT || | |
1292 frame_type == StackFrame::BUILTIN_EXIT); | |
1293 | 1289 |
| 1290 void MacroAssembler::EnterExitFrame(bool save_doubles, int stack_space) { |
1294 // Set up the frame structure on the stack. | 1291 // Set up the frame structure on the stack. |
1295 DCHECK_EQ(2 * kPointerSize, ExitFrameConstants::kCallerSPDisplacement); | 1292 DCHECK_EQ(2 * kPointerSize, ExitFrameConstants::kCallerSPDisplacement); |
1296 DCHECK_EQ(1 * kPointerSize, ExitFrameConstants::kCallerPCOffset); | 1293 DCHECK_EQ(1 * kPointerSize, ExitFrameConstants::kCallerPCOffset); |
1297 DCHECK_EQ(0 * kPointerSize, ExitFrameConstants::kCallerFPOffset); | 1294 DCHECK_EQ(0 * kPointerSize, ExitFrameConstants::kCallerFPOffset); |
1298 mov(ip, Operand(Smi::FromInt(frame_type))); | 1295 mov(ip, Operand(Smi::FromInt(StackFrame::EXIT))); |
1299 PushCommonFrame(ip); | 1296 PushCommonFrame(ip); |
1300 // Reserve room for saved entry sp and code object. | 1297 // Reserve room for saved entry sp and code object. |
1301 sub(sp, fp, Operand(ExitFrameConstants::kFixedFrameSizeFromFp)); | 1298 sub(sp, fp, Operand(ExitFrameConstants::kFixedFrameSizeFromFp)); |
1302 if (emit_debug_code()) { | 1299 if (emit_debug_code()) { |
1303 mov(ip, Operand::Zero()); | 1300 mov(ip, Operand::Zero()); |
1304 str(ip, MemOperand(fp, ExitFrameConstants::kSPOffset)); | 1301 str(ip, MemOperand(fp, ExitFrameConstants::kSPOffset)); |
1305 } | 1302 } |
1306 if (FLAG_enable_embedded_constant_pool) { | 1303 if (FLAG_enable_embedded_constant_pool) { |
1307 str(pp, MemOperand(fp, ExitFrameConstants::kConstantPoolOffset)); | 1304 str(pp, MemOperand(fp, ExitFrameConstants::kConstantPoolOffset)); |
1308 } | 1305 } |
(...skipping 1539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2848 if (function->nargs >= 0) { | 2845 if (function->nargs >= 0) { |
2849 // TODO(1236192): Most runtime routines don't need the number of | 2846 // TODO(1236192): Most runtime routines don't need the number of |
2850 // arguments passed in because it is constant. At some point we | 2847 // arguments passed in because it is constant. At some point we |
2851 // should remove this need and make the runtime routine entry code | 2848 // should remove this need and make the runtime routine entry code |
2852 // smarter. | 2849 // smarter. |
2853 mov(r0, Operand(function->nargs)); | 2850 mov(r0, Operand(function->nargs)); |
2854 } | 2851 } |
2855 JumpToExternalReference(ExternalReference(fid, isolate())); | 2852 JumpToExternalReference(ExternalReference(fid, isolate())); |
2856 } | 2853 } |
2857 | 2854 |
2858 void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin, | 2855 |
2859 bool builtin_exit_frame) { | 2856 void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin) { |
2860 #if defined(__thumb__) | 2857 #if defined(__thumb__) |
2861 // Thumb mode builtin. | 2858 // Thumb mode builtin. |
2862 DCHECK((reinterpret_cast<intptr_t>(builtin.address()) & 1) == 1); | 2859 DCHECK((reinterpret_cast<intptr_t>(builtin.address()) & 1) == 1); |
2863 #endif | 2860 #endif |
2864 mov(r1, Operand(builtin)); | 2861 mov(r1, Operand(builtin)); |
2865 CEntryStub stub(isolate(), 1, kDontSaveFPRegs, kArgvOnStack, | 2862 CEntryStub stub(isolate(), 1); |
2866 builtin_exit_frame); | |
2867 Jump(stub.GetCode(), RelocInfo::CODE_TARGET); | 2863 Jump(stub.GetCode(), RelocInfo::CODE_TARGET); |
2868 } | 2864 } |
2869 | 2865 |
| 2866 |
2870 void MacroAssembler::SetCounter(StatsCounter* counter, int value, | 2867 void MacroAssembler::SetCounter(StatsCounter* counter, int value, |
2871 Register scratch1, Register scratch2) { | 2868 Register scratch1, Register scratch2) { |
2872 if (FLAG_native_code_counters && counter->Enabled()) { | 2869 if (FLAG_native_code_counters && counter->Enabled()) { |
2873 mov(scratch1, Operand(value)); | 2870 mov(scratch1, Operand(value)); |
2874 mov(scratch2, Operand(ExternalReference(counter))); | 2871 mov(scratch2, Operand(ExternalReference(counter))); |
2875 str(scratch1, MemOperand(scratch2)); | 2872 str(scratch1, MemOperand(scratch2)); |
2876 } | 2873 } |
2877 } | 2874 } |
2878 | 2875 |
2879 | 2876 |
(...skipping 1145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4025 } | 4022 } |
4026 } | 4023 } |
4027 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); | 4024 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); |
4028 add(result, result, Operand(dividend, LSR, 31)); | 4025 add(result, result, Operand(dividend, LSR, 31)); |
4029 } | 4026 } |
4030 | 4027 |
4031 } // namespace internal | 4028 } // namespace internal |
4032 } // namespace v8 | 4029 } // namespace v8 |
4033 | 4030 |
4034 #endif // V8_TARGET_ARCH_ARM | 4031 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |