Introduce WASMModuleInstanceExtraCommon (#2429)

Move the common parts of WASMModuleInstanceExtra and
AOTModuleInstanceExtra into the new structure.
This commit is contained in:
YAMAMOTO Takashi
2023-08-08 10:35:29 +09:00
committed by GitHub
parent 81fbfbfcc0
commit 51714c41c0
9 changed files with 39 additions and 34 deletions

View File

@ -210,8 +210,19 @@ typedef struct CApiFuncImport {
void *env_arg;
} CApiFuncImport;
/* The common part of WASMModuleInstanceExtra and AOTModuleInstanceExtra */
typedef struct WASMModuleInstanceExtraCommon {
CApiFuncImport *c_api_func_imports;
#if WASM_CONFIGUABLE_BOUNDS_CHECKS != 0
/* Disable bounds checks or not */
bool disable_bounds_checks;
#endif
} WASMModuleInstanceExtraCommon;
/* Extra info of WASM module instance for interpreter/jit mode */
typedef struct WASMModuleInstanceExtra {
WASMModuleInstanceExtraCommon common;
WASMGlobalInstance *globals;
WASMFunctionInstance *functions;
@ -223,7 +234,6 @@ typedef struct WASMModuleInstanceExtra {
WASMFunctionInstance *free_function;
WASMFunctionInstance *retain_function;
CApiFuncImport *c_api_func_imports;
RunningMode running_mode;
#if WASM_ENABLE_MULTI_MODULE != 0
@ -242,10 +252,6 @@ typedef struct WASMModuleInstanceExtra {
&& WASM_ENABLE_LAZY_JIT != 0)
WASMModuleInstance *next;
#endif
#if WASM_CONFIGUABLE_BOUNDS_CHECKS != 0
/* Disable bounds checks or not */
bool disable_bounds_checks;
#endif
} WASMModuleInstanceExtra;
struct AOTFuncPerfProfInfo;