Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: remove uses of deprecated wasm TransferrableModule #30026

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/node_messaging.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ using node::contextify::ContextifyContext;
using v8::Array;
using v8::ArrayBuffer;
using v8::BackingStore;
using v8::CompiledWasmModule;
using v8::Context;
using v8::EscapableHandleScope;
using v8::Exception;
Expand Down Expand Up @@ -58,7 +59,7 @@ class DeserializerDelegate : public ValueDeserializer::Delegate {
Environment* env,
const std::vector<MessagePort*>& message_ports,
const std::vector<Local<SharedArrayBuffer>>& shared_array_buffers,
const std::vector<WasmModuleObject::TransferrableModule>& wasm_modules)
const std::vector<CompiledWasmModule>& wasm_modules)
: message_ports_(message_ports),
shared_array_buffers_(shared_array_buffers),
wasm_modules_(wasm_modules) {}
Expand All @@ -82,7 +83,7 @@ class DeserializerDelegate : public ValueDeserializer::Delegate {
MaybeLocal<WasmModuleObject> GetWasmModuleFromId(
Isolate* isolate, uint32_t transfer_id) override {
CHECK_LE(transfer_id, wasm_modules_.size());
return WasmModuleObject::FromTransferrableModule(
return WasmModuleObject::FromCompiledModule(
isolate, wasm_modules_[transfer_id]);
}

Expand All @@ -91,7 +92,7 @@ class DeserializerDelegate : public ValueDeserializer::Delegate {
private:
const std::vector<MessagePort*>& message_ports_;
const std::vector<Local<SharedArrayBuffer>>& shared_array_buffers_;
const std::vector<WasmModuleObject::TransferrableModule>& wasm_modules_;
const std::vector<CompiledWasmModule>& wasm_modules_;
};

} // anonymous namespace
Expand Down Expand Up @@ -162,7 +163,7 @@ void Message::AddMessagePort(std::unique_ptr<MessagePortData>&& data) {
message_ports_.emplace_back(std::move(data));
}

uint32_t Message::AddWASMModule(WasmModuleObject::TransferrableModule&& mod) {
uint32_t Message::AddWASMModule(CompiledWasmModule&& mod) {
wasm_modules_.emplace_back(std::move(mod));
return wasm_modules_.size() - 1;
}
Expand Down Expand Up @@ -238,7 +239,7 @@ class SerializerDelegate : public ValueSerializer::Delegate {

Maybe<uint32_t> GetWasmModuleTransferId(
Isolate* isolate, Local<WasmModuleObject> module) override {
return Just(msg_->AddWASMModule(module->GetTransferrableModule()));
return Just(msg_->AddWASMModule(module->GetCompiledModule()));
}

void Finish() {
Expand Down
4 changes: 2 additions & 2 deletions src/node_messaging.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Message : public MemoryRetainer {
void AddMessagePort(std::unique_ptr<MessagePortData>&& data);
// Internal method of Message that is called when a new WebAssembly.Module
// object is encountered in the incoming value's structure.
uint32_t AddWASMModule(v8::WasmModuleObject::TransferrableModule&& mod);
uint32_t AddWASMModule(v8::CompiledWasmModule&& mod);

// The MessagePorts that will be transferred, as recorded by Serialize().
// Used for warning user about posting the target MessagePort to itself,
Expand All @@ -76,7 +76,7 @@ class Message : public MemoryRetainer {
std::vector<std::shared_ptr<v8::BackingStore>> array_buffers_;
std::vector<std::shared_ptr<v8::BackingStore>> shared_array_buffers_;
std::vector<std::unique_ptr<MessagePortData>> message_ports_;
std::vector<v8::WasmModuleObject::TransferrableModule> wasm_modules_;
std::vector<v8::CompiledWasmModule> wasm_modules_;

friend class MessagePort;
};
Expand Down