Commit Graph

20 Commits

Author SHA1 Message Date
Wenyong Huang
95a4731a50 Enhance GC feature 2024-04-15 10:40:55 +08:00
Liangyu Zhang
dcde45596d
Add wasm_runtime_get_cur_local_obj_ref and change API names (#3117)
Add wasm_runtime_get_cur_local_obj_ref and change API:
```C
wasm_runtime_push_local_object_ref
wasm_runtime_pop_local_object_ref
wasm_runtime_pop_local_object_refs
```
to
```C
wasm_runtime_push_local_obj_ref
wasm_runtime_pop_local_obj_ref
wasm_runtime_pop_local_obj_refs
```

Signed-off-by: zhangliangyu3 <zhangliangyu3@xiaomi.com>
2024-02-04 11:27:55 +08:00
Xu Jun
92176be7d6
Sync up with the latest GC MVP spec proposal (#2836) 2023-12-12 11:49:44 +08:00
Xu Jun
77d27c9ff6
Enable stringref aot (#2816) 2023-11-27 10:50:12 +08:00
Wenyong Huang
5d9cbfe109
Implement GC AOT object reclaim process (#2762) 2023-11-22 14:39:07 +08:00
Wenyong Huang
64e40c13a9
Fix more GC AOT/JIT issues (#2727)
Fix opcode translation for br_on_null/br_on_non_null/br_on_cast/br_on_cast_fail
Fix global data size/offset calculation for 32-bit/64-bit targets
Fix issues in AOT file emitting and AOT loader, refine AOT file format
Fix invalid table element address used for table.get/table.set
Fix invalid struct field offset used for struct.get/struct.set
Fix aot stack frame commit for function call/call_indirect/call_ref
Add GC AOT/JIT to CI test
2023-11-09 08:52:56 +08:00
Su Yihan
2f45f12cd7
Support stringref proposal (#2651)
This PR implements the WebAssembly stringref proposal:
  https://github.com/WebAssembly/stringref

It adds cmake variable `WAMR_BUILD_STRINGREF` to build the feature,
which will enable GC automatically.

The stringref contains two parts:
- `part 1`: add new ref types in WasmGC, add opcode processing in loader and interpreter
- `part 2`: add a library for string representation/encoding/decoding and so on

To reduce the code size introduced to WAMR, this PR only includes `part 1`,
`part 2` can be provided by embedder, they may use their own implementation,
e.g., Wasmnizer-ts uses JSString from QuickJS to implement stringref:
https://github.com/intel/Wasmnizer-ts/blob/main/runtime-library/stringref/stringref_qjs.c

We will submit another PR of `part 2` and make it as a sample rather than WAMR core part.

Signed-off-by: Su Yihan <yihan.su@intel.com>
Co-authored-by: Xu Jun <jun1.xu@intel.com>
2023-10-23 12:45:37 +08:00
Wenyong Huang
ac426ee331
GC AOT: Fix compile warnings and errors (#2623) 2023-10-08 11:42:22 +08:00
Huang Qi
067a86a774
Implement AOT file emitting and loading for GC (#2366) 2023-09-19 15:51:32 +08:00
Xu Jun
6a868173f8
Fix static code analyzing issues (#2371) 2023-07-21 07:59:30 +08:00
Xu Jun
254bbddfff
Add GC finalizer mechanism (#2325)
Allow to add a finalizer callback function for a GC anyref object,
which will be called when reclaimed.
2023-07-07 11:33:20 +08:00
Huang Qi
d665999a56
GC: Make Func/Struct/Array type inherited from WASMType (#2271) 2023-06-07 13:34:37 +08:00
zhenweijin
ea3b828432
Fix ref type equal check for the packed types (#2215) 2023-05-15 12:25:33 +08:00
Su Yihan
496fbbd6c6
Optimize get ref_type from ref_type_maps with wasm_reftype_map_find (#2188) 2023-05-08 17:39:57 +08:00
Xu Jun
c6e1f64701
Update comments in gc_export.h and optimize wasm ref type processing (#2185) 2023-05-08 08:23:08 +08:00
Xu Jun
21e4bcb52b
Implement GC export APIs related to func and array (#2184)
And add comments for the GC export APIs
2023-05-06 19:21:10 +08:00
Xu Jun
9bf0999e26
[GC] Remove unused normalize API (#2182) 2023-05-06 16:10:08 +08:00
Xu Jun
453bf2d20b
[GC] Add API to get obj defined type and call func ref (#2180) 2023-05-06 14:34:47 +08:00
zhenweijin
2e5ba118a9
Implement part of GC runtime export APIs (#2154) 2023-05-05 17:10:11 +08:00
Wenyong Huang
74417d6de9
Define the GC runtime APIs to export (#2143) 2023-04-23 14:26:32 +08:00