mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-07-15 08:48:33 +00:00
cr suggestions
This commit is contained in:
parent
ba9402753d
commit
0d2074d27a
|
@ -914,7 +914,7 @@ memory_instantiate(AOTModuleInstance *module_inst, AOTModuleInstance *parent,
|
|||
bh_assert(max_memory_data_size <= MAX_LINEAR_MEMORY_SIZE);
|
||||
(void)max_memory_data_size;
|
||||
|
||||
/* TODO: memory64 use is_memory64 flag */
|
||||
/* TODO: memory64 uses is_memory64 flag */
|
||||
if (wasm_allocate_linear_memory(&p, is_shared_memory, false,
|
||||
num_bytes_per_page, init_page_count,
|
||||
max_page_count, &memory_data_size)
|
||||
|
|
|
@ -3732,7 +3732,8 @@ wasm_runtime_invoke_native_raw(WASMExecEnv *exec_env, void *func_ptr,
|
|||
case VALUE_TYPE_I64:
|
||||
#if WASM_ENABLE_MEMORY64 != 0
|
||||
{
|
||||
PUT_I64_TO_ADDR((uint32 *)argv, GET_I64_FROM_ADDR(argv_src));
|
||||
PUT_I64_TO_ADDR((uint32 *)argv_dst,
|
||||
GET_I64_FROM_ADDR(argv_src));
|
||||
argv_src += 2;
|
||||
arg_i64 = *argv_dst;
|
||||
if (signature) {
|
||||
|
|
|
@ -10785,6 +10785,16 @@ wasm_loader_prepare_bytecode(WASMModule *module, WASMFunction *func,
|
|||
#endif
|
||||
#if WASM_ENABLE_MEMORY64 != 0
|
||||
bool is_memory64 = false;
|
||||
/* TODO: multi-memories for now assuming the memory idx type is consistent
|
||||
* across multi-memories */
|
||||
if (module->import_memory_count > 0)
|
||||
is_memory64 = module->import_memories[0].u.memory.flags & MEMORY64_FLAG;
|
||||
else if (module->memory_count > 0)
|
||||
is_memory64 = module->memories[0].flags & MEMORY64_FLAG;
|
||||
|
||||
mem_offset_type = is_memory64 ? VALUE_TYPE_I64 : VALUE_TYPE_I32;
|
||||
#else
|
||||
mem_offset_type = VALUE_TYPE_I32;
|
||||
#endif
|
||||
|
||||
global_count = module->import_global_count + module->global_count;
|
||||
|
@ -10838,19 +10848,6 @@ re_scan:
|
|||
}
|
||||
#endif
|
||||
|
||||
#if WASM_ENABLE_MEMORY64 != 0
|
||||
/* TODO: multi-memories for now assuming the memory idx type is consistent
|
||||
* across multi-memories */
|
||||
if (module->import_memory_count > 0)
|
||||
is_memory64 = module->import_memories[0].u.memory.flags & MEMORY64_FLAG;
|
||||
else if (module->memory_count > 0)
|
||||
is_memory64 = module->memories[0].flags & MEMORY64_FLAG;
|
||||
|
||||
mem_offset_type = is_memory64 ? VALUE_TYPE_I64 : VALUE_TYPE_I32;
|
||||
#else
|
||||
mem_offset_type = VALUE_TYPE_I32;
|
||||
#endif
|
||||
|
||||
PUSH_CSP(LABEL_TYPE_FUNCTION, func_block_type, p);
|
||||
|
||||
while (p < p_end) {
|
||||
|
|
|
@ -5960,6 +5960,16 @@ wasm_loader_prepare_bytecode(WASMModule *module, WASMFunction *func,
|
|||
#endif
|
||||
#if WASM_ENABLE_MEMORY64 != 0
|
||||
bool is_memory64 = false;
|
||||
/* TODO: multi-memories for now assuming the memory idx type is consistent
|
||||
* across multi-memories */
|
||||
if (module->import_memory_count > 0)
|
||||
is_memory64 = module->import_memories[0].u.memory.flags & MEMORY64_FLAG;
|
||||
else if (module->memory_count > 0)
|
||||
is_memory64 = module->memories[0].flags & MEMORY64_FLAG;
|
||||
|
||||
mem_offset_type = is_memory64 ? VALUE_TYPE_I64 : VALUE_TYPE_I32;
|
||||
#else
|
||||
mem_offset_type = VALUE_TYPE_I32;
|
||||
#endif
|
||||
|
||||
global_count = module->import_global_count + module->global_count;
|
||||
|
@ -6001,19 +6011,6 @@ re_scan:
|
|||
}
|
||||
#endif
|
||||
|
||||
#if WASM_ENABLE_MEMORY64 != 0
|
||||
/* TODO: multi-memories for now assuming the memory idx type is consistent
|
||||
* across multi-memories */
|
||||
if (module->import_memory_count > 0)
|
||||
is_memory64 = module->import_memories[0].u.memory.flags & MEMORY64_FLAG;
|
||||
else if (module->memory_count > 0)
|
||||
is_memory64 = module->memories[0].flags & MEMORY64_FLAG;
|
||||
|
||||
mem_offset_type = is_memory64 ? VALUE_TYPE_I64 : VALUE_TYPE_I32;
|
||||
#else
|
||||
mem_offset_type = VALUE_TYPE_I32;
|
||||
#endif
|
||||
|
||||
PUSH_CSP(LABEL_TYPE_FUNCTION, func_block_type, p);
|
||||
|
||||
while (p < p_end) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user