frame-constants-ppc.h 2.13 KB
Newer Older
1 2 3 4
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

5 6
#ifndef V8_PPC_FRAME_CONSTANTS_PPC_H_
#define V8_PPC_FRAME_CONSTANTS_PPC_H_
7

8
#include "src/base/macros.h"
9 10
#include "src/frame-constants.h"

11 12 13 14 15
namespace v8 {
namespace internal {

class EntryFrameConstants : public AllStatic {
 public:
16
  static constexpr int kCallerFPOffset =
17 18 19
      -(StandardFrameConstants::kFixedFrameSizeFromFp + kPointerSize);
};

20
class ExitFrameConstants : public TypedFrameConstants {
21
 public:
22 23
  static constexpr int kSPOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(0);
  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 32

  // FP-relative displacement of the caller's SP.  It points just
  // below the saved PC.
33
  static constexpr int kCallerSPDisplacement = 2 * kPointerSize;
34 35
};

36 37 38 39 40 41 42 43 44 45 46 47 48
class WasmCompileLazyFrameConstants : public TypedFrameConstants {
 public:
  static constexpr int kNumberOfSavedGpParamRegs = 8;
  static constexpr int kNumberOfSavedFpParamRegs = 8;

  // FP-relative.
  static constexpr int kWasmInstanceOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(0);
  static constexpr int kFixedFrameSizeFromFp =
      TypedFrameConstants::kFixedFrameSizeFromFp +
      kNumberOfSavedGpParamRegs * kPointerSize +
      kNumberOfSavedFpParamRegs * kDoubleSize;
};

49 50 51
class JavaScriptFrameConstants : public AllStatic {
 public:
  // FP-relative.
52 53 54 55 56
  static constexpr int kLocal0Offset =
      StandardFrameConstants::kExpressionsOffset;
  static constexpr int kLastParameterOffset = +2 * kPointerSize;
  static constexpr int kFunctionOffset =
      StandardFrameConstants::kFunctionOffset;
57 58

  // Caller SP-relative.
59 60
  static constexpr int kParam0Offset = -2 * kPointerSize;
  static constexpr int kReceiverOffset = -1 * kPointerSize;
61 62
};

63 64
}  // namespace internal
}  // namespace v8
65

66
#endif  // V8_PPC_FRAME_CONSTANTS_PPC_H_