v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
wasm-typer.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_COMPILER_WASM_TYPER_H_
6
#define V8_COMPILER_WASM_TYPER_H_
7
8
#if !V8_ENABLE_WEBASSEMBLY
9
#error This header should only be included if WebAssembly is enabled.
10
#endif
// !V8_ENABLE_WEBASSEMBLY
11
12
#include "
src/compiler/graph-reducer.h
"
13
#include "
src/compiler/wasm-graph-assembler.h
"
14
15
namespace
v8
{
16
namespace
internal
{
17
namespace
compiler {
18
19
class
MachineGraph;
20
21
// Recomputes wasm-gc types along the graph to assign the narrowest possible
22
// type to each node.
23
// Specifically, struct field accesses, array element accesses, phis, type
24
// casts, and type guards are retyped.
25
// Types in loops are computed to a fixed point.
26
class
WasmTyper
final :
public
AdvancedReducer
{
27
public
:
28
WasmTyper
(
Editor
* editor,
MachineGraph
* mcgraph, uint32_t function_index);
29
30
const
char
*
reducer_name
()
const override
{
return
"WasmTyper"
; }
31
32
Reduction
Reduce
(
Node
* node)
final
;
33
34
private
:
35
uint32_t
function_index_
;
36
Zone
*
graph_zone_
;
37
};
38
39
}
// namespace compiler
40
}
// namespace internal
41
}
// namespace v8
42
43
#endif
// V8_COMPILER_WASM_TYPER_H_
v8::internal::Zone
Definition
zone.h:43
v8::internal::compiler::AdvancedReducer::Editor
Definition
graph-reducer.h:85
v8::internal::compiler::AdvancedReducer
Definition
graph-reducer.h:82
v8::internal::compiler::MachineGraph
Definition
machine-graph.h:24
v8::internal::compiler::Node
Definition
node.h:41
v8::internal::compiler::Reduction
Definition
graph-reducer.h:34
v8::internal::compiler::WasmTyper
Definition
wasm-typer.h:26
v8::internal::compiler::WasmTyper::graph_zone_
Zone * graph_zone_
Definition
wasm-typer.h:36
v8::internal::compiler::WasmTyper::WasmTyper
WasmTyper(Editor *editor, MachineGraph *mcgraph, uint32_t function_index)
Definition
wasm-typer.cc:26
v8::internal::compiler::WasmTyper::Reduce
Reduction Reduce(Node *node) final
Definition
wasm-typer.cc:43
v8::internal::compiler::WasmTyper::function_index_
uint32_t function_index_
Definition
wasm-typer.h:35
v8::internal::compiler::WasmTyper::reducer_name
const char * reducer_name() const override
Definition
wasm-typer.h:30
graph-reducer.h
v8::internal::internal
internal
Definition
wasm-objects-inl.h:458
v8
Definition
api-arguments-inl.h:19
wasm-graph-assembler.h
src
compiler
wasm-typer.h
Generated on Sun Apr 6 2025 21:08:53 for v8 by
1.12.0