Index: include/v8.h |
diff --git a/include/v8.h b/include/v8.h |
index 69bf17c33e5c901609e76e4af509c970cac5aab5..67110c619355526e8a0208517847f89ed1170cd8 100644 |
--- a/include/v8.h |
+++ b/include/v8.h |
@@ -18,6 +18,7 @@ |
#include <stddef.h> |
#include <stdint.h> |
#include <stdio.h> |
+#include <memory> |
#include <utility> |
#include <vector> |
@@ -3462,6 +3463,19 @@ class V8_EXPORT Proxy : public Object { |
static void CheckCast(Value* obj); |
}; |
+class V8_EXPORT WasmCompiledModule : public Object { |
+ public: |
+ typedef std::pair<std::unique_ptr<const uint8_t[]>, size_t> SerializedModule; |
+ |
+ SerializedModule Serialize(); |
+ static MaybeLocal<WasmCompiledModule> Deserialize( |
+ Isolate* isolate, const SerializedModule serialized_data); |
+ V8_INLINE static WasmCompiledModule* Cast(Value* obj); |
+ |
+ private: |
+ WasmCompiledModule(); |
+ static void CheckCast(Value* obj); |
+}; |
#ifndef V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT |
// The number of required internal fields can be defined by embedder. |
@@ -8562,6 +8576,12 @@ Proxy* Proxy::Cast(v8::Value* value) { |
return static_cast<Proxy*>(value); |
} |
+WasmCompiledModule* WasmCompiledModule::Cast(v8::Value* value) { |
+#ifdef V8_ENABLE_CHECKS |
+ CheckCast(value); |
+#endif |
+ return static_cast<WasmCompiledModule*>(value); |
+} |
Promise::Resolver* Promise::Resolver::Cast(v8::Value* value) { |
#ifdef V8_ENABLE_CHECKS |