summaryrefslogtreecommitdiff
path: root/deps/v8/include/v8-wasm.h
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2022-09-21 13:28:42 +0200
committerMichaël Zasso <targos@protonmail.com>2022-10-11 07:24:33 +0200
commit6bd756d7c6dfb7dc25daee329ad70df68c14223e (patch)
treeaf93818c545f5bd04cafd4a0c19817e19a475641 /deps/v8/include/v8-wasm.h
parent624dadb00706a9fc08f919ac72941cdaba7e3ec9 (diff)
downloadnode-new-6bd756d7c6dfb7dc25daee329ad70df68c14223e.tar.gz
deps: update V8 to 10.7.193.13
PR-URL: https://github.com/nodejs/node/pull/44741 Fixes: https://github.com/nodejs/node/issues/44650 Fixes: https://github.com/nodejs/node/issues/37472 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'deps/v8/include/v8-wasm.h')
-rw-r--r--deps/v8/include/v8-wasm.h67
1 files changed, 5 insertions, 62 deletions
diff --git a/deps/v8/include/v8-wasm.h b/deps/v8/include/v8-wasm.h
index 59b2a69b12..05acd2e86d 100644
--- a/deps/v8/include/v8-wasm.h
+++ b/deps/v8/include/v8-wasm.h
@@ -5,6 +5,7 @@
#ifndef INCLUDE_V8_WASM_H_
#define INCLUDE_V8_WASM_H_
+#include <functional>
#include <memory>
#include <string>
@@ -130,19 +131,6 @@ class V8_EXPORT WasmStreaming final {
public:
class WasmStreamingImpl;
- /**
- * Client to receive streaming event notifications.
- */
- class Client {
- public:
- virtual ~Client() = default;
- /**
- * Passes the fully compiled module to the client. This can be used to
- * implement code caching.
- */
- virtual void OnModuleCompiled(CompiledWasmModule compiled_module) = 0;
- };
-
explicit WasmStreaming(std::unique_ptr<WasmStreamingImpl> impl);
~WasmStreaming();
@@ -183,10 +171,11 @@ class V8_EXPORT WasmStreaming final {
bool SetCompiledModuleBytes(const uint8_t* bytes, size_t size);
/**
- * Sets the client object that will receive streaming event notifications.
- * This must be called before {OnBytesReceived}, {Finish}, or {Abort}.
+ * Sets a callback which is called whenever a significant number of new
+ * functions are ready for serialization.
*/
- void SetClient(std::shared_ptr<Client> client);
+ void SetMoreFunctionsCanBeSerializedCallback(
+ std::function<void(CompiledWasmModule)>);
/*
* Sets the UTF-8 encoded source URL for the {Script} object. This must be
@@ -206,52 +195,6 @@ class V8_EXPORT WasmStreaming final {
std::unique_ptr<WasmStreamingImpl> impl_;
};
-// TODO(mtrofin): when streaming compilation is done, we can rename this
-// to simply WasmModuleObjectBuilder
-class V8_EXPORT WasmModuleObjectBuilderStreaming final {
- public:
- explicit WasmModuleObjectBuilderStreaming(Isolate* isolate);
- /**
- * The buffer passed into OnBytesReceived is owned by the caller.
- */
- void OnBytesReceived(const uint8_t*, size_t size);
- void Finish();
- /**
- * Abort streaming compilation. If {exception} has a value, then the promise
- * associated with streaming compilation is rejected with that value. If
- * {exception} does not have value, the promise does not get rejected.
- */
- void Abort(MaybeLocal<Value> exception);
- Local<Promise> GetPromise();
-
- ~WasmModuleObjectBuilderStreaming() = default;
-
- private:
- WasmModuleObjectBuilderStreaming(const WasmModuleObjectBuilderStreaming&) =
- delete;
- WasmModuleObjectBuilderStreaming(WasmModuleObjectBuilderStreaming&&) =
- default;
- WasmModuleObjectBuilderStreaming& operator=(
- const WasmModuleObjectBuilderStreaming&) = delete;
- WasmModuleObjectBuilderStreaming& operator=(
- WasmModuleObjectBuilderStreaming&&) = default;
- Isolate* isolate_ = nullptr;
-
-#if V8_CC_MSVC
- /**
- * We don't need the static Copy API, so the default
- * NonCopyablePersistentTraits would be sufficient, however,
- * MSVC eagerly instantiates the Copy.
- * We ensure we don't use Copy, however, by compiling with the
- * defaults everywhere else.
- */
- Persistent<Promise, CopyablePersistentTraits<Promise>> promise_;
-#else
- Persistent<Promise> promise_;
-#endif
- std::shared_ptr<internal::wasm::StreamingDecoder> streaming_decoder_;
-};
-
} // namespace v8
#endif // INCLUDE_V8_WASM_H_