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

Unified Diff: src/wasm/wasm-module.cc

Issue 2205973003: [wasm] Serialization/Deserialization of compiled module (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: disable dchecks Created 4 years, 4 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/wasm/wasm-module.h ('k') | test/mjsunit/wasm/compiled-module-serialization.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/wasm-module.cc
diff --git a/src/wasm/wasm-module.cc b/src/wasm/wasm-module.cc
index f5db1f00bb9d85be32bd689dd7ef19f245ba0c6f..46ef2d3e0bc592858f50daaeedd04c9ebf77c168 100644
--- a/src/wasm/wasm-module.cc
+++ b/src/wasm/wasm-module.cc
@@ -5,12 +5,14 @@
#include <memory>
#include "src/base/atomic-utils.h"
+#include "src/code-stubs.h"
+
#include "src/macro-assembler.h"
#include "src/objects.h"
#include "src/property-descriptor.h"
-#include "src/v8.h"
-
#include "src/simulator.h"
+#include "src/snapshot/snapshot.h"
+#include "src/v8.h"
#include "src/wasm/ast-decoder.h"
#include "src/wasm/module-decoder.h"
@@ -1571,6 +1573,17 @@ int GetNumberOfFunctions(JSObject* wasm) {
return ByteArray::cast(func_names_obj)->get_int(0);
}
+Handle<JSObject> CreateCompiledModuleObject(
+ Isolate* isolate, Handle<FixedArray> compiled_module) {
+ Handle<JSFunction> module_cons(
+ isolate->native_context()->wasm_module_constructor());
+ Handle<JSObject> module_obj = isolate->factory()->NewJSObject(module_cons);
+ module_obj->SetInternalField(0, *compiled_module);
+ Handle<Symbol> module_sym(isolate->native_context()->wasm_module_sym());
+ Object::SetProperty(module_obj, module_sym, module_obj, STRICT).Check();
+ return module_obj;
+}
+
namespace testing {
int32_t CompileAndRunWasmModule(Isolate* isolate, const byte* module_start,
« no previous file with comments | « src/wasm/wasm-module.h ('k') | test/mjsunit/wasm/compiled-module-serialization.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698