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
14
15namespace v8 {
16namespace internal {
17namespace compiler {
18
19class 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.
26class 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:
37};
38
39} // namespace compiler
40} // namespace internal
41} // namespace v8
42
43#endif // V8_COMPILER_WASM_TYPER_H_
WasmTyper(Editor *editor, MachineGraph *mcgraph, uint32_t function_index)
Definition wasm-typer.cc:26
Reduction Reduce(Node *node) final
Definition wasm-typer.cc:43
const char * reducer_name() const override
Definition wasm-typer.h:30