// Copyright 2017 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef V8_WASM_WASM_ENGINE_H_ #define V8_WASM_WASM_ENGINE_H_ #include #include "src/wasm/compilation-manager.h" #include "src/wasm/wasm-code-manager.h" #include "src/wasm/wasm-memory.h" 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 { public: explicit WasmEngine(std::unique_ptr 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 SyncCompileTranslatedAsmJs( Isolate* isolate, ErrorThrower* thrower, const ModuleWireBytes& bytes, Handle