• 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_X64_REGLIST_X64_H_
6 #define V8_CODEGEN_X64_REGLIST_X64_H_
7 
8 #include "src/base/macros.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 constexpr RegList kJSCallerSaved = {
21     rax, rcx, rdx,
22     rbx,   // used as a caller-saved register in JavaScript code
23     rdi};  // callee function
24 
25 constexpr RegList kCallerSaved =
26 #ifdef V8_TARGET_OS_WIN
27     {rax, rcx, rdx, r8, r9, r10, r11};
28 #else
29     {rax, rcx, rdx, rdi, rsi, r8, r9, r10, r11};
30 #endif  // V8_TARGET_OS_WIN
31 
32 constexpr int kNumJSCallerSaved = 5;
33 
34 }  // namespace internal
35 }  // namespace v8
36 
37 #endif  // V8_CODEGEN_X64_REGLIST_X64_H_
38