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

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

Powered by Google App Engine
This is Rietveld 408576698