#ifndef WASM_RUN_UTILS_H
#define WASM_RUN_UTILS_H
#include <setjmp.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <array>
#include <memory>
#include "src/base/utils/random-number-generator.h"
#include "src/compiler/compiler-source-position-table.h"
#include "src/compiler/int64-lowering.h"
#include "src/compiler/js-graph.h"
#include "src/compiler/node.h"
#include "src/compiler/wasm-compiler.h"
#include "src/trap-handler/trap-handler.h"
#include "src/wasm/canonical-types.h"
#include "src/wasm/function-body-decoder.h"
#include "src/wasm/local-decl-encoder.h"
#include "src/wasm/wasm-code-manager.h"
#include "src/wasm/wasm-external-refs.h"
#include "src/wasm/wasm-js.h"
#include "src/wasm/wasm-module.h"
#include "src/wasm/wasm-objects-inl.h"
#include "src/wasm/wasm-objects.h"
#include "src/wasm/wasm-opcodes.h"
#include "src/wasm/wasm-tier.h"
#include "src/zone/accounting-allocator.h"
#include "src/zone/zone.h"
#include "test/cctest/cctest.h"
#include "test/cctest/compiler/graph-and-builders.h"
#include "test/common/call-tester.h"
#include "test/common/value-helper.h"
#include "test/common/wasm/flag-utils.h"
#if V8_ENABLE_DRUMBRAKE
#include "src/wasm/interpreter/wasm-interpreter.h"
#endif
namespace v8::internal::wasm {
enum class TestExecutionTier : int8_t { … };
static_assert(
std::is_same<std::underlying_type<ExecutionTier>::type,
std::underlying_type<TestExecutionTier>::type>::value,
"enum types match");
enum TestingModuleMemoryType { … };
ReadLittleEndianValue;
WriteLittleEndianValue;
constexpr uint32_t kMaxFunctions = …;
constexpr uint32_t kMaxGlobalsSize = …;
constexpr int kMaxNumSteps = …;
CallDescriptor;
MachineTypeForC;
Node;
#define CHECK_TRAP32(x) …
#define CHECK_TRAP64(x) …
#define CHECK_TRAP(x) …
#define WASM_WRAPPER_RETURN_VALUE …
#define ADD_CODE(vec, ...) …
struct ManuallyImportedJSFunction { … };
bool IsSameNan(uint16_t expected, uint16_t actual);
bool IsSameNan(float expected, float actual);
bool IsSameNan(double expected, double actual);
class TestingModuleBuilder { … };
void TestBuildingGraph(Zone* zone, compiler::JSGraph* jsgraph,
CompilationEnv* env, const FunctionSig* sig,
compiler::SourcePositionTable* source_position_table,
const uint8_t* start, const uint8_t* end);
class WasmFunctionCompiler { … };
class WasmRunnerBase : public InitializedHandleScope { … };
template <typename T>
inline WasmValue WasmValueInitializer(T value) { … }
template <>
inline WasmValue WasmValueInitializer(int8_t value) { … }
template <>
inline WasmValue WasmValueInitializer(int16_t value) { … }
template <typename ReturnType, typename... ParamTypes>
class WasmRunner : public WasmRunnerBase { … };
#if V8_ENABLE_DRUMBRAKE
#define TEST_IF_DRUMBRAKE …
#else
#define TEST_IF_DRUMBRAKE(name) …
#endif
#define WASM_EXEC_TEST(name) …
#define UNINITIALIZED_WASM_EXEC_TEST(name) …
#define WASM_COMPILED_EXEC_TEST(name) …
}
#endif