Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1553)

Unified Diff: src/snapshot/code-serializer.cc

Issue 2424623002: [wasm] Use a Managed<WasmModule> to hold metadata about modules. (Closed)
Patch Set: [wasm] Use a Managed<WasmModule> to hold metadata about modules. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/snapshot/code-serializer.h ('k') | src/wasm/managed.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/snapshot/code-serializer.cc
diff --git a/src/snapshot/code-serializer.cc b/src/snapshot/code-serializer.cc
index 9712d79e19ed27c214112d4476bd9d256ddb3347..74ccf5f26064b04617df74f59577126dcdc2b3fe 100644
--- a/src/snapshot/code-serializer.cc
+++ b/src/snapshot/code-serializer.cc
@@ -12,6 +12,7 @@
#include "src/snapshot/deserializer.h"
#include "src/snapshot/snapshot.h"
#include "src/version.h"
+#include "src/wasm/wasm-module.h"
namespace v8 {
namespace internal {
@@ -217,7 +218,9 @@ MaybeHandle<SharedFunctionInfo> CodeSerializer::Deserialize(
}
std::unique_ptr<ScriptData> WasmCompiledModuleSerializer::SerializeWasmModule(
- Isolate* isolate, Handle<FixedArray> compiled_module) {
+ Isolate* isolate, Handle<FixedArray> input) {
+ Handle<wasm::WasmCompiledModule> compiled_module =
+ Handle<wasm::WasmCompiledModule>::cast(input);
WasmCompiledModuleSerializer wasm_cs(isolate, 0);
wasm_cs.reference_map()->AddAttachedReference(*isolate->native_context());
ScriptData* data = wasm_cs.Serialize(compiled_module);
@@ -247,7 +250,10 @@ MaybeHandle<FixedArray> WasmCompiledModuleSerializer::DeserializeWasmModule(
MaybeHandle<HeapObject> obj = deserializer.DeserializeObject(isolate);
if (obj.is_null() || !obj.ToHandleChecked()->IsFixedArray()) return nothing;
- return Handle<FixedArray>::cast(obj.ToHandleChecked());
+ Handle<FixedArray> compiled_module =
+ Handle<FixedArray>::cast(obj.ToHandleChecked());
+ wasm::WasmCompiledModule::RecreateModuleWrapper(isolate, compiled_module);
+ return compiled_module;
}
class Checksum {
« no previous file with comments | « src/snapshot/code-serializer.h ('k') | src/wasm/managed.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698