5#ifndef INCLUDE_V8_WASM_H_
6#define INCLUDE_V8_WASM_H_
26class StreamingDecoder;
34 std::unique_ptr<const uint8_t[]>
buffer;
56 const std::string&
source_url()
const {
return source_url_; }
62 explicit CompiledWasmModule(std::shared_ptr<internal::wasm::NativeModule>,
65 const std::shared_ptr<internal::wasm::NativeModule> native_module_;
66 const std::string source_url_;
80#ifdef V8_ENABLE_CHECKS
87 static void CheckCast(
Value*
object);
115#ifdef V8_ENABLE_CHECKS
122 static void CheckCast(
Value* obj);
135 class WasmStreamingImpl;
156 void Finish(
bool can_use_compiled_module =
true);
188 void SetUrl(
const char* url,
size_t length);
199 std::unique_ptr<WasmStreamingImpl> impl_;
212#ifdef V8_ENABLE_CHECKS
224 static void CheckCast(
Value*
object);
friend class WasmModuleObject
const std::string & source_url() const
friend class WasmStreaming
MemorySpan< const uint8_t > GetWireBytesRef()
static Local< WasmMemoryMapDescriptor > New(Isolate *isolate, WasmFileDescriptor fd)
int32_t WasmFileDescriptor
static V8_INLINE WasmMemoryMapDescriptor * Cast(Value *value)
WasmMemoryMapDescriptor()=delete
WasmMemoryObject()=delete
Local< ArrayBuffer > Buffer()
static V8_INLINE WasmMemoryObject * Cast(Value *value)
static V8_INLINE WasmModuleObject * Cast(Value *value)
WasmModuleObject()=delete
static MaybeLocal< WasmModuleObject > FromCompiledModule(Isolate *isolate, const CompiledWasmModule &)
static MaybeLocal< WasmModuleObject > Compile(Isolate *isolate, MemorySpan< const uint8_t > wire_bytes)
CompiledWasmModule GetCompiledModule()
static constexpr internal::ExternalPointerTag kManagedTag
void Finish(bool can_use_compiled_module=true)
void Abort(MaybeLocal< Value > exception)
void OnBytesReceived(const uint8_t *bytes, size_t size)
void SetUrl(const char *url, size_t length)
bool SetCompiledModuleBytes(const uint8_t *bytes, size_t size)
static std::shared_ptr< WasmStreaming > Unpack(Isolate *isolate, Local< Value > value)
WasmStreaming(std::unique_ptr< WasmStreamingImpl > impl)
void SetMoreFunctionsCanBeSerializedCallback(std::function< void(CompiledWasmModule)>)
std::unique_ptr< const uint8_t[]> buffer
OwnedBuffer(std::unique_ptr< const uint8_t[]> buffer, size_t size)