The libstruct_indirect
API is used to access WasmGC struct fields through index calculated during runtime. The API is designed to be used by ts2wasm-compiler
to support interface
type.
These APIs are used to emulate the behaviour of the proposed struct.get/set_indirect opcode, if these opcodes are accepted by the proposal and supported by runtime, the libstruct_indirect
API will no longer be required.
These APIs are required by interface
type, the absence of this set of APIs would prevent apps utilizing interface
type from functioning correctly.
libstruct_indirect
-
struct_get_indirect_i32
- Description
- Get i32 field from WasmGC struct
- Parameters
structref
: the WasmGC structi32
: field index
- Return
i32
: the field value
- Description
-
struct_get_indirect_i64
- Description
- Get i64 field from WasmGC struct
- Parameters
structref
: the WasmGC structi32
: field index
- Return
i64
: the field value
- Description
-
struct_get_indirect_f32
- Description
- Get f32 field from WasmGC struct
- Parameters
structref
: the WasmGC structi32
: field index
- Return
f32
: the field value
- Description
-
struct_get_indirect_f64
- Description
- Get f64 field from WasmGC struct
- Parameters
structref
: the WasmGC structi32
: field index
- Return
f64
: the field value
- Description
-
struct_get_indirect_anyref
- Description
- Get anyref field from WasmGC struct
- Parameters
structref
: the WasmGC structi32
: field index
- Return
anyref
: the field value
- Description
-
struct_get_indirect_funcref
- Description
- Get funcref field from WasmGC struct
- Parameters
structref
: the WasmGC structi32
: field index
- Return
funcref
: the field value
- Description
-
struct_set_indirect_i32
- Description
- Set i32 field of WasmGC struct
- Parameters
structref
: the WasmGC structi32
: field indexi32
: field value
- Description
-
struct_set_indirect_i64
- Description
- Set i64 field of WasmGC struct
- Parameters
structref
: the WasmGC structi32
: field indexi64
: field value
- Description
-
struct_set_indirect_f32
- Description
- Set f32 field of WasmGC struct
- Parameters
structref
: the WasmGC structi32
: field indexf32
: field value
- Description
-
struct_set_indirect_f64
- Description
- Set f64 field of WasmGC struct
- Parameters
structref
: the WasmGC structi32
: field indexf64
: field value
- Description
-
struct_set_indirect_anyref
- Description
- Set anyref field of WasmGC struct
- Parameters
structref
: the WasmGC structi32
: field indexanyref
: field value
- Description
-
struct_set_indirect_funcref
- Description
- Set funcref field of WasmGC struct
- Parameters
structref
: the WasmGC structi32
: field indexfuncref
: field value
- Description