#if !V8_ENABLE_WEBASSEMBLY
#error This header should only be included if WebAssembly is enabled.
#endif
#ifndef V8_WASM_MODULE_INSTANTIATE_H_
#define V8_WASM_MODULE_INSTANTIATE_H_
#include <stdint.h>
#include <optional>
#include "src/common/message-template.h"
#include "src/objects/code-kind.h"
#include "src/wasm/wasm-value.h"
#include "src/wasm/well-known-imports.h"
namespace v8 {
namespace internal {
class FixedArray;
class JSArrayBuffer;
class WasmFunctionData;
class WasmModuleObject;
class WasmInstanceObject;
class WasmTrustedInstanceData;
class Zone;
namespace wasm {
class ErrorThrower;
enum Suspend : int { … };
enum Promise : int { … };
struct WasmModule;
enum class ImportCallKind : uint8_t { … };
constexpr ImportCallKind kDefaultImportCallKind = …;
class ResolvedWasmImport { … };
MaybeHandle<WasmInstanceObject> InstantiateToInstanceObject(
Isolate* isolate, ErrorThrower* thrower,
Handle<WasmModuleObject> module_object, MaybeHandle<JSReceiver> imports,
MaybeHandle<JSArrayBuffer> memory);
std::optional<MessageTemplate> InitializeElementSegment(
Zone* zone, Isolate* isolate,
Handle<WasmTrustedInstanceData> trusted_instance_data,
Handle<WasmTrustedInstanceData> shared_trusted_instance_data,
uint32_t segment_index);
V8_EXPORT_PRIVATE void CreateMapForType(
Isolate* isolate, const WasmModule* module, int type_index,
Handle<WasmTrustedInstanceData> trusted_data,
Handle<WasmInstanceObject> instance_object,
Handle<FixedArray> maybe_shared_maps);
struct WrapperCompilationInfo { … };
}
}
}
#endif