v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
frame-constants-ppc.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_PPC_FRAME_CONSTANTS_PPC_H_
6#define V8_EXECUTION_PPC_FRAME_CONSTANTS_PPC_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 // Need to take constant pool into account.
21 : -3 * kSystemPointerSize;
22
23 static constexpr int kNextFastCallFrameFPOffset =
25 static constexpr int kNextFastCallFramePCOffset =
27};
28
29class WasmLiftoffSetupFrameConstants : public TypedFrameConstants {
30 public:
31 // Number of gp parameters, without the instance.
32 static constexpr int kNumberOfSavedGpParamRegs = 6;
33 static constexpr int kNumberOfSavedFpParamRegs = 8;
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[] = {
44
45 // SP-relative.
46 static constexpr int kWasmInstanceDataOffset = 2 * kSystemPointerSize;
47 static constexpr int kDeclaredFunctionIndexOffset = 1 * kSystemPointerSize;
48 static constexpr int kNativeModuleOffset = 0;
49};
50
51class WasmLiftoffFrameConstants : public TypedFrameConstants {
52 public:
53 static constexpr int kFeedbackVectorOffset =
55 static constexpr int32_t kInstanceDataOffset =
57};
58
59// Frame constructed by the {WasmDebugBreak} builtin.
60// After pushing the frame type marker, the builtin pushes all Liftoff cache
61// registers (see liftoff-assembler-defs.h).
63 public:
64 static constexpr RegList kPushedGpRegs = {r3, r4, r5, r6, r7, r8,
65 r9, r10, r11, r15, cp};
66
67 static constexpr DoubleRegList kPushedFpRegs = {d0, d1, d2, d3, d4, d5, d6,
68 d7, d8, d9, d10, d11, d12};
69
71 v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12};
72
73 static constexpr int kNumPushedGpRegisters = kPushedGpRegs.Count();
74 static constexpr int kNumPushedFpRegisters = kPushedFpRegs.Count();
75
76 static constexpr int kLastPushedGpRegisterOffset =
79 static constexpr int kLastPushedFpRegisterOffset =
81
82 // Offsets are fp-relative.
83 static int GetPushedGpRegisterOffset(int reg_code) {
84 DCHECK_NE(0, kPushedGpRegs.bits() & (1 << reg_code));
85 uint32_t lower_regs =
86 kPushedGpRegs.bits() & ((uint32_t{1} << reg_code) - 1);
89 }
90
91 static int GetPushedFpRegisterOffset(int reg_code) {
92 DCHECK_NE(0, kPushedFpRegs.bits() & (1 << reg_code));
93 uint32_t lower_regs =
94 kPushedFpRegs.bits() & ((uint32_t{1} << reg_code) - 1);
97 }
98};
99
100} // namespace internal
101} // namespace v8
102
103#endif // V8_EXECUTION_PPC_FRAME_CONSTANTS_PPC_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 Simd128RegList kPushedSimd128Regs
static constexpr DoubleRegList kPushedFpRegs
#define V8_EMBEDDED_CONSTANT_POOL_BOOL
Definition globals.h:81
#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
constexpr int kSystemPointerSize
Definition globals.h:410
constexpr Register r11
constexpr Register cp
constexpr int kDoubleSize
Definition globals.h:407
#define DCHECK_NE(v1, v2)
Definition logging.h:486