• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2014 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_PPC_FRAME_CONSTANTS_PPC_H_
6 #define V8_PPC_FRAME_CONSTANTS_PPC_H_
7 
8 #include "src/base/macros.h"
9 #include "src/frame-constants.h"
10 
11 namespace v8 {
12 namespace internal {
13 
14 class EntryFrameConstants : public AllStatic {
15  public:
16   static constexpr int kCallerFPOffset =
17       -(StandardFrameConstants::kFixedFrameSizeFromFp + kPointerSize);
18 };
19 
20 class ExitFrameConstants : public TypedFrameConstants {
21  public:
22   static constexpr int kSPOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(0);
23   static constexpr int kCodeOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(1);
24   DEFINE_TYPED_FRAME_SIZES(2);
25 
26   // The caller fields are below the frame pointer on the stack.
27   static constexpr int kCallerFPOffset = 0 * kPointerSize;
28   // The calling JS function is below FP.
29   static constexpr int kCallerPCOffset = 1 * kPointerSize;
30 
31   // FP-relative displacement of the caller's SP.  It points just
32   // below the saved PC.
33   static constexpr int kCallerSPDisplacement = 2 * kPointerSize;
34 };
35 
36 class WasmCompileLazyFrameConstants : public TypedFrameConstants {
37  public:
38   static constexpr int kNumberOfSavedGpParamRegs = 8;
39   static constexpr int kNumberOfSavedFpParamRegs = 8;
40 
41   // FP-relative.
42   static constexpr int kWasmInstanceOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(0);
43   static constexpr int kFixedFrameSizeFromFp =
44       TypedFrameConstants::kFixedFrameSizeFromFp +
45       kNumberOfSavedGpParamRegs * kPointerSize +
46       kNumberOfSavedFpParamRegs * kDoubleSize;
47 };
48 
49 class JavaScriptFrameConstants : public AllStatic {
50  public:
51   // FP-relative.
52   static constexpr int kLocal0Offset =
53       StandardFrameConstants::kExpressionsOffset;
54   static constexpr int kLastParameterOffset = +2 * kPointerSize;
55   static constexpr int kFunctionOffset =
56       StandardFrameConstants::kFunctionOffset;
57 
58   // Caller SP-relative.
59   static constexpr int kParam0Offset = -2 * kPointerSize;
60   static constexpr int kReceiverOffset = -1 * kPointerSize;
61 };
62 
63 }  // namespace internal
64 }  // namespace v8
65 
66 #endif  // V8_PPC_FRAME_CONSTANTS_PPC_H_
67