5#ifndef INCLUDE_V8_WASM_H_
6#define INCLUDE_V8_WASM_H_
26class StreamingDecoder;
31
32
36 OwnedBuffer(std::unique_ptr<
const uint8_t[]> buffer, size_t size)
46
47
48
52
53
56 const std::string&
source_url()
const {
return source_url_; }
60 friend class WasmStreaming;
62 explicit CompiledWasmModule(std::shared_ptr<
internal::
wasm::NativeModule>,
63 const char* source_url, size_t url_length);
65 const std::shared_ptr<
internal::
wasm::NativeModule> native_module_;
66 const std::string source_url_;
75
76
80#ifdef V8_ENABLE_CHECKS
87 static void CheckCast(
Value* object);
96
97
98
103
104
105
109
110
115#ifdef V8_ENABLE_CHECKS
122 static void CheckCast(
Value* obj);
126
127
128
129
130
135 class WasmStreamingImpl;
142
143
144
148
149
150
151
152
153
154
155
156 void Finish(
bool can_use_compiled_module =
true);
159
160
161
162
163
167
168
169
170
171
172
173
174
178
179
180
185
186
187
188 void SetUrl(
const char* url, size_t length);
191
192
193
194
199 std::unique_ptr<WasmStreamingImpl> impl_;
203
204
205
206
212#ifdef V8_ENABLE_CHECKS
218 using WasmFileDescriptor = int32_t;
221 WasmFileDescriptor fd);
224 static void CheckCast(
Value* object);
const std::string & source_url() const
MemorySpan< const uint8_t > GetWireBytesRef()
static Local< WasmMemoryMapDescriptor > New(Isolate *isolate, WasmFileDescriptor fd)
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)