11cb0ef41Sopenharmony_ci// Copyright 2019 the V8 project authors. All rights reserved.
21cb0ef41Sopenharmony_ci// Use of this source code is governed by a BSD-style license that can be
31cb0ef41Sopenharmony_ci// found in the LICENSE file.
41cb0ef41Sopenharmony_ci
51cb0ef41Sopenharmony_ci#if !V8_ENABLE_WEBASSEMBLY
61cb0ef41Sopenharmony_ci#error This header should only be included if WebAssembly is enabled.
71cb0ef41Sopenharmony_ci#endif  // !V8_ENABLE_WEBASSEMBLY
81cb0ef41Sopenharmony_ci
91cb0ef41Sopenharmony_ci#ifndef V8_WASM_MODULE_INSTANTIATE_H_
101cb0ef41Sopenharmony_ci#define V8_WASM_MODULE_INSTANTIATE_H_
111cb0ef41Sopenharmony_ci
121cb0ef41Sopenharmony_ci#include <stdint.h>
131cb0ef41Sopenharmony_ci
141cb0ef41Sopenharmony_ci#include "include/v8config.h"
151cb0ef41Sopenharmony_ci
161cb0ef41Sopenharmony_cinamespace v8 {
171cb0ef41Sopenharmony_cinamespace internal {
181cb0ef41Sopenharmony_ci
191cb0ef41Sopenharmony_ciclass Isolate;
201cb0ef41Sopenharmony_ciclass JSArrayBuffer;
211cb0ef41Sopenharmony_ciclass JSReceiver;
221cb0ef41Sopenharmony_ciclass WasmModuleObject;
231cb0ef41Sopenharmony_ciclass WasmInstanceObject;
241cb0ef41Sopenharmony_ciclass Zone;
251cb0ef41Sopenharmony_ci
261cb0ef41Sopenharmony_citemplate <typename T>
271cb0ef41Sopenharmony_ciclass Handle;
281cb0ef41Sopenharmony_citemplate <typename T>
291cb0ef41Sopenharmony_ciclass MaybeHandle;
301cb0ef41Sopenharmony_ci
311cb0ef41Sopenharmony_cinamespace wasm {
321cb0ef41Sopenharmony_ci
331cb0ef41Sopenharmony_ciclass ErrorThrower;
341cb0ef41Sopenharmony_ci
351cb0ef41Sopenharmony_ciMaybeHandle<WasmInstanceObject> InstantiateToInstanceObject(
361cb0ef41Sopenharmony_ci    Isolate* isolate, ErrorThrower* thrower,
371cb0ef41Sopenharmony_ci    Handle<WasmModuleObject> module_object, MaybeHandle<JSReceiver> imports,
381cb0ef41Sopenharmony_ci    MaybeHandle<JSArrayBuffer> memory);
391cb0ef41Sopenharmony_ci
401cb0ef41Sopenharmony_cibool LoadElemSegment(Isolate* isolate, Handle<WasmInstanceObject> instance,
411cb0ef41Sopenharmony_ci                     uint32_t table_index, uint32_t segment_index, uint32_t dst,
421cb0ef41Sopenharmony_ci                     uint32_t src, uint32_t count) V8_WARN_UNUSED_RESULT;
431cb0ef41Sopenharmony_ci
441cb0ef41Sopenharmony_ci}  // namespace wasm
451cb0ef41Sopenharmony_ci}  // namespace internal
461cb0ef41Sopenharmony_ci}  // namespace v8
471cb0ef41Sopenharmony_ci
481cb0ef41Sopenharmony_ci#endif  // V8_WASM_MODULE_INSTANTIATE_H_
49