diff options
author | Myles Borins <mylesborins@google.com> | 2018-04-10 21:39:51 -0400 |
---|---|---|
committer | Myles Borins <mylesborins@google.com> | 2018-04-11 13:22:42 -0400 |
commit | 12a1b9b8049462e47181a298120243dc83e81c55 (patch) | |
tree | 8605276308c8b4e3597516961266bae1af57557a /deps/v8/src/wasm/wasm-engine.h | |
parent | 78cd8263354705b767ef8c6a651740efe4931ba0 (diff) | |
download | android-node-v8-12a1b9b8049462e47181a298120243dc83e81c55.tar.gz android-node-v8-12a1b9b8049462e47181a298120243dc83e81c55.tar.bz2 android-node-v8-12a1b9b8049462e47181a298120243dc83e81c55.zip |
deps: update V8 to 6.6.346.23
PR-URL: https://github.com/nodejs/node/pull/19201
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'deps/v8/src/wasm/wasm-engine.h')
-rw-r--r-- | deps/v8/src/wasm/wasm-engine.h | 48 |
1 files changed, 45 insertions, 3 deletions
diff --git a/deps/v8/src/wasm/wasm-engine.h b/deps/v8/src/wasm/wasm-engine.h index bf06b47ed7..8a698c83b9 100644 --- a/deps/v8/src/wasm/wasm-engine.h +++ b/deps/v8/src/wasm/wasm-engine.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WASM_ENGINE_H_ -#define WASM_ENGINE_H_ +#ifndef V8_WASM_WASM_ENGINE_H_ +#define V8_WASM_WASM_ENGINE_H_ #include <memory> @@ -14,8 +14,14 @@ namespace v8 { namespace internal { +class WasmModuleObject; +class WasmInstanceObject; + namespace wasm { +class ErrorThrower; +struct ModuleWireBytes; + // The central data structure that represents an engine instance capable of // loading, instantiating, and executing WASM code. class V8_EXPORT_PRIVATE WasmEngine { @@ -23,8 +29,44 @@ class V8_EXPORT_PRIVATE WasmEngine { explicit WasmEngine(std::unique_ptr<WasmCodeManager> code_manager) : code_manager_(std::move(code_manager)) {} + // Synchronously validates the given bytes that represent an encoded WASM + // module. bool SyncValidate(Isolate* isolate, const ModuleWireBytes& bytes); + // Synchronously compiles the given bytes that represent a translated + // asm.js module. + MaybeHandle<WasmModuleObject> SyncCompileTranslatedAsmJs( + Isolate* isolate, ErrorThrower* thrower, const ModuleWireBytes& bytes, + Handle<Script> asm_js_script, + Vector<const byte> asm_js_offset_table_bytes); + + // Synchronously compiles the given bytes that represent an encoded WASM + // module. + MaybeHandle<WasmModuleObject> SyncCompile(Isolate* isolate, + ErrorThrower* thrower, + const ModuleWireBytes& bytes); + + // Synchronously instantiate the given WASM module with the given imports. + // If the module represents an asm.js module, then the supplied {memory} + // should be used as the memory of the instance. + MaybeHandle<WasmInstanceObject> SyncInstantiate( + Isolate* isolate, ErrorThrower* thrower, + Handle<WasmModuleObject> module_object, MaybeHandle<JSReceiver> imports, + MaybeHandle<JSArrayBuffer> memory); + + // Begin an asynchronous compilation of the given bytes that represent an + // encoded WASM module, placing the result in the supplied {promise}. + // The {is_shared} flag indicates if the bytes backing the module could + // be shared across threads, i.e. could be concurrently modified. + void AsyncCompile(Isolate* isolate, Handle<JSPromise> promise, + const ModuleWireBytes& bytes, bool is_shared); + + // Begin an asynchronous instantiation of the given WASM module, placing the + // result in the supplied {promise}. + void AsyncInstantiate(Isolate* isolate, Handle<JSPromise> promise, + Handle<WasmModuleObject> module_object, + MaybeHandle<JSReceiver> imports); + CompilationManager* compilation_manager() { return &compilation_manager_; } WasmCodeManager* code_manager() const { return code_manager_.get(); } @@ -43,4 +85,4 @@ class V8_EXPORT_PRIVATE WasmEngine { } // namespace internal } // namespace v8 -#endif +#endif // V8_WASM_WASM_ENGINE_H_ |