// 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_MODULE_COMPILER_H_ #define V8_WASM_MODULE_COMPILER_H_ #include #include #include #include "src/cancelable-task.h" #include "src/globals.h" #include "src/wasm/wasm-features.h" #include "src/wasm/wasm-module.h" namespace v8 { namespace internal { class JSArrayBuffer; class JSPromise; class Counters; class WasmModuleObject; class WasmInstanceObject; template class Vector; namespace wasm { class CompilationResultResolver; class CompilationState; class ErrorThrower; class ModuleCompiler; class NativeModule; class WasmCode; struct ModuleEnv; struct WasmModule; struct CompilationStateDeleter { void operator()(CompilationState* compilation_state) const; }; // Wrapper to create a CompilationState exists in order to avoid having // the CompilationState in the header file. std::unique_ptr NewCompilationState( Isolate* isolate, const ModuleEnv& env); ModuleEnv* GetModuleEnv(CompilationState* compilation_state); MaybeHandle CompileToModuleObject( Isolate* isolate, const WasmFeatures& enabled, ErrorThrower* thrower, std::shared_ptr module, const ModuleWireBytes& wire_bytes, Handle