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

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

Powered by Google App Engine
This is Rietveld 408576698