Add table type API support (#3515)

Add `wasm_runtime_get_export_table_inst` and `wasm_table_get_func_inst`,
and related wasm_table_type_get_xxx APIs.
This commit is contained in:
Benbuck Nason
2024-06-18 23:50:46 -07:00
committed by GitHub
parent 72f74b7b51
commit 3746534010
15 changed files with 590 additions and 245 deletions

View File

@ -104,6 +104,8 @@ typedef struct AOTFunctionInstance {
typedef struct AOTModuleInstanceExtra {
DefPointer(const uint32 *, stack_sizes);
WASMModuleInstanceExtraCommon common;
AOTFunctionInstance **functions;
uint32 function_count;
#if WASM_ENABLE_MULTI_MODULE != 0
bh_list sub_module_inst_list_head;
bh_list *sub_module_inst_list;
@ -507,6 +509,17 @@ aot_deinstantiate(AOTModuleInstance *module_inst, bool is_sub_inst);
AOTFunctionInstance *
aot_lookup_function(const AOTModuleInstance *module_inst, const char *name);
/**
* Get a function in the AOT module instance.
*
* @param module_inst the module instance
* @param func_idx the index of the function
*
* @return the function instance found
*/
AOTFunctionInstance *
aot_get_function_instance(AOTModuleInstance *module_inst, uint32_t func_idx);
/**
* Call the given AOT function of a AOT module instance with
* arguments.