v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
frame-constants-s390.h
Go to the documentation of this file.
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_EXECUTION_S390_FRAME_CONSTANTS_S390_H_
6#define V8_EXECUTION_S390_FRAME_CONSTANTS_S390_H_
7
8#include "src/base/bits.h"
9#include "src/base/macros.h"
12
13namespace v8 {
14namespace internal {
15
16class EntryFrameConstants : public AllStatic {
17 public:
18 static constexpr int kNextExitFrameFPOffset = -3 * kSystemPointerSize;
19
20 static constexpr int kNextFastCallFrameFPOffset =
22 static constexpr int kNextFastCallFramePCOffset =
24
25 // Stack offsets for arguments passed to JSEntry.
26 static constexpr int kArgvOffset = 20 * kSystemPointerSize;
27};
28
29class WasmLiftoffSetupFrameConstants : public TypedFrameConstants {
30 public:
31 // Number of gp parameters, without the instance.
32 static constexpr int kNumberOfSavedGpParamRegs = 3;
33 static constexpr int kNumberOfSavedFpParamRegs = 4;
34
35 // There's one spilled value (which doesn't need visiting) below the instance.
36 static constexpr int kInstanceSpillOffset =
38
39 // Spilled registers are implicitly sorted backwards by number.
40 static constexpr int kParameterSpillsOffset[] = {
43
44 // SP-relative.
45 static constexpr int kWasmInstanceDataOffset = 2 * kSystemPointerSize;
46 static constexpr int kDeclaredFunctionIndexOffset = 1 * kSystemPointerSize;
47 static constexpr int kNativeModuleOffset = 0;
48};
49
50class WasmLiftoffFrameConstants : public TypedFrameConstants {
51 public:
52 static constexpr int kFeedbackVectorOffset = 3 * kSystemPointerSize;
53 static constexpr int kInstanceDataOffset = 2 * kSystemPointerSize;
54};
55
56// Frame constructed by the {WasmDebugBreak} builtin.
57// After pushing the frame type marker, the builtin pushes all Liftoff cache
58// registers (see liftoff-assembler-defs.h).
59class WasmDebugBreakFrameConstants : public TypedFrameConstants {
60 public:
61 static constexpr RegList kPushedGpRegs = {r2, r3, r4, r5, r6, r7, r8, cp};
62
63 static constexpr DoubleRegList kPushedFpRegs = {d0, d1, d2, d3, d4, d5, d6,
64 d7, d8, d9, d10, d11, d12};
65
66 static constexpr int kNumPushedGpRegisters = kPushedGpRegs.Count();
67 static constexpr int kNumPushedFpRegisters = kPushedFpRegs.Count();
68
69 static constexpr int kLastPushedGpRegisterOffset =
72 static constexpr int kLastPushedFpRegisterOffset =
74
75 // Offsets are fp-relative.
76 static int GetPushedGpRegisterOffset(int reg_code) {
77 DCHECK_NE(0, kPushedGpRegs.bits() & (1 << reg_code));
78 uint32_t lower_regs =
79 kPushedGpRegs.bits() & ((uint32_t{1} << reg_code) - 1);
82 }
83
84 static int GetPushedFpRegisterOffset(int reg_code) {
85 DCHECK_NE(0, kPushedFpRegs.bits() & (1 << reg_code));
86 uint32_t lower_regs =
87 kPushedFpRegs.bits() & ((uint32_t{1} << reg_code) - 1);
90 }
91};
92
93} // namespace internal
94} // namespace v8
95
96#endif // V8_EXECUTION_S390_FRAME_CONSTANTS_S390_H_
static constexpr int kNextFastCallFrameFPOffset
static constexpr int kNextExitFrameFPOffset
static constexpr int kNextFastCallFramePCOffset
constexpr unsigned Count() const
constexpr storage_t bits() const
static constexpr int kFixedFrameSizeFromFp
static constexpr DoubleRegList kPushedFpRegs
#define TYPED_FRAME_PUSHED_VALUE_OFFSET(x)
constexpr unsigned CountPopulation(T value)
Definition bits.h:26
RegListBase< DoubleRegister > DoubleRegList
Definition reglist-arm.h:15
constexpr int kSimd128Size
Definition globals.h:706
RegListBase< Register > RegList
Definition reglist-arm.h:14
constexpr int kSystemPointerSize
Definition globals.h:410
constexpr Register cp
#define DCHECK_NE(v1, v2)
Definition logging.h:486