wasm-text.h 1.02 KB
Newer Older
1 2 3 4
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

5 6
#ifndef V8_WASM_WASM_TEXT_H_
#define V8_WASM_WASM_TEXT_H_
7 8 9 10 11

#include <cstdint>
#include <ostream>
#include <vector>

12 13
#include "src/common/globals.h"

14 15
namespace v8 {

16 17 18 19 20
namespace debug {
struct WasmDisassemblyOffsetTableEntry;
}  // namespace debug

namespace internal {
21 22 23 24
namespace wasm {

// Forward declaration.
struct WasmModule;
25
struct ModuleWireBytes;
26 27 28 29

// Generate disassembly according to official text format.
// Output disassembly to the given output stream, and optionally return an
// offset table of <byte offset, line, column> via the given pointer.
30 31 32 33
V8_EXPORT_PRIVATE void PrintWasmText(
    const WasmModule* module, const ModuleWireBytes& wire_bytes,
    uint32_t func_index, std::ostream& os,
    std::vector<debug::WasmDisassemblyOffsetTableEntry>* offset_table);
34 35 36 37 38

}  // namespace wasm
}  // namespace internal
}  // namespace v8

39
#endif  // V8_WASM_WASM_TEXT_H_