Enhance GC subtyping checks (#3317)
Enhance the GC subtyping checks: - Fix issues in the type equivalence check - Enable the recursive type subtyping check - Add a equivalence type flag in defined types of aot file, if there is an equivalence type before, just set it true and re-use the previous type - Normalize the defined types for interpreter and AOT - Enable spec test case type-equivalence.wast and type-subtyping.wast, and enable some commented cases - Enable set WAMR_BUILD_SANITIZER from cmake variable
This commit is contained in:
@ -4404,6 +4404,22 @@ llvm_jit_obj_is_instance_of(WASMModuleInstance *module_inst,
|
||||
return wasm_obj_is_instance_of(gc_obj, type_index, types, type_count);
|
||||
}
|
||||
|
||||
bool
|
||||
llvm_jit_func_type_is_super_of(WASMModuleInstance *module_inst,
|
||||
uint32 type_idx1, uint32 type_idx2)
|
||||
{
|
||||
WASMModule *module = module_inst->module;
|
||||
WASMType **types = module->types;
|
||||
|
||||
if (type_idx1 == type_idx2)
|
||||
return true;
|
||||
|
||||
bh_assert(types[type_idx1]->type_flag == WASM_TYPE_FUNC);
|
||||
bh_assert(types[type_idx2]->type_flag == WASM_TYPE_FUNC);
|
||||
return wasm_func_type_is_super_of((WASMFuncType *)types[type_idx1],
|
||||
(WASMFuncType *)types[type_idx2]);
|
||||
}
|
||||
|
||||
WASMRttTypeRef
|
||||
llvm_jit_rtt_type_new(WASMModuleInstance *module_inst, uint32 type_index)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user