Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance GC subtyping checks #3317

Merged
merged 127 commits into from
Apr 18, 2024
Merged

Conversation

wenyongh
Copy link
Contributor

@wenyongh wenyongh commented Apr 15, 2024

Enhance the GC subtyping checks:

  • Fix issues in the type equivalence check
  • Enable the recursive type subtyping check
  • Add a equivalence type flag in defined types of aot file, if there is an
    equivalence type before, just set it true and re-use the previous type
  • Normalize the defined type for interpreter and AOT
  • Enable spec test case type-equivalence.wast and type-subtyping.wast,
    and enable some commented cases
  • Enable set WAMR_BUILD_SANITIZER from cmake variable

wenyongh and others added 30 commits February 16, 2023 17:02
The latest GC spec proposal has changed a lot since we implemented the feature,
refactor it based on the main branch. Part of the spec cases were tested.
Implement GC for fast interpreter except struct/array related opcodes
And fix compile warning in wasm_c_api.c from wasm_table_get.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
- Add cmake variable `WAMR_BUILD_GC_BINARYEN`
- Implement GC opcode array.copy
- Fix bug in wasm_type_is_supers_of
- Fix loader load import global and wasm_loader_pop_frame_ref
- Support pass/return GC ref type params/result to/from native API
Change `wasm_obj_t *gc_obj` to `wasm_obj_t gc_obj`
- don't mark non-ref array elements
- trace ref returned from native function
- fix calculated array element offset error in reclaim_instance_heap
The runtime instance memory layout changed when GC was enabled. With this patch
the GC is enabled for wamrc, but it keeps the compatibility with iwasm no matter GC
is enabled for it or not.

It may waste some memory for iwasm without GC support since the GC relative fields
for the table instance are always here, let's optimization it after AOT fully supports GC.
wenyongh and others added 15 commits January 18, 2024 18:28
- Set gc func type's quick_aot_entry
- Call quick_aot_entry when hw bound check is disabled
- Declare detailed aot func's prototype inside the quick aot entry
- Remove ret_type in the quick aot entry
- Update docker image
- Emit SIMD/ref-types/bulk-memory flags into AOT file only when the features
  are really used in wasm file
- Remove unused tail-call flag and stringref flag
- Add memoy64 flag and dynamic-linking flag
- Change WASM_FEATURE_THREADS to WASM_FEATURE_MULTI_THREAD
…alliance#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>
…ne info of wasm src (bytecodealliance#3128)

Implement the tool to convert the bytecode offset (address) in call-stack dump
into to the line info in wasm source code.
Remove `JIT_STACK_FRAME` cmake variable and compilation macro, and
use `AOT_STACK_FRAME` instead, to avoid introducing too many macros.

Same as using `WASM_ENABLE_QUICK_AOT_ENTRY` macro to control code
for LLVM JIT.
@wenyongh wenyongh changed the base branch from main to dev/gc_refactor April 15, 2024 10:27
@wenyongh wenyongh changed the base branch from dev/gc_refactor to main April 16, 2024 09:28
@TianlongLiang
Copy link
Contributor

LGTM

@xujuntwt95329
Copy link
Collaborator

LGTM

@wenyongh wenyongh merged commit 68bd30c into bytecodealliance:main Apr 18, 2024
386 checks passed
@wenyongh wenyongh deleted the dev/gc_refactor branch April 21, 2024 10:02
victoryang00 pushed a commit to victoryang00/wamr-aot-gc-checkpoint-restore that referenced this pull request May 1, 2024
Enhance the GC subtyping checks:
- Fix issues in the type equivalence check
- Enable the recursive type subtyping check
- Add a equivalence type flag in defined types of aot file, if there is an
  equivalence type before, just set it true and re-use the previous type
- Normalize the defined types for interpreter and AOT
- Enable spec test case type-equivalence.wast and type-subtyping.wast,
  and enable some commented cases
- Enable set WAMR_BUILD_SANITIZER from cmake variable
victoryang00 pushed a commit to victoryang00/wamr-aot-gc-checkpoint-restore that referenced this pull request May 2, 2024
Enhance the GC subtyping checks:
- Fix issues in the type equivalence check
- Enable the recursive type subtyping check
- Add a equivalence type flag in defined types of aot file, if there is an
  equivalence type before, just set it true and re-use the previous type
- Normalize the defined types for interpreter and AOT
- Enable spec test case type-equivalence.wast and type-subtyping.wast,
  and enable some commented cases
- Enable set WAMR_BUILD_SANITIZER from cmake variable

Signed-off-by: victoryang00 <victoryang00@ucsc.edu>
victoryang00 pushed a commit to victoryang00/wamr-aot-gc-checkpoint-restore that referenced this pull request May 27, 2024
Enhance the GC subtyping checks:
- Fix issues in the type equivalence check
- Enable the recursive type subtyping check
- Add a equivalence type flag in defined types of aot file, if there is an
  equivalence type before, just set it true and re-use the previous type
- Normalize the defined types for interpreter and AOT
- Enable spec test case type-equivalence.wast and type-subtyping.wast,
  and enable some commented cases
- Enable set WAMR_BUILD_SANITIZER from cmake variable
victoryang00 pushed a commit to victoryang00/wamr-aot-gc-checkpoint-restore that referenced this pull request May 27, 2024
Enhance the GC subtyping checks:
- Fix issues in the type equivalence check
- Enable the recursive type subtyping check
- Add a equivalence type flag in defined types of aot file, if there is an
  equivalence type before, just set it true and re-use the previous type
- Normalize the defined types for interpreter and AOT
- Enable spec test case type-equivalence.wast and type-subtyping.wast,
  and enable some commented cases
- Enable set WAMR_BUILD_SANITIZER from cmake variable

Signed-off-by: victoryang00 <victoryang00@ucsc.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants