v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
c-api.cc File Reference
#include "src/wasm/c-api.h"
#include <cstring>
#include <iomanip>
#include <iostream>
#include "include/libplatform/libplatform.h"
#include "include/v8-initialization.h"
#include "src/api/api-inl.h"
#include "src/builtins/builtins.h"
#include "src/compiler/wasm-compiler.h"
#include "src/flags/flags.h"
#include "src/objects/call-site-info-inl.h"
#include "src/objects/js-collection-inl.h"
#include "src/objects/managed-inl.h"
#include "src/wasm/leb-helper.h"
#include "src/wasm/module-instantiate.h"
#include "src/wasm/signature-hashing.h"
#include "src/wasm/wasm-arguments.h"
#include "src/wasm/wasm-constants.h"
#include "src/wasm/wasm-engine.h"
#include "src/wasm/wasm-objects.h"
#include "src/wasm/wasm-result.h"
#include "src/wasm/wasm-serialization.h"
#include "third_party/wasm-api/wasm.h"
Include dependency graph for c-api.cc:

Go to the source code of this file.

Classes

struct  wasm::ConfigImpl
 
struct  wasm::implement< Config >
 
struct  wasm::EngineImpl
 
struct  wasm::implement< Engine >
 
struct  wasm::ManagedData
 
struct  wasm::implement< Store >
 
struct  wasm::ValTypeImpl
 
struct  wasm::implement< ValType >
 
struct  wasm::ExternTypeImpl
 
struct  wasm::implement< ExternType >
 
struct  wasm::FuncTypeImpl
 
struct  wasm::implement< FuncType >
 
struct  wasm::GlobalTypeImpl
 
struct  wasm::implement< GlobalType >
 
struct  wasm::TableTypeImpl
 
struct  wasm::implement< TableType >
 
struct  wasm::MemoryTypeImpl
 
struct  wasm::implement< MemoryType >
 
struct  wasm::ImportTypeImpl
 
struct  wasm::implement< ImportType >
 
struct  wasm::ExportTypeImpl
 
struct  wasm::implement< ExportType >
 
class  wasm::RefImpl< Ref, JSType >
 
struct  wasm::implement< Ref >
 
struct  wasm::implement< Frame >
 
struct  wasm::implement< Trap >
 
struct  wasm::implement< Foreign >
 
struct  wasm::implement< Module >
 
struct  wasm::implement< Shared< Module > >
 
struct  wasm::implement< Extern >
 
struct  wasm::implement< Func >
 
struct  wasm::FuncData
 
struct  wasm::implement< Global >
 
struct  wasm::implement< Table >
 
struct  wasm::implement< Memory >
 
struct  wasm::implement< Instance >
 
struct  borrowed_vec< T >
 
struct  borrowed_val
 
struct  wasm_callback_env_t
 

Namespaces

namespace  wasm
 

Macros

#define WASM_EXPORT
 
#define DUMP_COUNTERS   0
 
#define WASM_DEFINE_OWN(name, Name)
 
#define ASSERT_VEC_BASE_SIZE(name, Name, vec, ptr_or_none)
 
#define WASM_DEFINE_VEC_BASE(name, Name, vec, ptr_or_none)
 
#define WASM_DEFINE_VEC_PLAIN(name, Name)
 
#define WASM_DEFINE_VEC_OWN(name, Name)
 
#define WASM_DEFINE_TYPE(name, Name)
 
#define WASM_DEFINE_REF_BASE(name, Name)
 
#define WASM_DEFINE_REF(name, Name)
 
#define WASM_DEFINE_SHARABLE_REF(name, Name)
 

Functions

void wasm::WASM_UNIMPLEMENTED (const char *s)
 BEGIN FILE wasm-v8.cc.
 
template<class T >
void wasm::ignore (T)
 
template<class C >
auto wasm::impl (C *x) -> typename implement< C >::type *
 
template<class C >
auto wasm::impl (const C *x) -> const typename implement< C >::type *
 
template<class C >
auto wasm::seal (typename implement< C >::type *x) -> C *
 
template<class C >
auto wasm::seal (const typename implement< C >::type *x) -> const C *
 
void wasm::CheckAndHandleInterrupts (i::Isolate *isolate)
 
i::DirectHandle< i::Stringwasm::VecToString (i::Isolate *isolate, const vec< byte_t > &chars)
 
ownvec< ExportType > wasm::ExportsImpl (i::DirectHandle< i::WasmModuleObject > module_obj)
 
auto wasm::extern_to_v8 (const Extern *ex) -> i::DirectHandle< i::JSReceiver >
 
template<class T >
auto is_empty (T *p) -> bool
 
wasm_config_t * wasm_config_new ()
 
wasm_engine_t * wasm_engine_new ()
 
wasm_engine_t * wasm_engine_new_with_config (wasm_config_t *config)
 
wasm_store_t * wasm_store_new (wasm_engine_t *engine)
 
auto hide_mutability (wasm::Mutability mutability) -> wasm_mutability_t
 
auto reveal_mutability (wasm_mutability_t mutability) -> wasm::Mutability
 
auto hide_limits (const wasm::Limits &limits) -> const wasm_limits_t *
 
auto reveal_limits (wasm_limits_t limits) -> wasm::Limits
 
auto hide_valkind (wasm::ValKind kind) -> wasm_valkind_t
 
auto reveal_valkind (wasm_valkind_t kind) -> wasm::ValKind
 
auto hide_externkind (wasm::ExternKind kind) -> wasm_externkind_t
 
auto reveal_externkind (wasm_externkind_t kind) -> wasm::ExternKind
 
wasm_valtype_t * wasm_valtype_new (wasm_valkind_t k)
 
wasm_valkind_t wasm_valtype_kind (const wasm_valtype_t *t)
 
wasm_functype_t * wasm_functype_new (wasm_valtype_vec_t *params, wasm_valtype_vec_t *results)
 
const wasm_valtype_vec_t * wasm_functype_params (const wasm_functype_t *ft)
 
const wasm_valtype_vec_t * wasm_functype_results (const wasm_functype_t *ft)
 
wasm_globaltype_t * wasm_globaltype_new (wasm_valtype_t *content, wasm_mutability_t mutability)
 
const wasm_valtype_t * wasm_globaltype_content (const wasm_globaltype_t *gt)
 
wasm_mutability_t wasm_globaltype_mutability (const wasm_globaltype_t *gt)
 
wasm_tabletype_t * wasm_tabletype_new (wasm_valtype_t *element, const wasm_limits_t *limits)
 
const wasm_valtype_t * wasm_tabletype_element (const wasm_tabletype_t *tt)
 
const wasm_limits_t * wasm_tabletype_limits (const wasm_tabletype_t *tt)
 
wasm_memorytype_t * wasm_memorytype_new (const wasm_limits_t *limits)
 
const wasm_limits_t * wasm_memorytype_limits (const wasm_memorytype_t *mt)
 
wasm_externkind_t wasm_externtype_kind (const wasm_externtype_t *et)
 
wasm_externtype_t * wasm_functype_as_externtype (wasm_functype_t *ft)
 
wasm_externtype_t * wasm_globaltype_as_externtype (wasm_globaltype_t *gt)
 
wasm_externtype_t * wasm_tabletype_as_externtype (wasm_tabletype_t *tt)
 
wasm_externtype_t * wasm_memorytype_as_externtype (wasm_memorytype_t *mt)
 
const wasm_externtype_t * wasm_functype_as_externtype_const (const wasm_functype_t *ft)
 
const wasm_externtype_t * wasm_globaltype_as_externtype_const (const wasm_globaltype_t *gt)
 
const wasm_externtype_t * wasm_tabletype_as_externtype_const (const wasm_tabletype_t *tt)
 
const wasm_externtype_t * wasm_memorytype_as_externtype_const (const wasm_memorytype_t *mt)
 
wasm_functype_t * wasm_externtype_as_functype (wasm_externtype_t *et)
 
wasm_globaltype_t * wasm_externtype_as_globaltype (wasm_externtype_t *et)
 
wasm_tabletype_t * wasm_externtype_as_tabletype (wasm_externtype_t *et)
 
wasm_memorytype_t * wasm_externtype_as_memorytype (wasm_externtype_t *et)
 
const wasm_functype_t * wasm_externtype_as_functype_const (const wasm_externtype_t *et)
 
const wasm_globaltype_t * wasm_externtype_as_globaltype_const (const wasm_externtype_t *et)
 
const wasm_tabletype_t * wasm_externtype_as_tabletype_const (const wasm_externtype_t *et)
 
const wasm_memorytype_t * wasm_externtype_as_memorytype_const (const wasm_externtype_t *et)
 
wasm_importtype_t * wasm_importtype_new (wasm_name_t *module, wasm_name_t *name, wasm_externtype_t *type)
 
const wasm_name_t * wasm_importtype_module (const wasm_importtype_t *it)
 
const wasm_name_t * wasm_importtype_name (const wasm_importtype_t *it)
 
const wasm_externtype_t * wasm_importtype_type (const wasm_importtype_t *it)
 
wasm_exporttype_t * wasm_exporttype_new (wasm_name_t *name, wasm_externtype_t *type)
 
const wasm_name_t * wasm_exporttype_name (const wasm_exporttype_t *et)
 
const wasm_externtype_t * wasm_exporttype_type (const wasm_exporttype_t *et)
 
auto is_empty (wasm_val_t v) -> bool
 
auto hide_val (wasm::Val v) -> wasm_val_t
 
auto release_val (wasm::Val v) -> wasm_val_t
 
auto adopt_val (wasm_val_t v) -> wasm::Val
 
auto borrow_val (const wasm_val_t *v) -> borrowed_val
 
void wasm_val_vec_new (wasm_val_vec_t *out, size_t size, wasm_val_t const data[])
 
void wasm_val_vec_copy (wasm_val_vec_t *out, const wasm_val_vec_t *v)
 
void wasm_val_delete (wasm_val_t *v)
 
void wasm_val_copy (wasm_val_t *out, const wasm_val_t *v)
 
wasm_frame_t * wasm_frame_copy (const wasm_frame_t *frame)
 
wasm_instance_t * wasm_frame_instance (const wasm_frame_t *frame)
 
uint32_t wasm_frame_func_index (const wasm_frame_t *frame)
 
size_t wasm_frame_func_offset (const wasm_frame_t *frame)
 
size_t wasm_frame_module_offset (const wasm_frame_t *frame)
 
wasm_trap_t * wasm_trap_new (wasm_store_t *store, const wasm_message_t *message)
 
void wasm_trap_message (const wasm_trap_t *trap, wasm_message_t *out)
 
wasm_frame_t * wasm_trap_origin (const wasm_trap_t *trap)
 
void wasm_trap_trace (const wasm_trap_t *trap, wasm_frame_vec_t *out)
 
wasm_foreign_t * wasm_foreign_new (wasm_store_t *store)
 
bool wasm_module_validate (wasm_store_t *store, const wasm_byte_vec_t *binary)
 
wasm_module_t * wasm_module_new (wasm_store_t *store, const wasm_byte_vec_t *binary)
 
void wasm_module_imports (const wasm_module_t *module, wasm_importtype_vec_t *out)
 
void wasm_module_exports (const wasm_module_t *module, wasm_exporttype_vec_t *out)
 
void wasm_module_serialize (const wasm_module_t *module, wasm_byte_vec_t *out)
 
wasm_module_t * wasm_module_deserialize (wasm_store_t *store, const wasm_byte_vec_t *binary)
 
wasm_shared_module_t * wasm_module_share (const wasm_module_t *module)
 
wasm_module_t * wasm_module_obtain (wasm_store_t *store, const wasm_shared_module_t *shared)
 
auto wasm_callback (void *env, const wasm::vec< wasm::Val > &args, wasm::vec< wasm::Val > &results) -> wasm::own< wasm::Trap >
 
auto wasm_callback_with_env (void *env, const wasm::vec< wasm::Val > &args, wasm::vec< wasm::Val > &results) -> wasm::own< wasm::Trap >
 
void wasm_callback_env_finalizer (void *env)
 
wasm_func_t * wasm_func_new (wasm_store_t *store, const wasm_functype_t *type, wasm_func_callback_t callback)
 
wasm_func_t * wasm_func_new_with_env (wasm_store_t *store, const wasm_functype_t *type, wasm_func_callback_with_env_t callback, void *env, void(*finalizer)(void *))
 
wasm_functype_t * wasm_func_type (const wasm_func_t *func)
 
size_t wasm_func_param_arity (const wasm_func_t *func)
 
size_t wasm_func_result_arity (const wasm_func_t *func)
 
WASM_API_EXTERN wasm_trap_t * wasm_func_call (const wasm_func_t *func, const wasm_val_vec_t *args, wasm_val_vec_t *results)
 
wasm_global_t * wasm_global_new (wasm_store_t *store, const wasm_globaltype_t *type, const wasm_val_t *val)
 
wasm_globaltype_t * wasm_global_type (const wasm_global_t *global)
 
void wasm_global_get (const wasm_global_t *global, wasm_val_t *out)
 
void wasm_global_set (wasm_global_t *global, const wasm_val_t *val)
 
wasm_table_t * wasm_table_new (wasm_store_t *store, const wasm_tabletype_t *type, wasm_ref_t *ref)
 
wasm_tabletype_t * wasm_table_type (const wasm_table_t *table)
 
wasm_ref_t * wasm_table_get (const wasm_table_t *table, wasm_table_size_t index)
 
bool wasm_table_set (wasm_table_t *table, wasm_table_size_t index, wasm_ref_t *ref)
 
wasm_table_size_t wasm_table_size (const wasm_table_t *table)
 
bool wasm_table_grow (wasm_table_t *table, wasm_table_size_t delta, wasm_ref_t *ref)
 
wasm_memory_t * wasm_memory_new (wasm_store_t *store, const wasm_memorytype_t *type)
 
wasm_memorytype_t * wasm_memory_type (const wasm_memory_t *memory)
 
wasm_byte_t * wasm_memory_data (wasm_memory_t *memory)
 
size_t wasm_memory_data_size (const wasm_memory_t *memory)
 
wasm_memory_pages_t wasm_memory_size (const wasm_memory_t *memory)
 
bool wasm_memory_grow (wasm_memory_t *memory, wasm_memory_pages_t delta)
 
wasm_externkind_t wasm_extern_kind (const wasm_extern_t *external)
 
wasm_externtype_t * wasm_extern_type (const wasm_extern_t *external)
 
wasm_extern_t * wasm_func_as_extern (wasm_func_t *func)
 
wasm_extern_t * wasm_global_as_extern (wasm_global_t *global)
 
wasm_extern_t * wasm_table_as_extern (wasm_table_t *table)
 
wasm_extern_t * wasm_memory_as_extern (wasm_memory_t *memory)
 
const wasm_extern_t * wasm_func_as_extern_const (const wasm_func_t *func)
 
const wasm_extern_t * wasm_global_as_extern_const (const wasm_global_t *global)
 
const wasm_extern_t * wasm_table_as_extern_const (const wasm_table_t *table)
 
const wasm_extern_t * wasm_memory_as_extern_const (const wasm_memory_t *memory)
 
wasm_func_t * wasm_extern_as_func (wasm_extern_t *external)
 
wasm_global_t * wasm_extern_as_global (wasm_extern_t *external)
 
wasm_table_t * wasm_extern_as_table (wasm_extern_t *external)
 
wasm_memory_t * wasm_extern_as_memory (wasm_extern_t *external)
 
const wasm_func_t * wasm_extern_as_func_const (const wasm_extern_t *external)
 
const wasm_global_t * wasm_extern_as_global_const (const wasm_extern_t *external)
 
const wasm_table_t * wasm_extern_as_table_const (const wasm_extern_t *external)
 
const wasm_memory_t * wasm_extern_as_memory_const (const wasm_extern_t *external)
 
WASM_API_EXTERN wasm_instance_t * wasm_instance_new (wasm_store_t *store, const wasm_module_t *module, const wasm_extern_vec_t *imports, wasm_trap_t **trap)
 
void wasm_instance_exports (const wasm_instance_t *instance, wasm_extern_vec_t *out)
 

Variables

ValTypeImplwasm::valtype_i32 = new ValTypeImpl(ValKind::I32)
 
ValTypeImplwasm::valtype_i64 = new ValTypeImpl(ValKind::I64)
 
ValTypeImplwasm::valtype_f32 = new ValTypeImpl(ValKind::F32)
 
ValTypeImplwasm::valtype_f64 = new ValTypeImpl(ValKind::F64)
 
ValTypeImplwasm::valtype_externref = new ValTypeImpl(ValKind::EXTERNREF)
 
ValTypeImplwasm::valtype_funcref = new ValTypeImpl(ValKind::FUNCREF)
 

Macro Definition Documentation

◆ ASSERT_VEC_BASE_SIZE

#define ASSERT_VEC_BASE_SIZE ( name,
Name,
vec,
ptr_or_none )
Value:
static_assert(sizeof(wasm_##name##_vec_t) == sizeof(vec<Name>), \
"C/C++ incompatibility"); \
static_assert( \
sizeof(wasm_##name##_t ptr_or_none) == sizeof(vec<Name>::elem_type), \
"C/C++ incompatibility");

Definition at line 2538 of file c-api.cc.

◆ DUMP_COUNTERS

#define DUMP_COUNTERS   0

Definition at line 85 of file c-api.cc.

◆ WASM_DEFINE_OWN

#define WASM_DEFINE_OWN ( name,
Name )

Definition at line 2498 of file c-api.cc.

◆ WASM_DEFINE_REF

#define WASM_DEFINE_REF ( name,
Name )
Value:
WASM_DEFINE_REF_BASE(name, Name) \
\
wasm_ref_t* wasm_##name##_as_ref(wasm_##name##_t* r) { \
return hide_ref(static_cast<wasm::Ref*>(reveal_##name(r))); \
} \
wasm_##name##_t* wasm_ref_as_##name(wasm_ref_t* r) { \
return hide_##name(static_cast<Name*>(reveal_ref(r))); \
} \
\
const wasm_ref_t* wasm_##name##_as_ref_const(const wasm_##name##_t* r) { \
return hide_ref(static_cast<const wasm::Ref*>(reveal_##name(r))); \
} \
const wasm_##name##_t* wasm_ref_as_##name##_const(const wasm_ref_t* r) { \
return hide_##name(static_cast<const Name*>(reveal_ref(r))); \
}
const char * name
Definition builtins.cc:39
#define WASM_DEFINE_REF_BASE(name, Name)
Definition c-api.cc:2967
int r
Definition mul-fft.cc:298

Definition at line 2990 of file c-api.cc.

◆ WASM_DEFINE_REF_BASE

#define WASM_DEFINE_REF_BASE ( name,
Name )
Value:
WASM_DEFINE_OWN(name, Name) \
\
wasm_##name##_t* wasm_##name##_copy(const wasm_##name##_t* t) { \
return release_##name(t->copy()); \
} \
\
bool wasm_##name##_same(const wasm_##name##_t* t1, \
const wasm_##name##_t* t2) { \
return t1->same(t2); \
} \
\
void* wasm_##name##_get_host_info(const wasm_##name##_t* r) { \
return r->get_host_info(); \
} \
void wasm_##name##_set_host_info(wasm_##name##_t* r, void* info) { \
r->set_host_info(info); \
} \
void wasm_##name##_set_host_info_with_finalizer( \
wasm_##name##_t* r, void* info, void (*finalizer)(void*)) { \
r->set_host_info(info, finalizer); \
}
#define WASM_DEFINE_OWN(name, Name)
Definition c-api.cc:2498

Definition at line 2967 of file c-api.cc.

◆ WASM_DEFINE_SHARABLE_REF

#define WASM_DEFINE_SHARABLE_REF ( name,
Name )
Value:
WASM_DEFINE_REF(name, Name) \
WASM_DEFINE_OWN(shared_##name, wasm::Shared<Name>)
#define WASM_DEFINE_REF(name, Name)
Definition c-api.cc:2990
Tagged< SharedFunctionInfo > shared_
Definition debug.cc:1741

Definition at line 3007 of file c-api.cc.

◆ WASM_DEFINE_TYPE

#define WASM_DEFINE_TYPE ( name,
Name )
Value:
WASM_DEFINE_OWN(name, Name) \
WASM_DEFINE_VEC_OWN(name, Name) \
\
WASM_API_EXTERN wasm_##name##_t* wasm_##name##_copy( \
const wasm_##name##_t* t) { \
return release_##name(t->copy()); \
}

Definition at line 2743 of file c-api.cc.

◆ WASM_DEFINE_VEC_BASE

#define WASM_DEFINE_VEC_BASE ( name,
Name,
vec,
ptr_or_none )

Definition at line 2546 of file c-api.cc.

◆ WASM_DEFINE_VEC_OWN

#define WASM_DEFINE_VEC_OWN ( name,
Name )
Value:
WASM_DEFINE_VEC_BASE(name, Name, wasm::ownvec, *) \
\
void wasm_##name##_vec_new(wasm_##name##_vec_t* out, size_t size, \
wasm_##name##_t* const data[]) { \
auto v2 = wasm::ownvec<Name>::make_uninitialized(size); \
for (size_t i = 0; i < v2.size(); ++i) { \
v2[i] = adopt_##name(data[i]); \
} \
*out = release_##name##_vec(std::move(v2)); \
} \
\
WASM_API_EXTERN void wasm_##name##_vec_copy(wasm_##name##_vec_t* out, \
const wasm_##name##_vec_t* v) { \
auto v2 = wasm::ownvec<Name>::make_uninitialized(v->size); \
for (size_t i = 0; i < v2.size(); ++i) { \
v2[i] = adopt_##name(wasm_##name##_copy(v->data[i])); \
} \
*out = release_##name##_vec(std::move(v2)); \
}
#define WASM_DEFINE_VEC_BASE(name, Name, vec, ptr_or_none)
Definition c-api.cc:2546

Definition at line 2636 of file c-api.cc.

◆ WASM_DEFINE_VEC_PLAIN

#define WASM_DEFINE_VEC_PLAIN ( name,
Name )
Value:
WASM_DEFINE_VEC_BASE(name, Name, \
wasm::vec, ) /* NOLINT(whitespace/parens) */ \
\
void wasm_##name##_vec_new(wasm_##name##_vec_t* out, size_t size, \
const wasm_##name##_t data[]) { \
auto v2 = wasm::vec<Name>::make_uninitialized(size); \
if (v2.size() != 0) { \
memcpy(v2.get(), data, size * sizeof(wasm_##name##_t)); \
} \
*out = release_##name##_vec(std::move(v2)); \
} \
\
WASM_API_EXTERN void wasm_##name##_vec_copy(wasm_##name##_vec_t* out, \
const wasm_##name##_vec_t* v) { \
wasm_##name##_vec_new(out, v->size, v->data); \
}

Definition at line 2617 of file c-api.cc.

◆ WASM_EXPORT

#define WASM_EXPORT

Definition at line 70 of file c-api.cc.

Function Documentation

◆ adopt_val()

auto adopt_val ( wasm_val_t v) -> wasm::Val
inline

Definition at line 3071 of file c-api.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ borrow_val()

auto borrow_val ( const wasm_val_t * v) -> borrowed_val
inline

Definition at line 3098 of file c-api.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hide_externkind()

auto hide_externkind ( wasm::ExternKind kind) -> wasm_externkind_t
inline

Definition at line 2731 of file c-api.cc.

Here is the caller graph for this function:

◆ hide_limits()

auto hide_limits ( const wasm::Limits & limits) -> const wasm_limits_t*
inline

Definition at line 2714 of file c-api.cc.

Here is the caller graph for this function:

◆ hide_mutability()

auto hide_mutability ( wasm::Mutability mutability) -> wasm_mutability_t
inline

Definition at line 2704 of file c-api.cc.

Here is the caller graph for this function:

◆ hide_val()

auto hide_val ( wasm::Val v) -> wasm_val_t
inline

Definition at line 3021 of file c-api.cc.

Here is the call graph for this function:

◆ hide_valkind()

auto hide_valkind ( wasm::ValKind kind) -> wasm_valkind_t
inline

Definition at line 2723 of file c-api.cc.

Here is the caller graph for this function:

◆ is_empty() [1/2]

template<class T >
auto is_empty ( T * p) -> bool
inline

Definition at line 2659 of file c-api.cc.

◆ is_empty() [2/2]

auto is_empty ( wasm_val_t v) -> bool
inline

Definition at line 3017 of file c-api.cc.

Here is the call graph for this function:

◆ release_val()

auto release_val ( wasm::Val v) -> wasm_val_t
inline

Definition at line 3046 of file c-api.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reveal_externkind()

auto reveal_externkind ( wasm_externkind_t kind) -> wasm::ExternKind
inline

Definition at line 2736 of file c-api.cc.

◆ reveal_limits()

auto reveal_limits ( wasm_limits_t limits) -> wasm::Limits
inline

Definition at line 2719 of file c-api.cc.

Here is the caller graph for this function:

◆ reveal_mutability()

auto reveal_mutability ( wasm_mutability_t mutability) -> wasm::Mutability
inline

Definition at line 2709 of file c-api.cc.

Here is the caller graph for this function:

◆ reveal_valkind()

auto reveal_valkind ( wasm_valkind_t kind) -> wasm::ValKind
inline

Definition at line 2727 of file c-api.cc.

Here is the caller graph for this function:

◆ wasm_callback()

auto wasm_callback ( void * env,
const wasm::vec< wasm::Val > & args,
wasm::vec< wasm::Val > & results ) -> wasm::own<wasm::Trap>

Definition at line 3265 of file c-api.cc.

Here is the caller graph for this function:

◆ wasm_callback_env_finalizer()

void wasm_callback_env_finalizer ( void * env)

Definition at line 3285 of file c-api.cc.

Here is the caller graph for this function:

◆ wasm_callback_with_env()

auto wasm_callback_with_env ( void * env,
const wasm::vec< wasm::Val > & args,
wasm::vec< wasm::Val > & results ) -> wasm::own<wasm::Trap>

Definition at line 3277 of file c-api.cc.

Here is the caller graph for this function:

◆ wasm_config_new()

wasm_config_t * wasm_config_new ( )

Definition at line 2675 of file c-api.cc.

◆ wasm_engine_new()

wasm_engine_t * wasm_engine_new ( )

Definition at line 2683 of file c-api.cc.

◆ wasm_engine_new_with_config()

wasm_engine_t * wasm_engine_new_with_config ( wasm_config_t * config)

Definition at line 2687 of file c-api.cc.

◆ wasm_exporttype_name()

const wasm_name_t * wasm_exporttype_name ( const wasm_exporttype_t * et)

Definition at line 2954 of file c-api.cc.

◆ wasm_exporttype_new()

wasm_exporttype_t * wasm_exporttype_new ( wasm_name_t * name,
wasm_externtype_t * type )

Definition at line 2948 of file c-api.cc.

◆ wasm_exporttype_type()

const wasm_externtype_t * wasm_exporttype_type ( const wasm_exporttype_t * et)

Definition at line 2958 of file c-api.cc.

◆ wasm_extern_as_func()

wasm_func_t * wasm_extern_as_func ( wasm_extern_t * external)

Definition at line 3450 of file c-api.cc.

◆ wasm_extern_as_func_const()

const wasm_func_t * wasm_extern_as_func_const ( const wasm_extern_t * external)

Definition at line 3463 of file c-api.cc.

◆ wasm_extern_as_global()

wasm_global_t * wasm_extern_as_global ( wasm_extern_t * external)

Definition at line 3453 of file c-api.cc.

◆ wasm_extern_as_global_const()

const wasm_global_t * wasm_extern_as_global_const ( const wasm_extern_t * external)

Definition at line 3466 of file c-api.cc.

◆ wasm_extern_as_memory()

wasm_memory_t * wasm_extern_as_memory ( wasm_extern_t * external)

Definition at line 3459 of file c-api.cc.

◆ wasm_extern_as_memory_const()

const wasm_memory_t * wasm_extern_as_memory_const ( const wasm_extern_t * external)

Definition at line 3473 of file c-api.cc.

◆ wasm_extern_as_table()

wasm_table_t * wasm_extern_as_table ( wasm_extern_t * external)

Definition at line 3456 of file c-api.cc.

◆ wasm_extern_as_table_const()

const wasm_table_t * wasm_extern_as_table_const ( const wasm_extern_t * external)

Definition at line 3470 of file c-api.cc.

◆ wasm_extern_kind()

wasm_externkind_t wasm_extern_kind ( const wasm_extern_t * external)

Definition at line 3417 of file c-api.cc.

Here is the call graph for this function:

◆ wasm_extern_type()

wasm_externtype_t * wasm_extern_type ( const wasm_extern_t * external)

Definition at line 3420 of file c-api.cc.

◆ wasm_externtype_as_functype()

wasm_functype_t * wasm_externtype_as_functype ( wasm_externtype_t * et)

Definition at line 2868 of file c-api.cc.

◆ wasm_externtype_as_functype_const()

const wasm_functype_t * wasm_externtype_as_functype_const ( const wasm_externtype_t * et)

Definition at line 2893 of file c-api.cc.

◆ wasm_externtype_as_globaltype()

wasm_globaltype_t * wasm_externtype_as_globaltype ( wasm_externtype_t * et)

Definition at line 2874 of file c-api.cc.

◆ wasm_externtype_as_globaltype_const()

const wasm_globaltype_t * wasm_externtype_as_globaltype_const ( const wasm_externtype_t * et)

Definition at line 2900 of file c-api.cc.

◆ wasm_externtype_as_memorytype()

wasm_memorytype_t * wasm_externtype_as_memorytype ( wasm_externtype_t * et)

Definition at line 2886 of file c-api.cc.

◆ wasm_externtype_as_memorytype_const()

const wasm_memorytype_t * wasm_externtype_as_memorytype_const ( const wasm_externtype_t * et)

Definition at line 2914 of file c-api.cc.

◆ wasm_externtype_as_tabletype()

wasm_tabletype_t * wasm_externtype_as_tabletype ( wasm_externtype_t * et)

Definition at line 2880 of file c-api.cc.

◆ wasm_externtype_as_tabletype_const()

const wasm_tabletype_t * wasm_externtype_as_tabletype_const ( const wasm_externtype_t * et)

Definition at line 2907 of file c-api.cc.

◆ wasm_externtype_kind()

wasm_externkind_t wasm_externtype_kind ( const wasm_externtype_t * et)

Definition at line 2834 of file c-api.cc.

Here is the call graph for this function:

◆ wasm_foreign_new()

wasm_foreign_t * wasm_foreign_new ( wasm_store_t * store)

Definition at line 3211 of file c-api.cc.

◆ wasm_frame_copy()

wasm_frame_t * wasm_frame_copy ( const wasm_frame_t * frame)

Definition at line 3167 of file c-api.cc.

◆ wasm_frame_func_index()

uint32_t wasm_frame_func_index ( const wasm_frame_t * frame)

Definition at line 3174 of file c-api.cc.

◆ wasm_frame_func_offset()

size_t wasm_frame_func_offset ( const wasm_frame_t * frame)

Definition at line 3178 of file c-api.cc.

◆ wasm_frame_instance()

wasm_instance_t * wasm_frame_instance ( const wasm_frame_t * frame)

Definition at line 3509 of file c-api.cc.

◆ wasm_frame_module_offset()

size_t wasm_frame_module_offset ( const wasm_frame_t * frame)

Definition at line 3182 of file c-api.cc.

◆ wasm_func_as_extern()

wasm_extern_t * wasm_func_as_extern ( wasm_func_t * func)

Definition at line 3424 of file c-api.cc.

◆ wasm_func_as_extern_const()

const wasm_extern_t * wasm_func_as_extern_const ( const wasm_func_t * func)

Definition at line 3437 of file c-api.cc.

◆ wasm_func_call()

WASM_API_EXTERN wasm_trap_t * wasm_func_call ( const wasm_func_t * func,
const wasm_val_vec_t * args,
wasm_val_vec_t * results )

Definition at line 3320 of file c-api.cc.

◆ wasm_func_new()

wasm_func_t * wasm_func_new ( wasm_store_t * store,
const wasm_functype_t * type,
wasm_func_callback_t callback )

Definition at line 3293 of file c-api.cc.

Here is the call graph for this function:

◆ wasm_func_new_with_env()

wasm_func_t * wasm_func_new_with_env ( wasm_store_t * store,
const wasm_functype_t * type,
wasm_func_callback_with_env_t callback,
void * env,
void(* finalizer )(void *) )

Definition at line 3299 of file c-api.cc.

Here is the call graph for this function:

◆ wasm_func_param_arity()

size_t wasm_func_param_arity ( const wasm_func_t * func)

Definition at line 3312 of file c-api.cc.

◆ wasm_func_result_arity()

size_t wasm_func_result_arity ( const wasm_func_t * func)

Definition at line 3316 of file c-api.cc.

◆ wasm_func_type()

wasm_functype_t * wasm_func_type ( const wasm_func_t * func)

Definition at line 3308 of file c-api.cc.

◆ wasm_functype_as_externtype()

wasm_externtype_t * wasm_functype_as_externtype ( wasm_functype_t * ft)

Definition at line 2838 of file c-api.cc.

◆ wasm_functype_as_externtype_const()

const wasm_externtype_t * wasm_functype_as_externtype_const ( const wasm_functype_t * ft)

Definition at line 2851 of file c-api.cc.

◆ wasm_functype_new()

wasm_functype_t * wasm_functype_new ( wasm_valtype_vec_t * params,
wasm_valtype_vec_t * results )

Definition at line 2768 of file c-api.cc.

◆ wasm_functype_params()

const wasm_valtype_vec_t * wasm_functype_params ( const wasm_functype_t * ft)

Definition at line 2774 of file c-api.cc.

◆ wasm_functype_results()

const wasm_valtype_vec_t * wasm_functype_results ( const wasm_functype_t * ft)

Definition at line 2778 of file c-api.cc.

◆ wasm_global_as_extern()

wasm_extern_t * wasm_global_as_extern ( wasm_global_t * global)

Definition at line 3427 of file c-api.cc.

◆ wasm_global_as_extern_const()

const wasm_extern_t * wasm_global_as_extern_const ( const wasm_global_t * global)

Definition at line 3440 of file c-api.cc.

◆ wasm_global_get()

void wasm_global_get ( const wasm_global_t * global,
wasm_val_t * out )

Definition at line 3345 of file c-api.cc.

Here is the call graph for this function:

◆ wasm_global_new()

wasm_global_t * wasm_global_new ( wasm_store_t * store,
const wasm_globaltype_t * type,
const wasm_val_t * val )

Definition at line 3334 of file c-api.cc.

Here is the call graph for this function:

◆ wasm_global_set()

void wasm_global_set ( wasm_global_t * global,
const wasm_val_t * val )

Definition at line 3349 of file c-api.cc.

Here is the call graph for this function:

◆ wasm_global_type()

wasm_globaltype_t * wasm_global_type ( const wasm_global_t * global)

Definition at line 3341 of file c-api.cc.

◆ wasm_globaltype_as_externtype()

wasm_externtype_t * wasm_globaltype_as_externtype ( wasm_globaltype_t * gt)

Definition at line 2841 of file c-api.cc.

◆ wasm_globaltype_as_externtype_const()

const wasm_externtype_t * wasm_globaltype_as_externtype_const ( const wasm_globaltype_t * gt)

Definition at line 2855 of file c-api.cc.

◆ wasm_globaltype_content()

const wasm_valtype_t * wasm_globaltype_content ( const wasm_globaltype_t * gt)

Definition at line 2792 of file c-api.cc.

◆ wasm_globaltype_mutability()

wasm_mutability_t wasm_globaltype_mutability ( const wasm_globaltype_t * gt)

Definition at line 2796 of file c-api.cc.

Here is the call graph for this function:

◆ wasm_globaltype_new()

wasm_globaltype_t * wasm_globaltype_new ( wasm_valtype_t * content,
wasm_mutability_t mutability )

Definition at line 2786 of file c-api.cc.

Here is the call graph for this function:

◆ wasm_importtype_module()

const wasm_name_t * wasm_importtype_module ( const wasm_importtype_t * it)

Definition at line 2932 of file c-api.cc.

◆ wasm_importtype_name()

const wasm_name_t * wasm_importtype_name ( const wasm_importtype_t * it)

Definition at line 2936 of file c-api.cc.

◆ wasm_importtype_new()

wasm_importtype_t * wasm_importtype_new ( wasm_name_t * module,
wasm_name_t * name,
wasm_externtype_t * type )

Definition at line 2926 of file c-api.cc.

◆ wasm_importtype_type()

const wasm_externtype_t * wasm_importtype_type ( const wasm_importtype_t * it)

Definition at line 2940 of file c-api.cc.

◆ wasm_instance_exports()

void wasm_instance_exports ( const wasm_instance_t * instance,
wasm_extern_vec_t * out )

Definition at line 3504 of file c-api.cc.

◆ wasm_instance_new()

WASM_API_EXTERN wasm_instance_t * wasm_instance_new ( wasm_store_t * store,
const wasm_module_t * module,
const wasm_extern_vec_t * imports,
wasm_trap_t ** trap )

Definition at line 3482 of file c-api.cc.

◆ wasm_memory_as_extern()

wasm_extern_t * wasm_memory_as_extern ( wasm_memory_t * memory)

Definition at line 3433 of file c-api.cc.

◆ wasm_memory_as_extern_const()

const wasm_extern_t * wasm_memory_as_extern_const ( const wasm_memory_t * memory)

Definition at line 3446 of file c-api.cc.

◆ wasm_memory_data()

wasm_byte_t * wasm_memory_data ( wasm_memory_t * memory)

Definition at line 3398 of file c-api.cc.

◆ wasm_memory_data_size()

size_t wasm_memory_data_size ( const wasm_memory_t * memory)

Definition at line 3400 of file c-api.cc.

◆ wasm_memory_grow()

bool wasm_memory_grow ( wasm_memory_t * memory,
wasm_memory_pages_t delta )

Definition at line 3408 of file c-api.cc.

◆ wasm_memory_new()

wasm_memory_t * wasm_memory_new ( wasm_store_t * store,
const wasm_memorytype_t * type )

Definition at line 3389 of file c-api.cc.

◆ wasm_memory_size()

wasm_memory_pages_t wasm_memory_size ( const wasm_memory_t * memory)

Definition at line 3404 of file c-api.cc.

◆ wasm_memory_type()

wasm_memorytype_t * wasm_memory_type ( const wasm_memory_t * memory)

Definition at line 3394 of file c-api.cc.

◆ wasm_memorytype_as_externtype()

wasm_externtype_t * wasm_memorytype_as_externtype ( wasm_memorytype_t * mt)

Definition at line 2847 of file c-api.cc.

◆ wasm_memorytype_as_externtype_const()

const wasm_externtype_t * wasm_memorytype_as_externtype_const ( const wasm_memorytype_t * mt)

Definition at line 2863 of file c-api.cc.

◆ wasm_memorytype_limits()

const wasm_limits_t * wasm_memorytype_limits ( const wasm_memorytype_t * mt)

Definition at line 2826 of file c-api.cc.

Here is the call graph for this function:

◆ wasm_memorytype_new()

wasm_memorytype_t * wasm_memorytype_new ( const wasm_limits_t * limits)

Definition at line 2822 of file c-api.cc.

Here is the call graph for this function:

◆ wasm_module_deserialize()

wasm_module_t * wasm_module_deserialize ( wasm_store_t * store,
const wasm_byte_vec_t * binary )

Definition at line 3244 of file c-api.cc.

◆ wasm_module_exports()

void wasm_module_exports ( const wasm_module_t * module,
wasm_exporttype_vec_t * out )

Definition at line 3235 of file c-api.cc.

◆ wasm_module_imports()

void wasm_module_imports ( const wasm_module_t * module,
wasm_importtype_vec_t * out )

Definition at line 3230 of file c-api.cc.

◆ wasm_module_new()

wasm_module_t * wasm_module_new ( wasm_store_t * store,
const wasm_byte_vec_t * binary )

Definition at line 3224 of file c-api.cc.

◆ wasm_module_obtain()

wasm_module_t * wasm_module_obtain ( wasm_store_t * store,
const wasm_shared_module_t * shared )

Definition at line 3254 of file c-api.cc.

◆ wasm_module_serialize()

void wasm_module_serialize ( const wasm_module_t * module,
wasm_byte_vec_t * out )

Definition at line 3240 of file c-api.cc.

◆ wasm_module_share()

wasm_shared_module_t * wasm_module_share ( const wasm_module_t * module)

Definition at line 3250 of file c-api.cc.

◆ wasm_module_validate()

bool wasm_module_validate ( wasm_store_t * store,
const wasm_byte_vec_t * binary )

Definition at line 3219 of file c-api.cc.

◆ wasm_store_new()

wasm_store_t * wasm_store_new ( wasm_engine_t * engine)

Definition at line 2695 of file c-api.cc.

◆ wasm_table_as_extern()

wasm_extern_t * wasm_table_as_extern ( wasm_table_t * table)

Definition at line 3430 of file c-api.cc.

◆ wasm_table_as_extern_const()

const wasm_extern_t * wasm_table_as_extern_const ( const wasm_table_t * table)

Definition at line 3443 of file c-api.cc.

◆ wasm_table_get()

wasm_ref_t * wasm_table_get ( const wasm_table_t * table,
wasm_table_size_t index )

Definition at line 3367 of file c-api.cc.

◆ wasm_table_grow()

bool wasm_table_grow ( wasm_table_t * table,
wasm_table_size_t delta,
wasm_ref_t * ref )

Definition at line 3380 of file c-api.cc.

◆ wasm_table_new()

wasm_table_t * wasm_table_new ( wasm_store_t * store,
const wasm_tabletype_t * type,
wasm_ref_t * ref )

Definition at line 3358 of file c-api.cc.

◆ wasm_table_set()

bool wasm_table_set ( wasm_table_t * table,
wasm_table_size_t index,
wasm_ref_t * ref )

Definition at line 3371 of file c-api.cc.

◆ wasm_table_size()

wasm_table_size_t wasm_table_size ( const wasm_table_t * table)

Definition at line 3376 of file c-api.cc.

◆ wasm_table_type()

wasm_tabletype_t * wasm_table_type ( const wasm_table_t * table)

Definition at line 3363 of file c-api.cc.

◆ wasm_tabletype_as_externtype()

wasm_externtype_t * wasm_tabletype_as_externtype ( wasm_tabletype_t * tt)

Definition at line 2844 of file c-api.cc.

◆ wasm_tabletype_as_externtype_const()

const wasm_externtype_t * wasm_tabletype_as_externtype_const ( const wasm_tabletype_t * tt)

Definition at line 2859 of file c-api.cc.

◆ wasm_tabletype_element()

const wasm_valtype_t * wasm_tabletype_element ( const wasm_tabletype_t * tt)

Definition at line 2810 of file c-api.cc.

◆ wasm_tabletype_limits()

const wasm_limits_t * wasm_tabletype_limits ( const wasm_tabletype_t * tt)

Definition at line 2814 of file c-api.cc.

Here is the call graph for this function:

◆ wasm_tabletype_new()

wasm_tabletype_t * wasm_tabletype_new ( wasm_valtype_t * element,
const wasm_limits_t * limits )

Definition at line 2804 of file c-api.cc.

Here is the call graph for this function:

◆ wasm_trap_message()

void wasm_trap_message ( const wasm_trap_t * trap,
wasm_message_t * out )

Definition at line 3195 of file c-api.cc.

◆ wasm_trap_new()

wasm_trap_t * wasm_trap_new ( wasm_store_t * store,
const wasm_message_t * message )

Definition at line 3190 of file c-api.cc.

◆ wasm_trap_origin()

wasm_frame_t * wasm_trap_origin ( const wasm_trap_t * trap)

Definition at line 3199 of file c-api.cc.

◆ wasm_trap_trace()

void wasm_trap_trace ( const wasm_trap_t * trap,
wasm_frame_vec_t * out )

Definition at line 3203 of file c-api.cc.

◆ wasm_val_copy()

void wasm_val_copy ( wasm_val_t * out,
const wasm_val_t * v )

Definition at line 3152 of file c-api.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wasm_val_delete()

void wasm_val_delete ( wasm_val_t * v)

Definition at line 3146 of file c-api.cc.

Here is the call graph for this function:

◆ wasm_val_vec_copy()

void wasm_val_vec_copy ( wasm_val_vec_t * out,
const wasm_val_vec_t * v )

Definition at line 3136 of file c-api.cc.

Here is the call graph for this function:

◆ wasm_val_vec_new()

void wasm_val_vec_new ( wasm_val_vec_t * out,
size_t size,
wasm_val_t const data[] )

Definition at line 3127 of file c-api.cc.

Here is the call graph for this function:

◆ wasm_valtype_kind()

wasm_valkind_t wasm_valtype_kind ( const wasm_valtype_t * t)

Definition at line 2760 of file c-api.cc.

Here is the call graph for this function:

◆ wasm_valtype_new()

wasm_valtype_t * wasm_valtype_new ( wasm_valkind_t k)

Definition at line 2756 of file c-api.cc.

Here is the call graph for this function: