1 // Copyright 2013 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.
5 #include "src/arm64/assembler-arm64.h"
6 #include "src/arm64/constants-arm64.h"
8 #ifndef V8_ARM64_FRAMES_ARM64_H_
9 #define V8_ARM64_FRAMES_ARM64_H_
14 const int kNumRegs = kNumberOfRegisters;
15 // Registers x0-x17 are caller-saved.
16 const int kNumJSCallerSaved = 18;
17 const RegList kJSCallerSaved = 0x3ffff;
19 // Number of registers for which space is reserved in safepoints. Must be a
21 // TODO(all): Refine this number.
22 const int kNumSafepointRegisters = 32;
24 // Define the list of registers actually saved at safepoints.
25 // Note that the number of saved registers may be smaller than the reserved
26 // space, i.e. kNumSafepointSavedRegisters <= kNumSafepointRegisters.
27 #define kSafepointSavedRegisters CPURegList::GetSafepointSavedRegisters().list()
28 #define kNumSafepointSavedRegisters \
29 CPURegList::GetSafepointSavedRegisters().Count();
31 class EntryFrameConstants : public AllStatic {
33 static const int kCallerFPOffset =
34 -(StandardFrameConstants::kFixedFrameSizeFromFp + kPointerSize);
38 class ExitFrameConstants : public AllStatic {
40 static const int kFrameSize = 2 * kPointerSize;
42 static const int kCallerSPDisplacement = 2 * kPointerSize;
43 static const int kCallerPCOffset = 1 * kPointerSize;
44 static const int kCallerFPOffset = 0 * kPointerSize; // <- fp
45 static const int kSPOffset = -1 * kPointerSize;
46 static const int kCodeOffset = -2 * kPointerSize;
47 static const int kLastExitFrameField = kCodeOffset;
49 static const int kConstantPoolOffset = 0; // Not used
53 class JavaScriptFrameConstants : public AllStatic {
56 static const int kLocal0Offset = StandardFrameConstants::kExpressionsOffset;
58 // There are two words on the stack (saved fp and saved lr) between fp and
60 static const int kLastParameterOffset = 2 * kPointerSize;
62 static const int kFunctionOffset = StandardFrameConstants::kMarkerOffset;
66 } } // namespace v8::internal
68 #endif // V8_ARM64_FRAMES_ARM64_H_