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

Unified Diff: src/objects.h

Issue 2226753002: [wasm] external serialization APIs (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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/api.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index 2a248b7d9134f77e001bdac44d9a7887b6c33214..d16c7dd0da4e3262beb630f18000143145a1f702 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -1002,6 +1002,7 @@ template <class C> inline bool Is(Object* obj);
V(JSWeakMap) \
V(JSWeakSet) \
V(JSRegExp) \
+ V(WebAssemblyCompiledModule) \
V(HashTable) \
V(Dictionary) \
V(UnseededNumberDictionary) \
@@ -8149,6 +8150,25 @@ class JSMessageObject: public JSObject {
kSize> BodyDescriptor;
};
+// A compiled web assembly module.
+class WebAssemblyCompiledModule : public JSObject {
+ public:
+ // Serialize the compiled module. The returned buffer is owned by
+ // the caller, who may simply leave the return value drop out of
+ // scope, once done processing the bytes.
+ // TODO(mtrofin): to avoid increased memory pressure, we should
+ // explore a caller-provided segmented memory design.
+ std::pair<std::unique_ptr<const byte>, size_t> Serialize();
+
+ // Deserialize a compiled module. The buffer is owned by the caller and may
+ // be released after deserialization returns.
+ static MaybeHandle<WebAssemblyCompiledModule> Deserialize(Isolate* isolate,
+ const byte* data,
+ size_t size);
+
+ private:
+ DISALLOW_IMPLICIT_CONSTRUCTORS(WebAssemblyCompiledModule);
+};
// Regular expressions
// The regular expression holds a single reference to a FixedArray in
« no previous file with comments | « src/api.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698