// Copyright 2024 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. #ifndef WASM_FAST_INTERPRETER_FUZZER_COMMON_H_ #define WASM_FAST_INTERPRETER_FUZZER_COMMON_H_ #include #include #include #include #include "src/wasm/module-decoder.h" #include "src/wasm/wasm-module-builder.h" namespace v8::internal::wasm::fuzzing { std::mt19937_64 MersenneTwister(const char* data, size_t size); // Instantiates and interprets exported functions within module_object if // possible int FastInterpretAndExecuteModule(Isolate* isolate, DirectHandle module_object, std::mt19937_64 g); void InitializeDrumbrakeForFuzzing(); typedef std::function, ZoneBuffer*)> GenerateModuleFunc; int LLVMFuzzerTestOneInputCommon(const uint8_t* data, size_t size, GenerateModuleFunc generate_module); } // namespace v8::internal::wasm::fuzzing #endif // WASM_FAST_INTERPRETER_FUZZER_COMMON_H_