diff --git a/runtime-library/stdlib/lib_array.c b/runtime-library/stdlib/lib_array.c index 131ed41d..32e86dcb 100644 --- a/runtime-library/stdlib/lib_array.c +++ b/runtime-library/stdlib/lib_array.c @@ -160,7 +160,7 @@ array_concat_generic(wasm_exec_env_t exec_env, void *ctx, void *obj, return NULL; } - wasm_runtime_push_local_object_ref(exec_env, &local_ref); + wasm_runtime_push_local_obj_ref(exec_env, &local_ref); local_ref.val = (wasm_obj_t)new_arr; create_new_array = true; @@ -183,7 +183,7 @@ array_concat_generic(wasm_exec_env_t exec_env, void *ctx, void *obj, fail: if (create_new_array) { - wasm_runtime_pop_local_object_ref(exec_env); + wasm_runtime_pop_local_obj_ref(exec_env); } return new_arr_struct; @@ -305,7 +305,7 @@ array_slice_generic(wasm_exec_env_t exec_env, void *ctx, void *obj, return NULL; } - wasm_runtime_push_local_object_ref(exec_env, &local_ref); + wasm_runtime_push_local_obj_ref(exec_env, &local_ref); local_ref.val = (wasm_obj_t)new_arr; for (i = start; i < end; i++) { @@ -326,7 +326,7 @@ array_slice_generic(wasm_exec_env_t exec_env, void *ctx, void *obj, wasm_struct_obj_set_field(new_arr_struct, 1, &tmp_val); end: - wasm_runtime_pop_local_object_ref(exec_env); + wasm_runtime_pop_local_obj_ref(exec_env); return new_arr_struct; } @@ -500,7 +500,7 @@ array_splice_generic(wasm_exec_env_t exec_env, void *ctx, void *obj, goto end1; } - wasm_runtime_push_local_object_ref(exec_env, &local_ref); + wasm_runtime_push_local_obj_ref(exec_env, &local_ref); local_ref.val = (wasm_obj_t)delete_arr; /* Copy deleted elements to delete_arr*/ @@ -551,7 +551,7 @@ array_splice_generic(wasm_exec_env_t exec_env, void *ctx, void *obj, tmp_val.u32 = delete_count; wasm_struct_obj_set_field(new_arr_struct, 1, &tmp_val); - wasm_runtime_pop_local_object_ref(exec_env); + wasm_runtime_pop_local_obj_ref(exec_env); return new_arr_struct; end1: @@ -560,7 +560,7 @@ array_splice_generic(wasm_exec_env_t exec_env, void *ctx, void *obj, return NULL; end2: - wasm_runtime_pop_local_object_ref(exec_env); + wasm_runtime_pop_local_obj_ref(exec_env); wasm_runtime_set_exception(wasm_runtime_get_module_inst(exec_env), "alloc memory failed"); return NULL; @@ -1059,7 +1059,7 @@ array_map_generic(wasm_exec_env_t exec_env, void *ctx, void *obj, void *closure) "alloc memory failed"); return NULL; } - wasm_runtime_push_local_object_ref(exec_env, &local_ref); + wasm_runtime_push_local_obj_ref(exec_env, &local_ref); local_ref.val = (wasm_obj_t)new_arr; /* get current array element type */ @@ -1110,7 +1110,7 @@ array_map_generic(wasm_exec_env_t exec_env, void *ctx, void *obj, void *closure) wasm_struct_obj_set_field(new_arr_struct, 1, &tmp_val); end: - wasm_runtime_pop_local_object_ref(exec_env); + wasm_runtime_pop_local_obj_ref(exec_env); return new_arr_struct; } @@ -1190,7 +1190,7 @@ array_filter_generic(wasm_exec_env_t exec_env, void *ctx, void *obj, "alloc memory failed"); goto end1; } - wasm_runtime_push_local_object_ref(exec_env, &local_ref); + wasm_runtime_push_local_obj_ref(exec_env, &local_ref); local_ref.val = (wasm_obj_t)new_arr; for (i = 0; i < new_arr_len; i++) { @@ -1211,7 +1211,7 @@ array_filter_generic(wasm_exec_env_t exec_env, void *ctx, void *obj, wasm_struct_obj_set_field(new_arr_struct, 1, &tmp_val); end2: - wasm_runtime_pop_local_object_ref(exec_env); + wasm_runtime_pop_local_obj_ref(exec_env); end1: if (include_refs) { diff --git a/runtime-library/utils/object_utils.c b/runtime-library/utils/object_utils.c index 763e6010..85941d69 100644 --- a/runtime-library/utils/object_utils.c +++ b/runtime-library/utils/object_utils.c @@ -442,7 +442,7 @@ call_wasm_func_with_boxing(wasm_exec_env_t exec_env, dyn_ctx_t ctx, ) { /* unbox_value_from_any will create anyref for any-objects, we must * hold its reference to avoid it being claimed */ - wasm_runtime_push_local_object_ref(exec_env, + wasm_runtime_push_local_obj_ref(exec_env, &local_refs[local_ref_count]); local_refs[local_ref_count++].val = tmp_param.gc_obj; } @@ -454,7 +454,7 @@ call_wasm_func_with_boxing(wasm_exec_env_t exec_env, dyn_ctx_t ctx, } if (local_ref_count) { - wasm_runtime_pop_local_object_refs(exec_env, local_ref_count); + wasm_runtime_pop_local_obj_refs(exec_env, local_ref_count); } is_success = diff --git a/runtime-library/utils/type_utils.c b/runtime-library/utils/type_utils.c index 3f27db54..4624684c 100644 --- a/runtime-library/utils/type_utils.c +++ b/runtime-library/utils/type_utils.c @@ -352,7 +352,7 @@ create_wasm_array_with_string(wasm_exec_env_t exec_env, void **ptr, } /* Push object to local ref to avoid being freed at next allocation */ - wasm_runtime_push_local_object_ref(exec_env, &local_ref); + wasm_runtime_push_local_obj_ref(exec_env, &local_ref); local_ref.val = (wasm_obj_t)new_arr; /* create_wasm_string for every element */ @@ -367,7 +367,7 @@ create_wasm_array_with_string(wasm_exec_env_t exec_env, void **ptr, wasm_struct_obj_new_with_type(exec_env, res_arr_struct_type); if (!new_stringref_array_struct) { - wasm_runtime_pop_local_object_ref(exec_env); + wasm_runtime_pop_local_obj_ref(exec_env); wasm_runtime_set_exception(wasm_runtime_get_module_inst(exec_env), "alloc memory failed"); return NULL; @@ -379,7 +379,7 @@ create_wasm_array_with_string(wasm_exec_env_t exec_env, void **ptr, val.u32 = arrlen; wasm_struct_obj_set_field(new_stringref_array_struct, 1, &val); - wasm_runtime_pop_local_object_ref(exec_env); + wasm_runtime_pop_local_obj_ref(exec_env); return new_stringref_array_struct; } #else @@ -420,11 +420,11 @@ create_wasm_array_with_string(wasm_exec_env_t exec_env, void **ptr, /* create new array */ new_arr = wasm_array_obj_new_with_type(exec_env, res_arr_type, arrlen, &init); - wasm_runtime_push_local_object_ref(exec_env, &local_ref); + wasm_runtime_push_local_obj_ref(exec_env, &local_ref); local_ref.val = (wasm_obj_t)new_arr; if (!new_arr) { - wasm_runtime_pop_local_object_ref(exec_env); + wasm_runtime_pop_local_obj_ref(exec_env); wasm_runtime_set_exception((wasm_module_inst_t)module_inst, "alloc memory failed"); return NULL; @@ -452,7 +452,7 @@ create_wasm_array_with_string(wasm_exec_env_t exec_env, void **ptr, tmp_val.u32 = arrlen; wasm_struct_obj_set_field(string_array_struct, 1, &tmp_val); - wasm_runtime_pop_local_object_ref(exec_env); + wasm_runtime_pop_local_obj_ref(exec_env); return string_array_struct; } #endif /* end of WASM_ENABLE_STRINGREF != 0 */ @@ -672,7 +672,7 @@ create_wasm_string(wasm_exec_env_t exec_env, const char *value) } /* Push object to local ref to avoid being freed at next allocation */ - wasm_runtime_push_local_object_ref(exec_env, &local_ref); + wasm_runtime_push_local_obj_ref(exec_env, &local_ref); local_ref.val = (wasm_obj_t)new_string_struct; val.i32 = 0; @@ -680,7 +680,7 @@ create_wasm_string(wasm_exec_env_t exec_env, const char *value) new_arr = wasm_array_obj_new_with_type(exec_env, string_array_type, len, &val); if (!new_arr) { - wasm_runtime_pop_local_object_ref(exec_env); + wasm_runtime_pop_local_obj_ref(exec_env); wasm_runtime_set_exception(module_inst, "alloc memory failed"); return NULL; } @@ -697,7 +697,7 @@ create_wasm_string(wasm_exec_env_t exec_env, const char *value) val.gc_obj = (wasm_obj_t)new_arr; wasm_struct_obj_set_field(new_string_struct, 1, &val); - wasm_runtime_pop_local_object_ref(exec_env); + wasm_runtime_pop_local_obj_ref(exec_env); (void)p_end; return new_string_struct; @@ -748,16 +748,16 @@ create_new_array_with_primitive_type(wasm_exec_env_t exec_env, /* create new array */ new_arr = wasm_array_obj_new_with_type(exec_env, res_arr_type, arrlen, &init); - wasm_runtime_push_local_object_ref(exec_env, &local_ref); + wasm_runtime_push_local_obj_ref(exec_env, &local_ref); local_ref.val = (wasm_obj_t)new_arr; if (!new_arr) { - wasm_runtime_pop_local_object_ref(exec_env); + wasm_runtime_pop_local_obj_ref(exec_env); wasm_runtime_set_exception((wasm_module_inst_t)module_inst, "alloc memory failed"); return NULL; } - wasm_runtime_pop_local_object_ref(exec_env); + wasm_runtime_pop_local_obj_ref(exec_env); return new_arr; } @@ -1025,7 +1025,7 @@ array_to_string(wasm_exec_env_t exec_env, void *ctx, void *obj, void *separator) } /* Push object to local ref to avoid being freed at next allocation */ - wasm_runtime_push_local_object_ref(exec_env, &local_ref); + wasm_runtime_push_local_obj_ref(exec_env, &local_ref); local_ref.val = (wasm_obj_t)new_arr; p = (char *)wasm_array_obj_first_elem_addr(new_arr); @@ -1072,7 +1072,7 @@ array_to_string(wasm_exec_env_t exec_env, void *ctx, void *obj, void *separator) } if (local_ref.val) { - wasm_runtime_pop_local_object_ref(exec_env); + wasm_runtime_pop_local_obj_ref(exec_env); } if (sep) {