v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
maglev-graph-verifier.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_MAGLEV_MAGLEV_GRAPH_VERIFIER_H_
6#define V8_MAGLEV_MAGLEV_GRAPH_VERIFIER_H_
7
12
13namespace v8 {
14namespace internal {
15namespace maglev {
16
17class Graph;
18
19// TODO(victorgomes): Add more verification.
21 public:
22 explicit MaglevGraphVerifier(MaglevCompilationInfo* compilation_info) {
23 if (compilation_info->has_graph_labeller()) {
24 graph_labeller_ = compilation_info->graph_labeller();
25 }
26 }
27
28 void PreProcessGraph(Graph* graph) { seen_.resize(graph->max_block_id()); }
29 void PostProcessGraph(Graph* graph) {}
32 // Check Ids are unique.
33 CHECK(!seen_[block->id()]);
34 seen_[block->id()] = true;
36 }
38
40 node->VerifyInputs(graph_labeller_);
42 }
43
44 template <typename NodeT>
46 for (Input& input : *node) {
47 Opcode op = input.node()->opcode();
50 }
51 node->VerifyInputs(graph_labeller_);
53 }
54
55 private:
57 std::vector<bool> seen_;
58};
59
60} // namespace maglev
61} // namespace internal
62} // namespace v8
63
64#endif // V8_MAGLEV_MAGLEV_GRAPH_VERIFIER_H_
MaglevGraphVerifier(MaglevCompilationInfo *compilation_info)
ProcessResult Process(NodeT *node, const ProcessingState &state)
ProcessResult Process(Dead *node, const ProcessingState &state)
BlockProcessResult PreProcessBasicBlock(BasicBlock *block)
static constexpr Opcode kLastOpcode
Definition maglev-ir.h:437
static constexpr Opcode kFirstOpcode
Definition maglev-ir.h:436
#define CHECK_GE(lhs, rhs)
#define CHECK(condition)
Definition logging.h:124
#define CHECK_LE(lhs, rhs)