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_MIPS64_REGLIST_MIPS64_H_ 6 #define V8_CODEGEN_MIPS64_REGLIST_MIPS64_H_ 7 8 #include "src/codegen/mips64/constants-mips64.h" 9 #include "src/codegen/register-arch.h" 10 #include "src/codegen/reglist-base.h" 11 12 namespace v8 { 13 namespace internal { 14 15 using RegList = RegListBase<Register>; 16 using DoubleRegList = RegListBase<DoubleRegister>; 17 ASSERT_TRIVIALLY_COPYABLE(RegList); 18 ASSERT_TRIVIALLY_COPYABLE(DoubleRegList); 19 20 const RegList kJSCallerSaved = {v0, v1, a0, a1, a2, a3, a4, 21 a5, a6, a7, t0, t1, t2, t3}; 22 23 const int kNumJSCallerSaved = 14; 24 25 // Callee-saved registers preserved when switching from C to JavaScript. 26 const RegList kCalleeSaved = {s0, // s0 27 s1, // s1 28 s2, // s2 29 s3, // s3 30 s4, // s4 31 s5, // s5 32 s6, // s6 (roots in Javascript code) 33 s7, // s7 (cp in Javascript code) 34 fp}; // fp/s8 35 36 const int kNumCalleeSaved = 9; 37 38 const DoubleRegList kCalleeSavedFPU = {f20, f22, f24, f26, f28, f30}; 39 40 const int kNumCalleeSavedFPU = 6; 41 42 const DoubleRegList kCallerSavedFPU = {f0, f2, f4, f6, f8, 43 f10, f12, f14, f16, f18}; 44 45 } // namespace internal 46 } // namespace v8 47 48 #endif // V8_CODEGEN_MIPS64_REGLIST_MIPS64_H_ 49