@@ -1655,7 +1655,7 @@ wasm_trap_new_internal(WASMModuleInstanceCommon *inst_comm_rt,
1655
1655
1656
1656
#if WASM_ENABLE_AOT != 0
1657
1657
if (inst_comm_rt -> module_type == Wasm_Module_AoT ) {
1658
- trap -> frames = ((AOTModuleInstance * )inst_comm_rt )-> frames . ptr ;
1658
+ trap -> frames = ((AOTModuleInstance * )inst_comm_rt )-> frames ;
1659
1659
}
1660
1660
#endif
1661
1661
#endif /* WASM_ENABLE_DUMP_CALL_STACK != 0 */
@@ -2482,9 +2482,9 @@ wasm_func_new_internal(wasm_store_t *store, uint16 func_idx_rt,
2482
2482
#if WASM_ENABLE_INTERP != 0
2483
2483
if (inst_comm_rt -> module_type == Wasm_Module_Bytecode ) {
2484
2484
bh_assert (func_idx_rt
2485
- < ((WASMModuleInstance * )inst_comm_rt )-> function_count );
2485
+ < ((WASMModuleInstance * )inst_comm_rt )-> e -> function_count );
2486
2486
WASMFunctionInstance * func_interp =
2487
- ((WASMModuleInstance * )inst_comm_rt )-> functions + func_idx_rt ;
2487
+ ((WASMModuleInstance * )inst_comm_rt )-> e -> functions + func_idx_rt ;
2488
2488
type_rt = func_interp -> is_import_func
2489
2489
? func_interp -> u .func_import -> func_type
2490
2490
: func_interp -> u .func -> func_type ;
@@ -2496,7 +2496,7 @@ wasm_func_new_internal(wasm_store_t *store, uint16 func_idx_rt,
2496
2496
/* use same index to trace the function type in AOTFuncType **func_types
2497
2497
*/
2498
2498
AOTModule * module_aot =
2499
- (( AOTModuleInstance * )inst_comm_rt )-> aot_module . ptr ;
2499
+ (AOTModule * )(( AOTModuleInstance * )inst_comm_rt )-> module ;
2500
2500
if (func_idx_rt < module_aot -> import_func_count ) {
2501
2501
type_rt = (module_aot -> import_funcs + func_idx_rt )-> func_type ;
2502
2502
}
@@ -2748,7 +2748,7 @@ wasm_func_call(const wasm_func_t *func, const wasm_val_vec_t *params,
2748
2748
2749
2749
#if WASM_ENABLE_INTERP != 0
2750
2750
if (func -> inst_comm_rt -> module_type == Wasm_Module_Bytecode ) {
2751
- func_comm_rt = ((WASMModuleInstance * )func -> inst_comm_rt )-> functions
2751
+ func_comm_rt = ((WASMModuleInstance * )func -> inst_comm_rt )-> e -> functions
2752
2752
+ func -> func_idx_rt ;
2753
2753
}
2754
2754
#endif
@@ -2758,15 +2758,15 @@ wasm_func_call(const wasm_func_t *func, const wasm_val_vec_t *params,
2758
2758
if (!(func_comm_rt = func -> func_comm_rt )) {
2759
2759
AOTModuleInstance * inst_aot =
2760
2760
(AOTModuleInstance * )func -> inst_comm_rt ;
2761
- AOTModule * module_aot = (AOTModule * )inst_aot -> aot_module . ptr ;
2761
+ AOTModule * module_aot = (AOTModule * )inst_aot -> module ;
2762
2762
uint32 export_i = 0 , export_func_j = 0 ;
2763
2763
2764
2764
for (; export_i < module_aot -> export_count ; ++ export_i ) {
2765
2765
AOTExport * export = module_aot -> exports + export_i ;
2766
2766
if (export -> kind == EXPORT_KIND_FUNC ) {
2767
2767
if (export -> index == func -> func_idx_rt ) {
2768
2768
func_comm_rt =
2769
- (AOTFunctionInstance * )inst_aot -> export_funcs . ptr
2769
+ (AOTFunctionInstance * )inst_aot -> export_functions
2770
2770
+ export_func_j ;
2771
2771
((wasm_func_t * )func )-> func_comm_rt = func_comm_rt ;
2772
2772
break ;
@@ -2968,7 +2968,7 @@ interp_global_set(const WASMModuleInstance *inst_interp, uint16 global_idx_rt,
2968
2968
const wasm_val_t * v )
2969
2969
{
2970
2970
const WASMGlobalInstance * global_interp =
2971
- inst_interp -> globals + global_idx_rt ;
2971
+ inst_interp -> e -> globals + global_idx_rt ;
2972
2972
uint8 val_type_rt = global_interp -> type ;
2973
2973
#if WASM_ENABLE_MULTI_MODULE != 0
2974
2974
uint8 * data = global_interp -> import_global_inst
@@ -2987,7 +2987,7 @@ static bool
2987
2987
interp_global_get (const WASMModuleInstance * inst_interp , uint16 global_idx_rt ,
2988
2988
wasm_val_t * out )
2989
2989
{
2990
- WASMGlobalInstance * global_interp = inst_interp -> globals + global_idx_rt ;
2990
+ WASMGlobalInstance * global_interp = inst_interp -> e -> globals + global_idx_rt ;
2991
2991
uint8 val_type_rt = global_interp -> type ;
2992
2992
#if WASM_ENABLE_MULTI_MODULE != 0
2993
2993
uint8 * data = global_interp -> import_global_inst
@@ -3007,7 +3007,7 @@ static bool
3007
3007
aot_global_set (const AOTModuleInstance * inst_aot , uint16 global_idx_rt ,
3008
3008
const wasm_val_t * v )
3009
3009
{
3010
- AOTModule * module_aot = inst_aot -> aot_module . ptr ;
3010
+ AOTModule * module_aot = ( AOTModule * ) inst_aot -> module ;
3011
3011
uint8 val_type_rt = 0 ;
3012
3012
uint32 data_offset = 0 ;
3013
3013
void * data = NULL ;
@@ -3025,7 +3025,7 @@ aot_global_set(const AOTModuleInstance *inst_aot, uint16 global_idx_rt,
3025
3025
.type ;
3026
3026
}
3027
3027
3028
- data = (void * )(( uint8 * ) inst_aot -> global_data . ptr + data_offset );
3028
+ data = (void * )(inst_aot -> global_data + data_offset );
3029
3029
return wasm_val_to_rt_val ((WASMModuleInstanceCommon * )inst_aot , val_type_rt ,
3030
3030
v , data );
3031
3031
}
@@ -3034,7 +3034,7 @@ static bool
3034
3034
aot_global_get (const AOTModuleInstance * inst_aot , uint16 global_idx_rt ,
3035
3035
wasm_val_t * out )
3036
3036
{
3037
- AOTModule * module_aot = inst_aot -> aot_module . ptr ;
3037
+ AOTModule * module_aot = ( AOTModule * ) inst_aot -> module ;
3038
3038
uint8 val_type_rt = 0 ;
3039
3039
uint32 data_offset = 0 ;
3040
3040
uint8 * data = NULL ;
@@ -3052,7 +3052,7 @@ aot_global_get(const AOTModuleInstance *inst_aot, uint16 global_idx_rt,
3052
3052
.type ;
3053
3053
}
3054
3054
3055
- data = ( uint8 * ) inst_aot -> global_data . ptr + data_offset ;
3055
+ data = inst_aot -> global_data + data_offset ;
3056
3056
return rt_val_to_wasm_val (data , val_type_rt , out );
3057
3057
}
3058
3058
#endif
@@ -3149,7 +3149,7 @@ wasm_global_new_internal(wasm_store_t *store, uint16 global_idx_rt,
3149
3149
#if WASM_ENABLE_INTERP != 0
3150
3150
if (inst_comm_rt -> module_type == Wasm_Module_Bytecode ) {
3151
3151
WASMGlobalInstance * global_interp =
3152
- ((WASMModuleInstance * )inst_comm_rt )-> globals + global_idx_rt ;
3152
+ ((WASMModuleInstance * )inst_comm_rt )-> e -> globals + global_idx_rt ;
3153
3153
val_type_rt = global_interp -> type ;
3154
3154
is_mutable = global_interp -> is_mutable ;
3155
3155
init = true;
@@ -3159,7 +3159,7 @@ wasm_global_new_internal(wasm_store_t *store, uint16 global_idx_rt,
3159
3159
#if WASM_ENABLE_AOT != 0
3160
3160
if (inst_comm_rt -> module_type == Wasm_Module_AoT ) {
3161
3161
AOTModuleInstance * inst_aot = (AOTModuleInstance * )inst_comm_rt ;
3162
- AOTModule * module_aot = inst_aot -> aot_module . ptr ;
3162
+ AOTModule * module_aot = ( AOTModule * ) inst_aot -> module ;
3163
3163
3164
3164
init = true;
3165
3165
@@ -3365,19 +3365,19 @@ wasm_table_get(const wasm_table_t *table, wasm_table_size_t index)
3365
3365
if (index >= table_interp -> cur_size ) {
3366
3366
return NULL ;
3367
3367
}
3368
- ref_idx = (( uint32 * ) table_interp -> base_addr ) [index ];
3368
+ ref_idx = table_interp -> elems [index ];
3369
3369
}
3370
3370
#endif
3371
3371
3372
3372
#if WASM_ENABLE_AOT != 0
3373
3373
if (table -> inst_comm_rt -> module_type == Wasm_Module_AoT ) {
3374
3374
AOTModuleInstance * inst_aot = (AOTModuleInstance * )table -> inst_comm_rt ;
3375
3375
AOTTableInstance * table_aot =
3376
- (AOTTableInstance * )inst_aot -> tables . ptr + table -> table_idx_rt ;
3376
+ (AOTTableInstance * )inst_aot -> tables + table -> table_idx_rt ;
3377
3377
if (index >= table_aot -> cur_size ) {
3378
3378
return NULL ;
3379
3379
}
3380
- ref_idx = table_aot -> data [index ];
3380
+ ref_idx = table_aot -> elems [index ];
3381
3381
}
3382
3382
#endif
3383
3383
@@ -3437,24 +3437,24 @@ wasm_table_set(wasm_table_t *table, wasm_table_size_t index,
3437
3437
return false;
3438
3438
}
3439
3439
3440
- p_ref_idx = (( uint32 * ) table_interp -> base_addr ) + index ;
3440
+ p_ref_idx = table_interp -> elems + index ;
3441
3441
function_count =
3442
- ((WASMModuleInstance * )table -> inst_comm_rt )-> function_count ;
3442
+ ((WASMModuleInstance * )table -> inst_comm_rt )-> e -> function_count ;
3443
3443
}
3444
3444
#endif
3445
3445
3446
3446
#if WASM_ENABLE_AOT != 0
3447
3447
if (table -> inst_comm_rt -> module_type == Wasm_Module_AoT ) {
3448
3448
AOTModuleInstance * inst_aot = (AOTModuleInstance * )table -> inst_comm_rt ;
3449
- AOTModule * module_aot = (AOTModule * )inst_aot -> aot_module . ptr ;
3449
+ AOTModule * module_aot = (AOTModule * )inst_aot -> module ;
3450
3450
AOTTableInstance * table_aot =
3451
- (AOTTableInstance * )inst_aot -> tables . ptr + table -> table_idx_rt ;
3451
+ (AOTTableInstance * )inst_aot -> tables + table -> table_idx_rt ;
3452
3452
3453
3453
if (index >= table_aot -> cur_size ) {
3454
3454
return false;
3455
3455
}
3456
3456
3457
- p_ref_idx = table_aot -> data + index ;
3457
+ p_ref_idx = table_aot -> elems + index ;
3458
3458
function_count = module_aot -> func_count ;
3459
3459
}
3460
3460
#endif
@@ -3510,7 +3510,7 @@ wasm_table_size(const wasm_table_t *table)
3510
3510
#if WASM_ENABLE_AOT != 0
3511
3511
if (table -> inst_comm_rt -> module_type == Wasm_Module_AoT ) {
3512
3512
AOTModuleInstance * inst_aot = (AOTModuleInstance * )table -> inst_comm_rt ;
3513
- AOTModule * module_aot = (AOTModule * )inst_aot -> aot_module . ptr ;
3513
+ AOTModule * module_aot = (AOTModule * )inst_aot -> module ;
3514
3514
3515
3515
if (table -> table_idx_rt < module_aot -> import_table_count ) {
3516
3516
AOTImportTable * table_aot =
@@ -3625,7 +3625,7 @@ wasm_memory_new_internal(wasm_store_t *store, uint16 memory_idx_rt,
3625
3625
#if WASM_ENABLE_AOT != 0
3626
3626
if (inst_comm_rt -> module_type == Wasm_Module_AoT ) {
3627
3627
AOTModuleInstance * inst_aot = (AOTModuleInstance * )inst_comm_rt ;
3628
- AOTModule * module_aot = (AOTModule * )( inst_aot -> aot_module . ptr ) ;
3628
+ AOTModule * module_aot = (AOTModule * )inst_aot -> module ;
3629
3629
3630
3630
if (memory_idx_rt < module_aot -> import_memory_count ) {
3631
3631
min_pages = module_aot -> import_memories -> mem_init_page_count ;
@@ -3709,8 +3709,8 @@ wasm_memory_data(wasm_memory_t *memory)
3709
3709
AOTModuleInstance * module_inst = (AOTModuleInstance * )module_inst_comm ;
3710
3710
AOTMemoryInstance * memory_inst =
3711
3711
((AOTMemoryInstance * * )
3712
- module_inst -> memories . ptr )[memory -> memory_idx_rt ];
3713
- return (byte_t * )memory_inst -> memory_data . ptr ;
3712
+ module_inst -> memories )[memory -> memory_idx_rt ];
3713
+ return (byte_t * )memory_inst -> memory_data ;
3714
3714
}
3715
3715
#endif
3716
3716
@@ -3746,7 +3746,7 @@ wasm_memory_data_size(const wasm_memory_t *memory)
3746
3746
AOTModuleInstance * module_inst = (AOTModuleInstance * )module_inst_comm ;
3747
3747
AOTMemoryInstance * memory_inst =
3748
3748
((AOTMemoryInstance * * )
3749
- module_inst -> memories . ptr )[memory -> memory_idx_rt ];
3749
+ module_inst -> memories )[memory -> memory_idx_rt ];
3750
3750
return memory_inst -> cur_page_count * memory_inst -> num_bytes_per_page ;
3751
3751
}
3752
3752
#endif
@@ -3783,7 +3783,7 @@ wasm_memory_size(const wasm_memory_t *memory)
3783
3783
AOTModuleInstance * module_inst = (AOTModuleInstance * )module_inst_comm ;
3784
3784
AOTMemoryInstance * memory_inst =
3785
3785
((AOTMemoryInstance * * )
3786
- module_inst -> memories . ptr )[memory -> memory_idx_rt ];
3786
+ module_inst -> memories )[memory -> memory_idx_rt ];
3787
3787
return memory_inst -> cur_page_count ;
3788
3788
}
3789
3789
#endif
@@ -4162,7 +4162,7 @@ aot_process_export(wasm_store_t *store, const AOTModuleInstance *inst_aot,
4162
4162
4163
4163
bh_assert (store && inst_aot && externals );
4164
4164
4165
- module_aot = (AOTModule * )inst_aot -> aot_module . ptr ;
4165
+ module_aot = (AOTModule * )inst_aot -> module ;
4166
4166
bh_assert (module_aot );
4167
4167
4168
4168
for (i = 0 ; i < module_aot -> export_count ; ++ i ) {
0 commit comments