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

5 6
#ifndef V8_ARM_FRAME_CONSTANTS_ARM_H_
#define V8_ARM_FRAME_CONSTANTS_ARM_H_
7

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

11 12
namespace v8 {
namespace internal {
13 14 15

class EntryFrameConstants : public AllStatic {
 public:
16 17
  // This is the offset to where JSEntry pushes the current value of
  // Isolate::c_entry_fp onto the stack.
18
  static constexpr int kCallerFPOffset =
19
      -(StandardFrameConstants::kFixedFrameSizeFromFp + kPointerSize);
20 21

  // Stack offsets for arguments passed to JSEntry.
22 23
  static constexpr int kArgcOffset = +0 * kSystemPointerSize;
  static constexpr int kArgvOffset = +1 * kSystemPointerSize;
24 25
};

26
class ExitFrameConstants : public TypedFrameConstants {
27
 public:
28
  static constexpr int kSPOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(0);
29
  DEFINE_TYPED_FRAME_SIZES(1);
30

31
  // The caller fields are below the frame pointer on the stack.
32
  static constexpr int kCallerFPOffset = 0 * kPointerSize;
33
  // The calling JS function is below FP.
34
  static constexpr int kCallerPCOffset = 1 * kPointerSize;
35 36 37

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

41 42 43 44 45 46 47 48 49 50 51 52 53
class WasmCompileLazyFrameConstants : public TypedFrameConstants {
 public:
  static constexpr int kNumberOfSavedGpParamRegs = 4;
  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;
};

54 55 56
class JavaScriptFrameConstants : public AllStatic {
 public:
  // FP-relative.
57 58 59 60 61
  static constexpr int kLocal0Offset =
      StandardFrameConstants::kExpressionsOffset;
  static constexpr int kLastParameterOffset = +2 * kPointerSize;
  static constexpr int kFunctionOffset =
      StandardFrameConstants::kFunctionOffset;
62

63
  // Caller SP-relative.
64 65
  static constexpr int kParam0Offset = -2 * kPointerSize;
  static constexpr int kReceiverOffset = -1 * kPointerSize;
66 67
};

68 69
}  // namespace internal
}  // namespace v8
70

71
#endif  // V8_ARM_FRAME_CONSTANTS_ARM_H_