Implement GC (Garbage Collection) feature for interpreter, AOT and LLVM-JIT (#3125)

Implement the GC (Garbage Collection) feature for interpreter mode,
AOT mode and LLVM-JIT mode, and support most features of the latest
spec proposal, and also enable the stringref feature.

Use `cmake -DWAMR_BUILD_GC=1/0` to enable/disable the feature,
and `wamrc --enable-gc` to generate the AOT file with GC supported.

And update the AOT file version from 2 to 3 since there are many AOT
ABI breaks, including the changes of AOT file format, the changes of
AOT module/memory instance layouts, the AOT runtime APIs for the
AOT code to invoke and so on.
This commit is contained in:
Wenyong Huang
2024-02-06 20:47:11 +08:00
committed by GitHub
parent 5931aaacbe
commit 16a4d71b34
98 changed files with 33469 additions and 3159 deletions

View File

@ -211,6 +211,21 @@ index 1ea2b06..8eded37 100644
(assert_return (invoke $module1 "call-8") (i32.const 69))
(assert_return (invoke $module1 "call-9") (i32.const 70))
+;)
diff --git a/test/core/table.wast b/test/core/table.wast
index 0bc43ca6..ee5209ec 100644
--- a/test/core/table.wast
+++ b/test/core/table.wast
@@ -8,8 +8,8 @@
(module (table 0 65536 funcref))
(module (table 0 0xffff_ffff funcref))
-(assert_invalid (module (table 0 funcref) (table 0 funcref)) "multiple tables")
-(assert_invalid (module (table (import "spectest" "table") 0 funcref) (table 0 funcref)) "multiple tables")
+(module (table 0 funcref) (table 0 funcref))
+(module (table (import "spectest" "table") 0 funcref) (table 0 funcref))
(assert_invalid (module (elem (i32.const 0))) "unknown table")
(assert_invalid (module (elem (i32.const 0) $f) (func $f)) "unknown table")
diff --git a/test/core/thread.wast b/test/core/thread.wast
index c3456a6..83fc281 100644
--- a/test/core/thread.wast
@ -228,3 +243,23 @@ index c3456a6..83fc281 100644
(wait $T1)
(wait $T2)
+;)
diff --git a/test/core/unreached-invalid.wast b/test/core/unreached-invalid.wast
index 6ef4ac55..9a2387a3 100644
--- a/test/core/unreached-invalid.wast
+++ b/test/core/unreached-invalid.wast
@@ -535,6 +535,7 @@
))
"type mismatch"
)
+(; invalid case, the module is fine for the latest spec interpreter
(assert_invalid
(module (func $type-br_table-label-num-vs-label-num-after-unreachable
(block (result f64)
@@ -549,6 +550,7 @@
))
"type mismatch"
)
+;)
(assert_invalid
(module (func $type-block-value-nested-unreachable-num-vs-void