v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
verifier.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_COMPILER_VERIFIER_H_
6
#define V8_COMPILER_VERIFIER_H_
7
8
#include "
src/base/macros.h
"
9
10
namespace
v8
{
11
namespace
internal
{
12
namespace
compiler {
13
14
class
TFGraph;
15
class
Edge;
16
class
Node;
17
class
Schedule;
18
19
// Verifies properties of a graph, such as the well-formedness of inputs to
20
// each node, etc.
21
class
Verifier
{
22
public
:
23
enum
Typing
{
TYPED
,
UNTYPED
};
24
enum
CheckInputs
{
kValuesOnly
,
kAll
};
25
enum
CodeType
{
kDefault
,
kWasm
};
26
27
Verifier
(
const
Verifier
&) =
delete
;
28
Verifier
&
operator=
(
const
Verifier
&) =
delete
;
29
30
static
void
Run
(
TFGraph
* graph,
Typing
typing =
TYPED
,
31
CheckInputs
check_inputs =
kAll
,
32
CodeType
code_type =
kDefault
);
33
34
#ifdef DEBUG
35
// Verifies consistency of node inputs and uses:
36
// - node inputs should agree with the input count computed from
37
// the node's operator.
38
// - effect inputs should have effect outputs.
39
// - control inputs should have control outputs.
40
// - frame state inputs should be frame states.
41
// - if the node has control uses, it should produce control.
42
// - if the node has effect uses, it should produce effect.
43
// - if the node has frame state uses, it must be a frame state.
44
static
void
VerifyNode
(
Node
* node);
45
46
// Verify that {replacement} has the required outputs
47
// (effect, control or frame state) to be used as an input for {edge}.
48
static
void
VerifyEdgeInputReplacement
(
const
Edge
& edge,
49
const
Node
* replacement);
50
#else
51
static
void
VerifyNode
(
Node
* node) {}
52
static
void
VerifyEdgeInputReplacement
(
const
Edge
& edge,
53
const
Node
* replacement) {}
54
#endif
// DEBUG
55
56
private
:
57
class
Visitor;
58
};
59
60
// Verifies properties of a schedule, such as dominance, phi placement, etc.
61
class
V8_EXPORT_PRIVATE
ScheduleVerifier
{
62
public
:
63
static
void
Run(
Schedule
*
schedule
);
64
};
65
}
// namespace compiler
66
}
// namespace internal
67
}
// namespace v8
68
69
#endif
// V8_COMPILER_VERIFIER_H_
schedule
Schedule * schedule
Definition
add-type-assertions-reducer.cc:17
v8::internal::compiler::Edge
Definition
node.h:423
v8::internal::compiler::Node
Definition
node.h:41
v8::internal::compiler::ScheduleVerifier
Definition
verifier.h:61
v8::internal::compiler::Schedule
Definition
schedule.h:210
v8::internal::compiler::TFGraph
Definition
turbofan-graph.h:32
v8::internal::compiler::Verifier
Definition
verifier.h:21
v8::internal::compiler::Verifier::Verifier
Verifier(const Verifier &)=delete
v8::internal::compiler::Verifier::Typing
Typing
Definition
verifier.h:23
v8::internal::compiler::Verifier::UNTYPED
@ UNTYPED
Definition
verifier.h:23
v8::internal::compiler::Verifier::TYPED
@ TYPED
Definition
verifier.h:23
v8::internal::compiler::Verifier::CheckInputs
CheckInputs
Definition
verifier.h:24
v8::internal::compiler::Verifier::kValuesOnly
@ kValuesOnly
Definition
verifier.h:24
v8::internal::compiler::Verifier::kAll
@ kAll
Definition
verifier.h:24
v8::internal::compiler::Verifier::CodeType
CodeType
Definition
verifier.h:25
v8::internal::compiler::Verifier::kDefault
@ kDefault
Definition
verifier.h:25
v8::internal::compiler::Verifier::kWasm
@ kWasm
Definition
verifier.h:25
v8::internal::compiler::Verifier::VerifyEdgeInputReplacement
static void VerifyEdgeInputReplacement(const Edge &edge, const Node *replacement)
Definition
verifier.h:52
v8::internal::compiler::Verifier::VerifyNode
static void VerifyNode(Node *node)
Definition
verifier.h:51
v8::internal::compiler::Verifier::Run
static void Run(TFGraph *graph, Typing typing=TYPED, CheckInputs check_inputs=kAll, CodeType code_type=kDefault)
Definition
verifier.cc:2050
v8::internal::compiler::Verifier::operator=
Verifier & operator=(const Verifier &)=delete
v8::internal::internal
internal
Definition
wasm-objects-inl.h:458
v8
Definition
api-arguments-inl.h:19
macros.h
V8_EXPORT_PRIVATE
#define V8_EXPORT_PRIVATE
Definition
macros.h:460
src
compiler
verifier.h
Generated on Sun Apr 6 2025 21:08:53 for v8 by
1.12.0