chromium/v8/tools/wasm/module-inspector.cc

// Copyright 2022 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.

#include <fstream>
#include <iomanip>
#include <iostream>
#include <optional>
#include <vector>

#include "include/libplatform/libplatform.h"
#include "include/v8-initialization.h"
#include "src/wasm/module-decoder-impl.h"
#include "src/wasm/names-provider.h"
#include "src/wasm/string-builder-multiline.h"
#include "src/wasm/wasm-disassembler-impl.h"
#include "src/wasm/wasm-opcodes-inl.h"
#include "tools/wasm/mjsunit-module-disassembler-impl.h"

#if V8_OS_POSIX
#include <unistd.h>
#endif

int PrintHelp(char** argv) {}

namespace v8 {
namespace internal {
namespace wasm {

enum class OutputMode {};

char* PrintHexBytesCore(char* ptr, uint32_t num_bytes, const uint8_t* start) {}

class InstructionStatistics {};

// A variant of FunctionBodyDisassembler that can produce "annotated hex dump"
// format, e.g.:
//     0xfb, 0x07, 0x01,  // struct.new $type1
class ExtendedFunctionDis : public FunctionBodyDisassembler {};

// A variant of ModuleDisassembler that produces "annotated hex dump" format,
// e.g.:
//     0x01, 0x70, 0x00,  // table count 1: funcref no maximum
class HexDumpModuleDis;
class DumpingModuleDecoder : public ModuleDecoderImpl {};

class HexDumpModuleDis : public ITracer {};

class FunctionStatistics {};

////////////////////////////////////////////////////////////////////////////////

class FormatConverter {};

DumpingModuleDecoder::DumpingModuleDecoder(ModuleWireBytes wire_bytes,
                                           HexDumpModuleDis* module_dis)
    :{}

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

FormatConverter;
OutputMode;
MultiLineStringBuilder;

enum class Action {};

struct Options {};

bool ParseInt(char* s, int* out) {}

int ParseOptions(int argc, char** argv, Options* options) {}

int main(int argc, char** argv) {}