#if !V8_ENABLE_WEBASSEMBLY
#error This header should only be included if WebAssembly is enabled.
#endif
#ifndef V8_WASM_FUZZING_RANDOM_MODULE_GENERATION_H_
#define V8_WASM_FUZZING_RANDOM_MODULE_GENERATION_H_
#include "src/base/export-template.h"
#include "src/base/logging.h"
#include "src/base/vector.h"
namespace v8::internal {
class Zone;
}
namespace v8::internal::wasm::fuzzing {
enum WasmModuleGenerationOptions : uint32_t { … };
constexpr bool ShouldGenerateSIMD(WasmModuleGenerationOptions options) { … }
constexpr bool ShouldGenerateWasmGC(WasmModuleGenerationOptions options) { … }
#if !OFFICIAL_BUILD
template <WasmModuleGenerationOptions options>
V8_EXPORT_PRIVATE base::Vector<uint8_t> GenerateRandomWasmModule(
Zone*, base::Vector<const uint8_t> data);
extern template EXPORT_TEMPLATE_DECLARE(…)
base::Vector<uint8_t> GenerateRandomWasmModule<
WasmModuleGenerationOptions::kMVP>(Zone*,
base::Vector<const uint8_t> data);
extern template EXPORT_TEMPLATE_DECLARE(…)
base::Vector<uint8_t> GenerateRandomWasmModule<
WasmModuleGenerationOptions::kGenerateSIMD>(
Zone*, base::Vector<const uint8_t> data);
extern template EXPORT_TEMPLATE_DECLARE(…)
base::Vector<uint8_t> GenerateRandomWasmModule<
WasmModuleGenerationOptions::kGenerateWasmGC>(
Zone*, base::Vector<const uint8_t> data);
extern template EXPORT_TEMPLATE_DECLARE(…)
base::Vector<uint8_t> GenerateRandomWasmModule<
WasmModuleGenerationOptions::kGenerateAll>(
Zone*, base::Vector<const uint8_t> data);
V8_EXPORT_PRIVATE base::Vector<uint8_t> GenerateWasmModuleForInitExpressions(
Zone*, base::Vector<const uint8_t> data, size_t* count);
V8_EXPORT_PRIVATE base::Vector<uint8_t> GenerateWasmModuleForDeopt(
Zone*, base::Vector<const uint8_t> data, std::vector<std::string>& callees,
std::vector<std::string>& inlinees);
#endif
}
#endif