v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
wasm-disassembler.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_WASM_WASM_DISASSEMBLER_H_
6#define V8_WASM_WASM_DISASSEMBLER_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
13
14namespace v8 {
15
16namespace debug {
17class DisassemblyCollector;
18} // namespace debug
19
20namespace internal {
21namespace wasm {
22
23class NamesProvider;
24
25void Disassemble(const WasmModule* module, ModuleWireBytes wire_bytes,
26 NamesProvider* names,
28 std::vector<int>* function_body_offsets);
29
30void Disassemble(base::Vector<const uint8_t> wire_bytes,
32 std::vector<int>* function_body_offsets);
33
34// Prefer this version if you have the required inputs.
35void DisassembleFunction(const WasmModule* module, int func_index,
36 base::Vector<const uint8_t> wire_bytes,
37 NamesProvider* names, std::ostream& os);
38
39// Use this version when you don't have ModuleWireBytes or a NamesProvider,
40// i.e. during streaming compilation.
41void DisassembleFunction(const WasmModule* module, int func_index,
42 base::Vector<const uint8_t> function_body,
43 base::Vector<const uint8_t> maybe_wire_bytes,
44 uint32_t function_body_offset, std::ostream& os,
45 std::vector<uint32_t>* offsets = nullptr);
46
47} // namespace wasm
48} // namespace internal
49} // namespace v8
50
51#endif // V8_WASM_WASM_DISASSEMBLER_H_
void DisassembleFunction(const WasmModule *module, int func_index, base::Vector< const uint8_t > wire_bytes, NamesProvider *names, std::ostream &os)
void Disassemble(const WasmModule *module, ModuleWireBytes wire_bytes, NamesProvider *names, v8::debug::DisassemblyCollector *collector, std::vector< int > *function_body_offsets)
wasm::WasmModule WasmModule
Definition c-api.cc:87