• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_MIPS_REGLIST_MIPS_H_
6 #define V8_CODEGEN_MIPS_REGLIST_MIPS_H_
7 
8 #include "src/codegen/mips/constants-mips.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, t0,
21                                 t1, t2, t3, t4, t5, t6, t7};
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_MIPS_REGLIST_MIPS_H_
49