Support table64 extension in classic-interp and AOT running modes (#3811)
Add table64 extension(in Memory64 proposal) support in classic-interp and AOT running modes, currently still use uint32 to represent table's initial and maximum size to keep AOT ABI unchanged.
This commit is contained in:
@ -1382,6 +1382,12 @@ load_table_list(const uint8 **p_buf, const uint8 *buf_end, AOTModule *module,
|
||||
for (i = 0; i < module->table_count; i++, table++) {
|
||||
read_uint8(buf, buf_end, table->table_type.elem_type);
|
||||
read_uint8(buf, buf_end, table->table_type.flags);
|
||||
|
||||
if (!wasm_table_check_flags(table->table_type.flags, error_buf,
|
||||
error_buf_size, true)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
read_uint8(buf, buf_end, table->table_type.possible_grow);
|
||||
#if WASM_ENABLE_GC != 0
|
||||
if (wasm_is_type_multi_byte_type(table->table_type.elem_type)) {
|
||||
|
||||
@ -737,18 +737,24 @@ tables_instantiate(AOTModuleInstance *module_inst, AOTModule *module,
|
||||
|
||||
#if WASM_ENABLE_REF_TYPES != 0
|
||||
bh_assert(
|
||||
table_seg->offset.init_expr_type == INIT_EXPR_TYPE_I32_CONST
|
||||
table_seg->offset.init_expr_type
|
||||
== (tbl_inst->is_table64 ? INIT_EXPR_TYPE_I64_CONST
|
||||
: INIT_EXPR_TYPE_I32_CONST)
|
||||
|| table_seg->offset.init_expr_type == INIT_EXPR_TYPE_GET_GLOBAL
|
||||
|| table_seg->offset.init_expr_type == INIT_EXPR_TYPE_FUNCREF_CONST
|
||||
|| table_seg->offset.init_expr_type
|
||||
== INIT_EXPR_TYPE_REFNULL_CONST);
|
||||
#else
|
||||
bh_assert(table_seg->offset.init_expr_type == INIT_EXPR_TYPE_I32_CONST
|
||||
bh_assert(table_seg->offset.init_expr_type
|
||||
== (tbl_inst->is_table64 ? INIT_EXPR_TYPE_I64_CONST
|
||||
: INIT_EXPR_TYPE_I32_CONST)
|
||||
|| table_seg->offset.init_expr_type
|
||||
== INIT_EXPR_TYPE_GET_GLOBAL);
|
||||
#endif
|
||||
|
||||
/* Resolve table data base offset */
|
||||
/* TODO: The table64 current implementation assumes table max size
|
||||
* UINT32_MAX, so the offset conversion here is safe */
|
||||
if (table_seg->offset.init_expr_type == INIT_EXPR_TYPE_GET_GLOBAL) {
|
||||
global_index = table_seg->offset.u.global_index;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user