1 // Copyright 2022 the V8 project authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef V8_CODEGEN_ARM_REGLIST_ARM_H_ 6 #define V8_CODEGEN_ARM_REGLIST_ARM_H_ 7 8 #include "src/codegen/register-arch.h" 9 #include "src/codegen/reglist-base.h" 10 11 namespace v8 { 12 namespace internal { 13 14 using RegList = RegListBase<Register>; 15 using DoubleRegList = RegListBase<DoubleRegister>; 16 ASSERT_TRIVIALLY_COPYABLE(RegList); 17 ASSERT_TRIVIALLY_COPYABLE(DoubleRegList); 18 19 // Register list in load/store instructions 20 // Note that the bit values must match those used in actual instruction encoding 21 22 // Caller-saved/arguments registers 23 const RegList kJSCallerSaved = {r0, // r0 a1 24 r1, // r1 a2 25 r2, // r2 a3 26 r3}; // r3 a4 27 28 const int kNumJSCallerSaved = 4; 29 30 // Callee-saved registers preserved when switching from C to JavaScript 31 const RegList kCalleeSaved = {r4, // r4 v1 32 r5, // r5 v2 33 r6, // r6 v3 34 r7, // r7 v4 (cp in JavaScript code) 35 r8, // r8 v5 (pp in JavaScript code) 36 kR9Available ? r9 : Register::no_reg(), // r9 v6 37 r10, // r10 v7 38 r11}; // r11 v8 (fp in JavaScript code) 39 40 // When calling into C++ (only for C++ calls that can't cause a GC). 41 // The call code will take care of lr, fp, etc. 42 const RegList kCallerSaved = {r0, // r0 43 r1, // r1 44 r2, // r2 45 r3, // r3 46 r9}; // r9 47 48 const int kNumCalleeSaved = 7 + kR9Available; 49 50 // Double registers d8 to d15 are callee-saved. 51 const int kNumDoubleCalleeSaved = 8; 52 53 } // namespace internal 54 } // namespace v8 55 56 #endif // V8_CODEGEN_ARM_REGLIST_ARM_H_ 57