WAMR User APIs
gc_export.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 Intel Corporation. All rights reserved.
3  * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4  */
5 
13 #ifndef _GC_EXPORT_H
14 #define _GC_EXPORT_H
15 
16 #include "wasm_export.h"
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
22 typedef uint8_t wasm_value_type_t;
23 
24 typedef enum wasm_value_type_enum {
25  VALUE_TYPE_I32 = 0x7F,
26  VALUE_TYPE_I64 = 0x7E,
27  VALUE_TYPE_F32 = 0x7D,
28  VALUE_TYPE_F64 = 0x7C,
29  VALUE_TYPE_V128 = 0x7B,
30  /* GC Types */
31  VALUE_TYPE_I8 = 0x78,
32  VALUE_TYPE_I16 = 0x77,
33  VALUE_TYPE_NULLFUNCREF = 0x73,
34  VALUE_TYPE_NULLEXTERNREF = 0x72,
35  VALUE_TYPE_NULLREF = 0x71,
36  VALUE_TYPE_FUNCREF = 0x70,
37  VALUE_TYPE_EXTERNREF = 0x6F,
38  VALUE_TYPE_ANYREF = 0x6E,
39  VALUE_TYPE_EQREF = 0x6D,
40  VALUE_TYPE_I31REF = 0x6C,
41  VALUE_TYPE_STRUCTREF = 0x6B,
42  VALUE_TYPE_ARRAYREF = 0x6A,
43  VALUE_TYPE_HT_NON_NULLABLE_REF = 0x64,
44  VALUE_TYPE_HT_NULLABLE_REF = 0x63,
45  /* Stringref Types */
46  VALUE_TYPE_STRINGREF = 0X67,
47  VALUE_TYPE_STRINGVIEWWTF8 = 0x66,
48  VALUE_TYPE_STRINGVIEWWTF16 = 0x62,
49  VALUE_TYPE_STRINGVIEWITER = 0x61
50 } wasm_value_type_enum;
51 
52 typedef int32_t wasm_heap_type_t;
53 
54 typedef enum wasm_heap_type_enum {
55  HEAP_TYPE_FUNC = -0x10,
56  HEAP_TYPE_EXTERN = -0x11,
57  HEAP_TYPE_ANY = -0x12,
58  HEAP_TYPE_EQ = -0x13,
59  HEAP_TYPE_I31 = -0x16,
60  HEAP_TYPE_NOFUNC = -0x17,
61  HEAP_TYPE_NOEXTERN = -0x18,
62  HEAP_TYPE_STRUCT = -0x19,
63  HEAP_TYPE_ARRAY = -0x1A,
64  HEAP_TYPE_NONE = -0x1B
65 } wasm_heap_type_enum;
66 
67 struct WASMObject;
68 typedef struct WASMObject *wasm_obj_t;
69 
70 #ifndef WASM_VALUE_DEFINED
71 #define WASM_VALUE_DEFINED
72 typedef union V128 {
73  int8_t i8x16[16];
74  int16_t i16x8[8];
75  int32_t i32x8[4];
76  int64_t i64x2[2];
77  float f32x4[4];
78  double f64x2[2];
79 } V128;
80 
81 typedef union WASMValue {
82  int32_t i32;
83  uint32_t u32;
84  uint32_t global_index;
85  uint32_t ref_index;
86  int64_t i64;
87  uint64_t u64;
88  float f32;
89  double f64;
90  V128 v128;
91  wasm_obj_t gc_obj;
92  uint32_t type_index;
93  struct {
94  uint32_t type_index;
95  uint32_t length;
96  } array_new_default;
97  /* pointer to a memory space holding more data, current usage:
98  * struct.new init value: WASMStructNewInitValues *
99  * array.new init value: WASMArrayNewInitValues *
100  */
101  void *data;
102 } WASMValue;
103 #endif /* end of WASM_VALUE_DEFINED */
104 
105 typedef union WASMValue wasm_value_t;
106 
107 /* Reference type, the layout is same as WasmRefType in wasm.h
108  * use wasm_ref_type_set_type_idx to initialize as concrete ref type
109  * use wasm_ref_type_set_heap_type to initialize as abstract ref type
110  */
111 typedef struct wasm_ref_type_t {
112  wasm_value_type_t value_type;
113  bool nullable;
114  int32_t heap_type;
116 
126 typedef struct WASMLocalObjectRef {
127  /* Previous local object reference variable on the stack */
128  struct WASMLocalObjectRef *prev;
129  /* The reference of WASM object hold by this variable */
130  wasm_obj_t val;
132 
133 struct WASMType;
134 struct WASMFuncType;
135 struct WASMStructType;
136 struct WASMArrayType;
137 
138 typedef struct WASMType *wasm_defined_type_t;
139 typedef struct WASMFuncType *wasm_func_type_t;
140 typedef struct WASMStructType *wasm_struct_type_t;
141 typedef struct WASMArrayType *wasm_array_type_t;
142 
143 struct WASMExternrefObject;
144 struct WASMAnyrefObject;
145 struct WASMStructObject;
146 struct WASMArrayObject;
147 struct WASMFuncObject;
148 
149 typedef struct WASMExternrefObject *wasm_externref_obj_t;
150 typedef struct WASMAnyrefObject *wasm_anyref_obj_t;
151 typedef struct WASMStructObject *wasm_struct_obj_t;
152 typedef struct WASMArrayObject *wasm_array_obj_t;
153 typedef struct WASMFuncObject *wasm_func_obj_t;
154 typedef struct WASMStringrefObject *wasm_stringref_obj_t;
155 typedef uintptr_t wasm_i31_obj_t;
156 
157 typedef void (*wasm_obj_finalizer_t)(const wasm_obj_t obj, void *data);
158 
159 /* Defined type related operations */
160 
168 WASM_RUNTIME_API_EXTERN uint32_t
169 wasm_get_defined_type_count(const wasm_module_t module);
170 
179 WASM_RUNTIME_API_EXTERN wasm_defined_type_t
180 wasm_get_defined_type(const wasm_module_t module, uint32_t index);
181 
190 WASM_RUNTIME_API_EXTERN wasm_defined_type_t
191 wasm_obj_get_defined_type(const wasm_obj_t obj);
192 
201 WASM_RUNTIME_API_EXTERN int32_t
202 wasm_obj_get_defined_type_idx(const wasm_module_t module, const wasm_obj_t obj);
203 
211 WASM_RUNTIME_API_EXTERN bool
212 wasm_defined_type_is_func_type(const wasm_defined_type_t def_type);
213 
221 WASM_RUNTIME_API_EXTERN bool
222 wasm_defined_type_is_struct_type(const wasm_defined_type_t def_type);
223 
231 WASM_RUNTIME_API_EXTERN bool
232 wasm_defined_type_is_array_type(const wasm_defined_type_t def_type);
233 
241 WASM_RUNTIME_API_EXTERN uint32_t
242 wasm_func_type_get_param_count(const wasm_func_type_t func_type);
243 
253 WASM_RUNTIME_API_EXTERN wasm_ref_type_t
254 wasm_func_type_get_param_type(const wasm_func_type_t func_type,
255  uint32_t param_idx);
256 
264 WASM_RUNTIME_API_EXTERN uint32_t
265 wasm_func_type_get_result_count(const wasm_func_type_t func_type);
266 
276 WASM_RUNTIME_API_EXTERN wasm_ref_type_t
277 wasm_func_type_get_result_type(const wasm_func_type_t func_type,
278  uint32_t result_idx);
279 
287 WASM_RUNTIME_API_EXTERN uint32_t
288 wasm_struct_type_get_field_count(const wasm_struct_type_t struct_type);
289 
299 WASM_RUNTIME_API_EXTERN wasm_ref_type_t
300 wasm_struct_type_get_field_type(const wasm_struct_type_t struct_type,
301  uint32_t field_idx, bool *p_is_mutable);
302 
311 WASM_RUNTIME_API_EXTERN wasm_ref_type_t
312 wasm_array_type_get_elem_type(const wasm_array_type_t array_type,
313  bool *p_is_mutable);
314 
325 WASM_RUNTIME_API_EXTERN bool
326 wasm_defined_type_equal(const wasm_defined_type_t def_type1,
327  const wasm_defined_type_t def_type2,
328  const wasm_module_t module);
329 
340 WASM_RUNTIME_API_EXTERN bool
341 wasm_defined_type_is_subtype_of(const wasm_defined_type_t def_type1,
342  const wasm_defined_type_t def_type2,
343  const wasm_module_t module);
344 
345 /* ref type related operations */
346 
354 WASM_RUNTIME_API_EXTERN void
355 wasm_ref_type_set_type_idx(wasm_ref_type_t *ref_type, bool nullable,
356  int32_t type_idx);
357 
365 WASM_RUNTIME_API_EXTERN void
366 wasm_ref_type_set_heap_type(wasm_ref_type_t *ref_type, bool nullable,
367  int32_t heap_type);
368 
379 WASM_RUNTIME_API_EXTERN bool
380 wasm_ref_type_equal(const wasm_ref_type_t *ref_type1,
381  const wasm_ref_type_t *ref_type2,
382  const wasm_module_t module);
383 
394 WASM_RUNTIME_API_EXTERN bool
396  const wasm_ref_type_t *ref_type2,
397  const wasm_module_t module);
398 
399 /* wasm object related operations */
400 
409 WASM_RUNTIME_API_EXTERN wasm_struct_obj_t
410 wasm_struct_obj_new_with_typeidx(wasm_exec_env_t exec_env, uint32_t type_idx);
411 
420 WASM_RUNTIME_API_EXTERN wasm_struct_obj_t
421 wasm_struct_obj_new_with_type(wasm_exec_env_t exec_env,
422  const wasm_struct_type_t type);
423 
431 WASM_RUNTIME_API_EXTERN void
432 wasm_struct_obj_set_field(wasm_struct_obj_t obj, uint32_t field_idx,
433  const wasm_value_t *value);
434 
443 WASM_RUNTIME_API_EXTERN void
444 wasm_struct_obj_get_field(const wasm_struct_obj_t obj, uint32_t field_idx,
445  bool sign_extend, wasm_value_t *value);
446 
454 WASM_RUNTIME_API_EXTERN uint32_t
455 wasm_struct_obj_get_field_count(const wasm_struct_obj_t obj);
456 
468 WASM_RUNTIME_API_EXTERN wasm_array_obj_t
469 wasm_array_obj_new_with_typeidx(wasm_exec_env_t exec_env, uint32_t type_idx,
470  uint32_t length, wasm_value_t *init_value);
471 
483 WASM_RUNTIME_API_EXTERN wasm_array_obj_t
484 wasm_array_obj_new_with_type(wasm_exec_env_t exec_env,
485  const wasm_array_type_t type, uint32_t length,
486  wasm_value_t *init_value);
487 
495 WASM_RUNTIME_API_EXTERN void
496 wasm_array_obj_set_elem(wasm_array_obj_t array_obj, uint32_t elem_idx,
497  const wasm_value_t *value);
498 
507 WASM_RUNTIME_API_EXTERN void
508 wasm_array_obj_get_elem(const wasm_array_obj_t array_obj, uint32_t elem_idx,
509  bool sign_extend, wasm_value_t *value);
510 
520 WASM_RUNTIME_API_EXTERN void
521 wasm_array_obj_copy(wasm_array_obj_t dst_obj, uint32_t dst_idx,
522  const wasm_array_obj_t src_obj, uint32_t src_idx,
523  uint32_t len);
524 
532 WASM_RUNTIME_API_EXTERN uint32_t
533 wasm_array_obj_length(const wasm_array_obj_t array_obj);
534 
542 WASM_RUNTIME_API_EXTERN void *
543 wasm_array_obj_first_elem_addr(const wasm_array_obj_t array_obj);
544 
553 WASM_RUNTIME_API_EXTERN void *
554 wasm_array_obj_elem_addr(const wasm_array_obj_t array_obj, uint32_t elem_idx);
555 
566 WASM_RUNTIME_API_EXTERN wasm_func_obj_t
567 wasm_func_obj_new_with_typeidx(wasm_exec_env_t exec_env, uint32_t type_idx,
568  uint32_t func_idx_bound);
569 
579 WASM_RUNTIME_API_EXTERN wasm_func_obj_t
580 wasm_func_obj_new_with_type(wasm_exec_env_t exec_env, wasm_func_type_t type,
581  uint32_t func_idx_bound);
582 
590 WASM_RUNTIME_API_EXTERN uint32_t
591 wasm_func_obj_get_func_idx_bound(const wasm_func_obj_t func_obj);
592 
600 WASM_RUNTIME_API_EXTERN wasm_func_type_t
601 wasm_func_obj_get_func_type(const wasm_func_obj_t func_obj);
602 
622 WASM_RUNTIME_API_EXTERN bool
623 wasm_runtime_call_func_ref(wasm_exec_env_t exec_env,
624  const wasm_func_obj_t func_obj, uint32_t argc,
625  uint32_t argv[]);
626 
643 WASM_RUNTIME_API_EXTERN bool
644 wasm_runtime_call_func_ref_a(wasm_exec_env_t exec_env,
645  const wasm_func_obj_t func_obj,
646  uint32_t num_results, wasm_val_t results[],
647  uint32_t num_args, wasm_val_t *args);
648 
665 WASM_RUNTIME_API_EXTERN bool
666 wasm_runtime_call_func_ref_v(wasm_exec_env_t exec_env,
667  const wasm_func_obj_t func_obj,
668  uint32_t num_results, wasm_val_t results[],
669  uint32_t num_args, ...);
670 
679 WASM_RUNTIME_API_EXTERN wasm_externref_obj_t
680 wasm_externref_obj_new(wasm_exec_env_t exec_env, const void *host_obj);
681 
689 WASM_RUNTIME_API_EXTERN const void *
690 wasm_externref_obj_get_value(const wasm_externref_obj_t externref_obj);
691 
700 WASM_RUNTIME_API_EXTERN wasm_anyref_obj_t
701 wasm_anyref_obj_new(wasm_exec_env_t exec_env, const void *host_obj);
702 
710 WASM_RUNTIME_API_EXTERN const void *
711 wasm_anyref_obj_get_value(const wasm_anyref_obj_t anyref_obj);
712 
721 WASM_RUNTIME_API_EXTERN wasm_obj_t
722 wasm_externref_obj_to_internal_obj(const wasm_externref_obj_t externref_obj);
723 
733 WASM_RUNTIME_API_EXTERN wasm_externref_obj_t
734 wasm_internal_obj_to_externref_obj(wasm_exec_env_t exec_env,
735  const wasm_obj_t internal_obj);
736 
744 WASM_RUNTIME_API_EXTERN wasm_i31_obj_t
745 wasm_i31_obj_new(uint32_t i31_value);
746 
755 WASM_RUNTIME_API_EXTERN uint32_t
756 wasm_i31_obj_get_value(wasm_i31_obj_t i31_obj, bool sign_extend);
757 
766 WASM_RUNTIME_API_EXTERN bool
767 wasm_runtime_pin_object(wasm_exec_env_t exec_env, wasm_obj_t obj);
768 
777 WASM_RUNTIME_API_EXTERN bool
778 wasm_runtime_unpin_object(wasm_exec_env_t exec_env, wasm_obj_t obj);
779 
787 WASM_RUNTIME_API_EXTERN bool
788 wasm_obj_is_struct_obj(const wasm_obj_t obj);
789 
797 WASM_RUNTIME_API_EXTERN bool
798 wasm_obj_is_array_obj(const wasm_obj_t obj);
799 
807 WASM_RUNTIME_API_EXTERN bool
808 wasm_obj_is_func_obj(const wasm_obj_t obj);
809 
817 WASM_RUNTIME_API_EXTERN bool
818 wasm_obj_is_i31_obj(const wasm_obj_t obj);
819 
827 WASM_RUNTIME_API_EXTERN bool
828 wasm_obj_is_externref_obj(const wasm_obj_t obj);
829 
837 WASM_RUNTIME_API_EXTERN bool
838 wasm_obj_is_anyref_obj(const wasm_obj_t obj);
839 
847 WASM_RUNTIME_API_EXTERN bool
848 wasm_obj_is_internal_obj(const wasm_obj_t obj);
849 
857 WASM_RUNTIME_API_EXTERN bool
858 wasm_obj_is_eq_obj(const wasm_obj_t obj);
859 
869 WASM_RUNTIME_API_EXTERN bool
870 wasm_obj_is_instance_of_defined_type(const wasm_obj_t obj,
871  const wasm_defined_type_t defined_type,
872  const wasm_module_t module);
873 
885 WASM_RUNTIME_API_EXTERN bool
886 wasm_obj_is_instance_of_type_idx(const wasm_obj_t obj, uint32_t type_idx,
887  const wasm_module_t module);
888 
897 WASM_RUNTIME_API_EXTERN bool
898 wasm_obj_is_instance_of_ref_type(const wasm_obj_t obj,
899  const wasm_ref_type_t *ref_type);
900 
909 WASM_RUNTIME_API_EXTERN void
910 wasm_runtime_push_local_obj_ref(wasm_exec_env_t exec_env,
911  wasm_local_obj_ref_t *local_obj_ref);
912 
920 WASM_RUNTIME_API_EXTERN wasm_local_obj_ref_t *
921 wasm_runtime_pop_local_obj_ref(wasm_exec_env_t exec_env);
922 
929 WASM_RUNTIME_API_EXTERN void
930 wasm_runtime_pop_local_obj_refs(wasm_exec_env_t exec_env, uint32_t n);
931 
940 WASM_RUNTIME_API_EXTERN wasm_local_obj_ref_t *
941 wasm_runtime_get_cur_local_obj_ref(wasm_exec_env_t exec_env);
942 
954 bool
955 wasm_obj_set_gc_finalizer(wasm_exec_env_t exec_env, const wasm_obj_t obj,
956  wasm_obj_finalizer_t cb, void *data);
957 
964 void
965 wasm_obj_unset_gc_finalizer(wasm_exec_env_t exec_env, void *obj);
966 
967 #ifdef __cplusplus
968 }
969 #endif
970 
971 #endif /* end of _GC_EXPORT_H */
wasm_get_defined_type_count
WASM_RUNTIME_API_EXTERN uint32_t wasm_get_defined_type_count(const wasm_module_t module)
wasm_array_obj_get_elem
WASM_RUNTIME_API_EXTERN void wasm_array_obj_get_elem(const wasm_array_obj_t array_obj, uint32_t elem_idx, bool sign_extend, wasm_value_t *value)
WASMLocalObjectRef
struct WASMLocalObjectRef WASMLocalObjectRef
wasm_obj_is_instance_of_type_idx
WASM_RUNTIME_API_EXTERN bool wasm_obj_is_instance_of_type_idx(const wasm_obj_t obj, uint32_t type_idx, const wasm_module_t module)
wasm_get_defined_type
WASM_RUNTIME_API_EXTERN wasm_defined_type_t wasm_get_defined_type(const wasm_module_t module, uint32_t index)
V128
Definition: gc_export.h:72
wasm_runtime_call_func_ref_v
WASM_RUNTIME_API_EXTERN bool wasm_runtime_call_func_ref_v(wasm_exec_env_t exec_env, const wasm_func_obj_t func_obj, uint32_t num_results, wasm_val_t results[], uint32_t num_args,...)
wasm_runtime_push_local_obj_ref
WASM_RUNTIME_API_EXTERN void wasm_runtime_push_local_obj_ref(wasm_exec_env_t exec_env, wasm_local_obj_ref_t *local_obj_ref)
wasm_i31_obj_get_value
WASM_RUNTIME_API_EXTERN uint32_t wasm_i31_obj_get_value(wasm_i31_obj_t i31_obj, bool sign_extend)
wasm_array_type_get_elem_type
WASM_RUNTIME_API_EXTERN wasm_ref_type_t wasm_array_type_get_elem_type(const wasm_array_type_t array_type, bool *p_is_mutable)
wasm_defined_type_is_subtype_of
WASM_RUNTIME_API_EXTERN bool wasm_defined_type_is_subtype_of(const wasm_defined_type_t def_type1, const wasm_defined_type_t def_type2, const wasm_module_t module)
wasm_struct_type_get_field_count
WASM_RUNTIME_API_EXTERN uint32_t wasm_struct_type_get_field_count(const wasm_struct_type_t struct_type)
wasm_obj_is_externref_obj
WASM_RUNTIME_API_EXTERN bool wasm_obj_is_externref_obj(const wasm_obj_t obj)
wasm_array_obj_copy
WASM_RUNTIME_API_EXTERN void wasm_array_obj_copy(wasm_array_obj_t dst_obj, uint32_t dst_idx, const wasm_array_obj_t src_obj, uint32_t src_idx, uint32_t len)
wasm_struct_type_get_field_type
WASM_RUNTIME_API_EXTERN wasm_ref_type_t wasm_struct_type_get_field_type(const wasm_struct_type_t struct_type, uint32_t field_idx, bool *p_is_mutable)
wasm_export.h
This file defines the exported common runtime APIs.
wasm_externref_obj_to_internal_obj
WASM_RUNTIME_API_EXTERN wasm_obj_t wasm_externref_obj_to_internal_obj(const wasm_externref_obj_t externref_obj)
wasm_runtime_get_cur_local_obj_ref
WASM_RUNTIME_API_EXTERN wasm_local_obj_ref_t * wasm_runtime_get_cur_local_obj_ref(wasm_exec_env_t exec_env)
wasm_array_obj_new_with_type
WASM_RUNTIME_API_EXTERN wasm_array_obj_t wasm_array_obj_new_with_type(wasm_exec_env_t exec_env, const wasm_array_type_t type, uint32_t length, wasm_value_t *init_value)
wasm_obj_is_anyref_obj
WASM_RUNTIME_API_EXTERN bool wasm_obj_is_anyref_obj(const wasm_obj_t obj)
WASMLocalObjectRef
Definition: gc_export.h:126
wasm_anyref_obj_new
WASM_RUNTIME_API_EXTERN wasm_anyref_obj_t wasm_anyref_obj_new(wasm_exec_env_t exec_env, const void *host_obj)
wasm_runtime_pop_local_obj_refs
WASM_RUNTIME_API_EXTERN void wasm_runtime_pop_local_obj_refs(wasm_exec_env_t exec_env, uint32_t n)
wasm_runtime_unpin_object
WASM_RUNTIME_API_EXTERN bool wasm_runtime_unpin_object(wasm_exec_env_t exec_env, wasm_obj_t obj)
wasm_runtime_pin_object
WASM_RUNTIME_API_EXTERN bool wasm_runtime_pin_object(wasm_exec_env_t exec_env, wasm_obj_t obj)
wasm_func_obj_get_func_type
WASM_RUNTIME_API_EXTERN wasm_func_type_t wasm_func_obj_get_func_type(const wasm_func_obj_t func_obj)
wasm_obj_get_defined_type_idx
WASM_RUNTIME_API_EXTERN int32_t wasm_obj_get_defined_type_idx(const wasm_module_t module, const wasm_obj_t obj)
wasm_defined_type_is_func_type
WASM_RUNTIME_API_EXTERN bool wasm_defined_type_is_func_type(const wasm_defined_type_t def_type)
wasm_externref_obj_new
WASM_RUNTIME_API_EXTERN wasm_externref_obj_t wasm_externref_obj_new(wasm_exec_env_t exec_env, const void *host_obj)
wasm_obj_is_struct_obj
WASM_RUNTIME_API_EXTERN bool wasm_obj_is_struct_obj(const wasm_obj_t obj)
wasm_obj_unset_gc_finalizer
void wasm_obj_unset_gc_finalizer(wasm_exec_env_t exec_env, void *obj)
wasm_ref_type_set_heap_type
WASM_RUNTIME_API_EXTERN void wasm_ref_type_set_heap_type(wasm_ref_type_t *ref_type, bool nullable, int32_t heap_type)
wasm_array_obj_new_with_typeidx
WASM_RUNTIME_API_EXTERN wasm_array_obj_t wasm_array_obj_new_with_typeidx(wasm_exec_env_t exec_env, uint32_t type_idx, uint32_t length, wasm_value_t *init_value)
wasm_func_type_get_result_count
WASM_RUNTIME_API_EXTERN uint32_t wasm_func_type_get_result_count(const wasm_func_type_t func_type)
wasm_defined_type_equal
WASM_RUNTIME_API_EXTERN bool wasm_defined_type_equal(const wasm_defined_type_t def_type1, const wasm_defined_type_t def_type2, const wasm_module_t module)
wasm_struct_obj_new_with_type
WASM_RUNTIME_API_EXTERN wasm_struct_obj_t wasm_struct_obj_new_with_type(wasm_exec_env_t exec_env, const wasm_struct_type_t type)
wasm_val_t
Definition: wasm_c_api.h:435
wasm_struct_obj_set_field
WASM_RUNTIME_API_EXTERN void wasm_struct_obj_set_field(wasm_struct_obj_t obj, uint32_t field_idx, const wasm_value_t *value)
wasm_obj_set_gc_finalizer
bool wasm_obj_set_gc_finalizer(wasm_exec_env_t exec_env, const wasm_obj_t obj, wasm_obj_finalizer_t cb, void *data)
WASMValue
Definition: gc_export.h:81
wasm_ref_type_t
Definition: gc_export.h:111
wasm_ref_type_equal
WASM_RUNTIME_API_EXTERN bool wasm_ref_type_equal(const wasm_ref_type_t *ref_type1, const wasm_ref_type_t *ref_type2, const wasm_module_t module)
wasm_internal_obj_to_externref_obj
WASM_RUNTIME_API_EXTERN wasm_externref_obj_t wasm_internal_obj_to_externref_obj(wasm_exec_env_t exec_env, const wasm_obj_t internal_obj)
wasm_defined_type_is_array_type
WASM_RUNTIME_API_EXTERN bool wasm_defined_type_is_array_type(const wasm_defined_type_t def_type)
wasm_array_obj_length
WASM_RUNTIME_API_EXTERN uint32_t wasm_array_obj_length(const wasm_array_obj_t array_obj)
wasm_externref_obj_get_value
const WASM_RUNTIME_API_EXTERN void * wasm_externref_obj_get_value(const wasm_externref_obj_t externref_obj)
wasm_array_obj_set_elem
WASM_RUNTIME_API_EXTERN void wasm_array_obj_set_elem(wasm_array_obj_t array_obj, uint32_t elem_idx, const wasm_value_t *value)
wasm_obj_is_internal_obj
WASM_RUNTIME_API_EXTERN bool wasm_obj_is_internal_obj(const wasm_obj_t obj)
wasm_runtime_call_func_ref
WASM_RUNTIME_API_EXTERN bool wasm_runtime_call_func_ref(wasm_exec_env_t exec_env, const wasm_func_obj_t func_obj, uint32_t argc, uint32_t argv[])
wasm_struct_obj_new_with_typeidx
WASM_RUNTIME_API_EXTERN wasm_struct_obj_t wasm_struct_obj_new_with_typeidx(wasm_exec_env_t exec_env, uint32_t type_idx)
wasm_obj_get_defined_type
WASM_RUNTIME_API_EXTERN wasm_defined_type_t wasm_obj_get_defined_type(const wasm_obj_t obj)
wasm_func_type_get_result_type
WASM_RUNTIME_API_EXTERN wasm_ref_type_t wasm_func_type_get_result_type(const wasm_func_type_t func_type, uint32_t result_idx)
wasm_defined_type_is_struct_type
WASM_RUNTIME_API_EXTERN bool wasm_defined_type_is_struct_type(const wasm_defined_type_t def_type)
wasm_func_obj_get_func_idx_bound
WASM_RUNTIME_API_EXTERN uint32_t wasm_func_obj_get_func_idx_bound(const wasm_func_obj_t func_obj)
wasm_obj_is_i31_obj
WASM_RUNTIME_API_EXTERN bool wasm_obj_is_i31_obj(const wasm_obj_t obj)
wasm_obj_is_array_obj
WASM_RUNTIME_API_EXTERN bool wasm_obj_is_array_obj(const wasm_obj_t obj)
wasm_array_obj_elem_addr
WASM_RUNTIME_API_EXTERN void * wasm_array_obj_elem_addr(const wasm_array_obj_t array_obj, uint32_t elem_idx)
wasm_obj_is_instance_of_ref_type
WASM_RUNTIME_API_EXTERN bool wasm_obj_is_instance_of_ref_type(const wasm_obj_t obj, const wasm_ref_type_t *ref_type)
wasm_struct_obj_get_field_count
WASM_RUNTIME_API_EXTERN uint32_t wasm_struct_obj_get_field_count(const wasm_struct_obj_t obj)
wasm_ref_type_is_subtype_of
WASM_RUNTIME_API_EXTERN bool wasm_ref_type_is_subtype_of(const wasm_ref_type_t *ref_type1, const wasm_ref_type_t *ref_type2, const wasm_module_t module)
wasm_func_obj_new_with_typeidx
WASM_RUNTIME_API_EXTERN wasm_func_obj_t wasm_func_obj_new_with_typeidx(wasm_exec_env_t exec_env, uint32_t type_idx, uint32_t func_idx_bound)
wasm_runtime_pop_local_obj_ref
WASM_RUNTIME_API_EXTERN wasm_local_obj_ref_t * wasm_runtime_pop_local_obj_ref(wasm_exec_env_t exec_env)
wasm_func_type_get_param_type
WASM_RUNTIME_API_EXTERN wasm_ref_type_t wasm_func_type_get_param_type(const wasm_func_type_t func_type, uint32_t param_idx)
wasm_ref_type_set_type_idx
WASM_RUNTIME_API_EXTERN void wasm_ref_type_set_type_idx(wasm_ref_type_t *ref_type, bool nullable, int32_t type_idx)
wasm_obj_is_instance_of_defined_type
WASM_RUNTIME_API_EXTERN bool wasm_obj_is_instance_of_defined_type(const wasm_obj_t obj, const wasm_defined_type_t defined_type, const wasm_module_t module)
wasm_runtime_call_func_ref_a
WASM_RUNTIME_API_EXTERN bool wasm_runtime_call_func_ref_a(wasm_exec_env_t exec_env, const wasm_func_obj_t func_obj, uint32_t num_results, wasm_val_t results[], uint32_t num_args, wasm_val_t *args)
wasm_obj_is_eq_obj
WASM_RUNTIME_API_EXTERN bool wasm_obj_is_eq_obj(const wasm_obj_t obj)
wasm_func_obj_new_with_type
WASM_RUNTIME_API_EXTERN wasm_func_obj_t wasm_func_obj_new_with_type(wasm_exec_env_t exec_env, wasm_func_type_t type, uint32_t func_idx_bound)
wasm_func_type_get_param_count
WASM_RUNTIME_API_EXTERN uint32_t wasm_func_type_get_param_count(const wasm_func_type_t func_type)
wasm_struct_obj_get_field
WASM_RUNTIME_API_EXTERN void wasm_struct_obj_get_field(const wasm_struct_obj_t obj, uint32_t field_idx, bool sign_extend, wasm_value_t *value)
wasm_array_obj_first_elem_addr
WASM_RUNTIME_API_EXTERN void * wasm_array_obj_first_elem_addr(const wasm_array_obj_t array_obj)
wasm_i31_obj_new
WASM_RUNTIME_API_EXTERN wasm_i31_obj_t wasm_i31_obj_new(uint32_t i31_value)
wasm_obj_is_func_obj
WASM_RUNTIME_API_EXTERN bool wasm_obj_is_func_obj(const wasm_obj_t obj)
wasm_anyref_obj_get_value
const WASM_RUNTIME_API_EXTERN void * wasm_anyref_obj_get_value(const wasm_anyref_obj_t anyref_obj)