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. 4 5 #include "src/arm64/assembler-arm64.h" 6 #include "src/arm64/constants-arm64.h" 7 8 #ifndef V8_ARM64_FRAMES_ARM64_H_ 9 #define V8_ARM64_FRAMES_ARM64_H_ 10 11 namespace v8 { 12 namespace internal { 13 14 const int kNumRegs = kNumberOfRegisters; 15 // Registers x0-x17 are caller-saved. 16 const int kNumJSCallerSaved = 18; 17 const RegList kJSCallerSaved = 0x3ffff; 18 19 // Number of registers for which space is reserved in safepoints. Must be a 20 // multiple of eight. 21 // TODO(all): Refine this number. 22 const int kNumSafepointRegisters = 32; 23 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(); 30 31 class EntryFrameConstants : public AllStatic { 32 public: 33 static const int kCallerFPOffset = 34 -(StandardFrameConstants::kFixedFrameSizeFromFp + kPointerSize); 35 }; 36 37 class ExitFrameConstants : public TypedFrameConstants { 38 public: 39 static const int kSPOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(0); 40 static const int kCodeOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(1); 41 DEFINE_TYPED_FRAME_SIZES(2); 42 static const int kLastExitFrameField = kCodeOffset; 43 44 static const int kConstantPoolOffset = 0; // Not used 45 }; 46 47 48 class JavaScriptFrameConstants : public AllStatic { 49 public: 50 // FP-relative. 51 static const int kLocal0Offset = StandardFrameConstants::kExpressionsOffset; 52 53 // There are two words on the stack (saved fp and saved lr) between fp and 54 // the arguments. 55 static const int kLastParameterOffset = 2 * kPointerSize; 56 57 static const int kFunctionOffset = StandardFrameConstants::kFunctionOffset; 58 }; 59 60 61 } // namespace internal 62 } // namespace v8 63 64 #endif // V8_ARM64_FRAMES_ARM64_H_ 65