mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
deps: V8: cherry-pick e395d1698453
Original commit message:
[api] Remove deprecated DeserializeOrCompile method
This method was used to implement deserialization via the value
serializer. It was deprecated since this functionality is not used any
more, and hence untested.
This CL cleans up by removing the deprecated method and two private
helper methods.
R=adamk@chromium.org
Bug: v8:10155
Change-Id: I4dda1949fd4f1b499cb6f8d6e6a76b642179303a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2033171
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66096}
Refs: https://github.com/v8/v8/commit/e395d16984537c0767dc8152c7f273dbf2a555f5
PR-URL: https://github.com/nodejs/node/pull/32885
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
This commit is contained in:
1 parent
dfc66a6af4
commit
2ee8b4a512
3 files changed
+1
-70
No files matched your search
+1
-1
@@ -35,7 +35,7 @@
|
||||
|
||||
# Reset this number to 0 on major V8 upgrades.
|
||||
# Increment by one for each non-official patch applied to deps/v8.
|
||||
'v8_embedder_string': '-node.19',
|
||||
'v8_embedder_string': '-node.20',
|
||||
|
||||
##### V8 defaults for Node.js #####
|
||||
|
||||
|
||||
Vendored
-18
@@ -4757,27 +4757,9 @@ class V8_EXPORT WasmModuleObject : public Object {
|
||||
*/
|
||||
CompiledWasmModule GetCompiledModule();
|
||||
|
||||
/**
|
||||
* If possible, deserialize the module, otherwise compile it from the provided
|
||||
* uncompiled bytes.
|
||||
*/
|
||||
V8_DEPRECATED(
|
||||
"Use WasmStreaming for deserialization from cache or the "
|
||||
"CompiledWasmModule to transfer between isolates")
|
||||
static MaybeLocal<WasmModuleObject> DeserializeOrCompile(
|
||||
Isolate* isolate, MemorySpan<const uint8_t> serialized_module,
|
||||
MemorySpan<const uint8_t> wire_bytes);
|
||||
|
||||
V8_INLINE static WasmModuleObject* Cast(Value* obj);
|
||||
|
||||
private:
|
||||
static MaybeLocal<WasmModuleObject> Deserialize(
|
||||
Isolate* isolate, MemorySpan<const uint8_t> serialized_module,
|
||||
MemorySpan<const uint8_t> wire_bytes);
|
||||
static MaybeLocal<WasmModuleObject> Compile(Isolate* isolate,
|
||||
const uint8_t* start,
|
||||
size_t length);
|
||||
|
||||
static void CheckCast(Value* obj);
|
||||
};
|
||||
|
||||
|
||||
Vendored
-51
@@ -7181,57 +7181,6 @@ MaybeLocal<WasmModuleObject> WasmModuleObject::FromCompiledModule(
|
||||
Utils::ToLocal(i::Handle<i::JSObject>::cast(module_object)));
|
||||
}
|
||||
|
||||
MaybeLocal<WasmModuleObject> WasmModuleObject::Deserialize(
|
||||
Isolate* isolate, MemorySpan<const uint8_t> serialized_module,
|
||||
MemorySpan<const uint8_t> wire_bytes) {
|
||||
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
|
||||
i::MaybeHandle<i::WasmModuleObject> maybe_module_object =
|
||||
i::wasm::DeserializeNativeModule(
|
||||
i_isolate, {serialized_module.data(), serialized_module.size()},
|
||||
{wire_bytes.data(), wire_bytes.size()}, {});
|
||||
i::Handle<i::WasmModuleObject> module_object;
|
||||
if (!maybe_module_object.ToHandle(&module_object)) {
|
||||
return MaybeLocal<WasmModuleObject>();
|
||||
}
|
||||
return Local<WasmModuleObject>::Cast(
|
||||
Utils::ToLocal(i::Handle<i::JSObject>::cast(module_object)));
|
||||
}
|
||||
|
||||
MaybeLocal<WasmModuleObject> WasmModuleObject::DeserializeOrCompile(
|
||||
Isolate* isolate, MemorySpan<const uint8_t> serialized_module,
|
||||
MemorySpan<const uint8_t> wire_bytes) {
|
||||
MaybeLocal<WasmModuleObject> ret =
|
||||
Deserialize(isolate, serialized_module, wire_bytes);
|
||||
if (!ret.IsEmpty()) {
|
||||
return ret;
|
||||
}
|
||||
return Compile(isolate, wire_bytes.data(), wire_bytes.size());
|
||||
}
|
||||
|
||||
MaybeLocal<WasmModuleObject> WasmModuleObject::Compile(Isolate* isolate,
|
||||
const uint8_t* start,
|
||||
size_t length) {
|
||||
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
|
||||
if (!i::wasm::IsWasmCodegenAllowed(i_isolate, i_isolate->native_context())) {
|
||||
return MaybeLocal<WasmModuleObject>();
|
||||
}
|
||||
i::MaybeHandle<i::JSObject> maybe_compiled;
|
||||
{
|
||||
i::wasm::ErrorThrower thrower(i_isolate, "WasmModuleObject::Compile()");
|
||||
auto enabled_features = i::wasm::WasmFeatures::FromIsolate(i_isolate);
|
||||
maybe_compiled = i_isolate->wasm_engine()->SyncCompile(
|
||||
i_isolate, enabled_features, &thrower,
|
||||
i::wasm::ModuleWireBytes(start, start + length));
|
||||
}
|
||||
CHECK_EQ(maybe_compiled.is_null(), i_isolate->has_pending_exception());
|
||||
if (maybe_compiled.is_null()) {
|
||||
i_isolate->OptionalRescheduleException(false);
|
||||
return MaybeLocal<WasmModuleObject>();
|
||||
}
|
||||
return Local<WasmModuleObject>::Cast(
|
||||
Utils::ToLocal(maybe_compiled.ToHandleChecked()));
|
||||
}
|
||||
|
||||
WasmModuleObjectBuilderStreaming::WasmModuleObjectBuilderStreaming(
|
||||
Isolate* isolate) {
|
||||
USE(isolate_);
|
||||
|
||||
Reference in new issue
Block a user