Skip to content

Commit c0ba0d5

Browse files
committed
style: simplify function names
Signed-off-by: ganjing <[email protected]>
1 parent c3dd378 commit c0ba0d5

File tree

3 files changed

+27
-27
lines changed

3 files changed

+27
-27
lines changed

runtime-library/stdlib/lib_array.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ array_concat_generic(wasm_exec_env_t exec_env, void *ctx, void *obj,
160160
return NULL;
161161
}
162162

163-
wasm_runtime_push_local_object_ref(exec_env, &local_ref);
163+
wasm_runtime_push_local_obj_ref(exec_env, &local_ref);
164164
local_ref.val = (wasm_obj_t)new_arr;
165165
create_new_array = true;
166166

@@ -183,7 +183,7 @@ array_concat_generic(wasm_exec_env_t exec_env, void *ctx, void *obj,
183183

184184
fail:
185185
if (create_new_array) {
186-
wasm_runtime_pop_local_object_ref(exec_env);
186+
wasm_runtime_pop_local_obj_ref(exec_env);
187187
}
188188

189189
return new_arr_struct;
@@ -305,7 +305,7 @@ array_slice_generic(wasm_exec_env_t exec_env, void *ctx, void *obj,
305305
return NULL;
306306
}
307307

308-
wasm_runtime_push_local_object_ref(exec_env, &local_ref);
308+
wasm_runtime_push_local_obj_ref(exec_env, &local_ref);
309309
local_ref.val = (wasm_obj_t)new_arr;
310310

311311
for (i = start; i < end; i++) {
@@ -326,7 +326,7 @@ array_slice_generic(wasm_exec_env_t exec_env, void *ctx, void *obj,
326326
wasm_struct_obj_set_field(new_arr_struct, 1, &tmp_val);
327327

328328
end:
329-
wasm_runtime_pop_local_object_ref(exec_env);
329+
wasm_runtime_pop_local_obj_ref(exec_env);
330330
return new_arr_struct;
331331
}
332332

@@ -500,7 +500,7 @@ array_splice_generic(wasm_exec_env_t exec_env, void *ctx, void *obj,
500500
goto end1;
501501
}
502502

503-
wasm_runtime_push_local_object_ref(exec_env, &local_ref);
503+
wasm_runtime_push_local_obj_ref(exec_env, &local_ref);
504504
local_ref.val = (wasm_obj_t)delete_arr;
505505

506506
/* Copy deleted elements to delete_arr*/
@@ -551,7 +551,7 @@ array_splice_generic(wasm_exec_env_t exec_env, void *ctx, void *obj,
551551
tmp_val.u32 = delete_count;
552552
wasm_struct_obj_set_field(new_arr_struct, 1, &tmp_val);
553553

554-
wasm_runtime_pop_local_object_ref(exec_env);
554+
wasm_runtime_pop_local_obj_ref(exec_env);
555555
return new_arr_struct;
556556

557557
end1:
@@ -560,7 +560,7 @@ array_splice_generic(wasm_exec_env_t exec_env, void *ctx, void *obj,
560560
return NULL;
561561

562562
end2:
563-
wasm_runtime_pop_local_object_ref(exec_env);
563+
wasm_runtime_pop_local_obj_ref(exec_env);
564564
wasm_runtime_set_exception(wasm_runtime_get_module_inst(exec_env),
565565
"alloc memory failed");
566566
return NULL;
@@ -1059,7 +1059,7 @@ array_map_generic(wasm_exec_env_t exec_env, void *ctx, void *obj, void *closure)
10591059
"alloc memory failed");
10601060
return NULL;
10611061
}
1062-
wasm_runtime_push_local_object_ref(exec_env, &local_ref);
1062+
wasm_runtime_push_local_obj_ref(exec_env, &local_ref);
10631063
local_ref.val = (wasm_obj_t)new_arr;
10641064

10651065
/* get current array element type */
@@ -1110,7 +1110,7 @@ array_map_generic(wasm_exec_env_t exec_env, void *ctx, void *obj, void *closure)
11101110
wasm_struct_obj_set_field(new_arr_struct, 1, &tmp_val);
11111111

11121112
end:
1113-
wasm_runtime_pop_local_object_ref(exec_env);
1113+
wasm_runtime_pop_local_obj_ref(exec_env);
11141114
return new_arr_struct;
11151115
}
11161116

@@ -1190,7 +1190,7 @@ array_filter_generic(wasm_exec_env_t exec_env, void *ctx, void *obj,
11901190
"alloc memory failed");
11911191
goto end1;
11921192
}
1193-
wasm_runtime_push_local_object_ref(exec_env, &local_ref);
1193+
wasm_runtime_push_local_obj_ref(exec_env, &local_ref);
11941194
local_ref.val = (wasm_obj_t)new_arr;
11951195

11961196
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,
12111211
wasm_struct_obj_set_field(new_arr_struct, 1, &tmp_val);
12121212

12131213
end2:
1214-
wasm_runtime_pop_local_object_ref(exec_env);
1214+
wasm_runtime_pop_local_obj_ref(exec_env);
12151215

12161216
end1:
12171217
if (include_refs) {

runtime-library/utils/object_utils.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ call_wasm_func_with_boxing(wasm_exec_env_t exec_env, dyn_ctx_t ctx,
442442
) {
443443
/* unbox_value_from_any will create anyref for any-objects, we must
444444
* hold its reference to avoid it being claimed */
445-
wasm_runtime_push_local_object_ref(exec_env,
445+
wasm_runtime_push_local_obj_ref(exec_env,
446446
&local_refs[local_ref_count]);
447447
local_refs[local_ref_count++].val = tmp_param.gc_obj;
448448
}
@@ -454,7 +454,7 @@ call_wasm_func_with_boxing(wasm_exec_env_t exec_env, dyn_ctx_t ctx,
454454
}
455455

456456
if (local_ref_count) {
457-
wasm_runtime_pop_local_object_refs(exec_env, local_ref_count);
457+
wasm_runtime_pop_local_obj_refs(exec_env, local_ref_count);
458458
}
459459

460460
is_success =

runtime-library/utils/type_utils.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ create_wasm_array_with_string(wasm_exec_env_t exec_env, void **ptr,
352352
}
353353

354354
/* Push object to local ref to avoid being freed at next allocation */
355-
wasm_runtime_push_local_object_ref(exec_env, &local_ref);
355+
wasm_runtime_push_local_obj_ref(exec_env, &local_ref);
356356
local_ref.val = (wasm_obj_t)new_arr;
357357

358358
/* create_wasm_string for every element */
@@ -367,7 +367,7 @@ create_wasm_array_with_string(wasm_exec_env_t exec_env, void **ptr,
367367
wasm_struct_obj_new_with_type(exec_env, res_arr_struct_type);
368368

369369
if (!new_stringref_array_struct) {
370-
wasm_runtime_pop_local_object_ref(exec_env);
370+
wasm_runtime_pop_local_obj_ref(exec_env);
371371
wasm_runtime_set_exception(wasm_runtime_get_module_inst(exec_env),
372372
"alloc memory failed");
373373
return NULL;
@@ -379,7 +379,7 @@ create_wasm_array_with_string(wasm_exec_env_t exec_env, void **ptr,
379379
val.u32 = arrlen;
380380
wasm_struct_obj_set_field(new_stringref_array_struct, 1, &val);
381381

382-
wasm_runtime_pop_local_object_ref(exec_env);
382+
wasm_runtime_pop_local_obj_ref(exec_env);
383383
return new_stringref_array_struct;
384384
}
385385
#else
@@ -420,11 +420,11 @@ create_wasm_array_with_string(wasm_exec_env_t exec_env, void **ptr,
420420
/* create new array */
421421
new_arr =
422422
wasm_array_obj_new_with_type(exec_env, res_arr_type, arrlen, &init);
423-
wasm_runtime_push_local_object_ref(exec_env, &local_ref);
423+
wasm_runtime_push_local_obj_ref(exec_env, &local_ref);
424424
local_ref.val = (wasm_obj_t)new_arr;
425425

426426
if (!new_arr) {
427-
wasm_runtime_pop_local_object_ref(exec_env);
427+
wasm_runtime_pop_local_obj_ref(exec_env);
428428
wasm_runtime_set_exception((wasm_module_inst_t)module_inst,
429429
"alloc memory failed");
430430
return NULL;
@@ -452,7 +452,7 @@ create_wasm_array_with_string(wasm_exec_env_t exec_env, void **ptr,
452452
tmp_val.u32 = arrlen;
453453
wasm_struct_obj_set_field(string_array_struct, 1, &tmp_val);
454454

455-
wasm_runtime_pop_local_object_ref(exec_env);
455+
wasm_runtime_pop_local_obj_ref(exec_env);
456456
return string_array_struct;
457457
}
458458
#endif /* end of WASM_ENABLE_STRINGREF != 0 */
@@ -672,15 +672,15 @@ create_wasm_string(wasm_exec_env_t exec_env, const char *value)
672672
}
673673

674674
/* Push object to local ref to avoid being freed at next allocation */
675-
wasm_runtime_push_local_object_ref(exec_env, &local_ref);
675+
wasm_runtime_push_local_obj_ref(exec_env, &local_ref);
676676
local_ref.val = (wasm_obj_t)new_string_struct;
677677

678678
val.i32 = 0;
679679
get_string_array_type(module, &string_array_type);
680680
new_arr =
681681
wasm_array_obj_new_with_type(exec_env, string_array_type, len, &val);
682682
if (!new_arr) {
683-
wasm_runtime_pop_local_object_ref(exec_env);
683+
wasm_runtime_pop_local_obj_ref(exec_env);
684684
wasm_runtime_set_exception(module_inst, "alloc memory failed");
685685
return NULL;
686686
}
@@ -697,7 +697,7 @@ create_wasm_string(wasm_exec_env_t exec_env, const char *value)
697697
val.gc_obj = (wasm_obj_t)new_arr;
698698
wasm_struct_obj_set_field(new_string_struct, 1, &val);
699699

700-
wasm_runtime_pop_local_object_ref(exec_env);
700+
wasm_runtime_pop_local_obj_ref(exec_env);
701701

702702
(void)p_end;
703703
return new_string_struct;
@@ -748,16 +748,16 @@ create_new_array_with_primitive_type(wasm_exec_env_t exec_env,
748748
/* create new array */
749749
new_arr =
750750
wasm_array_obj_new_with_type(exec_env, res_arr_type, arrlen, &init);
751-
wasm_runtime_push_local_object_ref(exec_env, &local_ref);
751+
wasm_runtime_push_local_obj_ref(exec_env, &local_ref);
752752
local_ref.val = (wasm_obj_t)new_arr;
753753

754754
if (!new_arr) {
755-
wasm_runtime_pop_local_object_ref(exec_env);
755+
wasm_runtime_pop_local_obj_ref(exec_env);
756756
wasm_runtime_set_exception((wasm_module_inst_t)module_inst,
757757
"alloc memory failed");
758758
return NULL;
759759
}
760-
wasm_runtime_pop_local_object_ref(exec_env);
760+
wasm_runtime_pop_local_obj_ref(exec_env);
761761
return new_arr;
762762
}
763763

@@ -1025,7 +1025,7 @@ array_to_string(wasm_exec_env_t exec_env, void *ctx, void *obj, void *separator)
10251025
}
10261026

10271027
/* Push object to local ref to avoid being freed at next allocation */
1028-
wasm_runtime_push_local_object_ref(exec_env, &local_ref);
1028+
wasm_runtime_push_local_obj_ref(exec_env, &local_ref);
10291029
local_ref.val = (wasm_obj_t)new_arr;
10301030

10311031
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)
10721072
}
10731073

10741074
if (local_ref.val) {
1075-
wasm_runtime_pop_local_object_ref(exec_env);
1075+
wasm_runtime_pop_local_obj_ref(exec_env);
10761076
}
10771077

10781078
if (sep) {

0 commit comments

Comments
 (0)