v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
safepoint-table-base.h
Go to the documentation of this file.
1// Copyright 2022 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_CODEGEN_SAFEPOINT_TABLE_BASE_H_
6#define V8_CODEGEN_SAFEPOINT_TABLE_BASE_H_
7
8#include <cstdint>
9
10#include "src/base/logging.h"
11
12namespace v8 {
13namespace internal {
14
15// Both Turbofan and Malgev safepoint tables store the stack slots as the first
16// data entry in the header.
19
21 public:
22 static constexpr int kNoDeoptIndex = -1;
23 static constexpr int kNoTrampolinePC = -1;
24
25 SafepointEntryBase() = default;
26
27 SafepointEntryBase(int pc, int deopt_index, int trampoline_pc)
30 }
31
32 bool is_initialized() const { return pc_ != 0; }
33
34 int pc() const {
36 return pc_;
37 }
38
39 int trampoline_pc() const { return trampoline_pc_; }
40
43 }
44
49
50 void Reset() { pc_ = 0; }
51
52 protected:
53 bool operator==(const SafepointEntryBase& other) const {
54 return pc_ == other.pc_ && deopt_index_ == other.deopt_index_ &&
55 trampoline_pc_ == other.trampoline_pc_;
56 }
57
58 private:
59 int pc_ = 0;
62};
63
65 public:
66 bool emitted() const {
68 }
69
71 DCHECK(emitted());
73 }
74
75 protected:
81
82 private:
83 static constexpr int kNoSafepointTableOffset = -1;
85};
86
87} // namespace internal
88} // namespace v8
89
90#endif // V8_CODEGEN_SAFEPOINT_TABLE_BASE_H_
SafepointEntryBase(int pc, int deopt_index, int trampoline_pc)
bool operator==(const SafepointEntryBase &other) const
int32_t offset
uint32_t SafepointTableStackSlotsField_t
constexpr int kSafepointTableStackSlotsOffset
#define DCHECK(condition)
Definition logging.h:482