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

Dev/gc refactor 3 #2487

Merged

Conversation

TianlongLiang
Copy link
Contributor

@TianlongLiang TianlongLiang commented Aug 21, 2023

The first draft of the second part of AOT GC compilation opcodes, the struct-related and array-related new opcodes:

  1. WASM_OP_STRUCT_NEW_CANON
  2. WASM_OP_STRUCT_NEW_CANON_DEFAULT
  3. WASM_OP_STRUCT_GET
  4. WASM_OP_STRUCT_GET_S
  5. WASM_OP_STRUCT_GET_U
  6. WASM_OP_STRUCT_SET
  7. WASM_OP_ARRAY_NEW_CANON
  8. WASM_OP_ARRAY_NEW_CANON_DEFAULT
  9. WASM_OP_ARRAY_NEW_CANON_FIXED
  10. WASM_OP_ARRAY_GET
  11. WASM_OP_ARRAY_GET_S
  12. WASM_OP_ARRAY_GET_U
  13. WASM_OP_ARRAY_SET
  14. WASM_OP_ARRAY_LEN
  15. WASM_OP_ARRAY_NEW_CANON_DATA
  16. WASM_OP_ARRAY_COPY(to be compatible with binaryen GC)

After merging the second part, will rebase accordingly

@TianlongLiang TianlongLiang marked this pull request as draft August 21, 2023 15:00
@TianlongLiang TianlongLiang force-pushed the dev/gc_refactor_3 branch 2 times, most recently from d356bdf to d0e0b15 Compare August 24, 2023 07:27
core/iwasm/compilation/aot_emit_gc.c Show resolved Hide resolved
core/iwasm/compilation/aot_emit_gc.c Outdated Show resolved Hide resolved
check_array_obj_succ))
goto fail;

if (!aot_get_array_obj_length(comp_ctx, func_ctx, array_obj, &array_len))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't call function, just generate LLVM IR of array_obj->length >> WASM_ARRAY_LENGTH_SHIFT

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This static function generates LLVM IR(the equivalent of array_obj->length >> WASM_ARRAY_LENGTH_SHIFT) rather than calling a function, it's used in 3 places so I made it into a function.

@TianlongLiang TianlongLiang marked this pull request as ready for review September 25, 2023 01:51
core/iwasm/aot/aot_runtime.h Outdated Show resolved Hide resolved
core/iwasm/compilation/aot.h Outdated Show resolved Hide resolved
core/iwasm/compilation/aot_emit_gc.c Outdated Show resolved Hide resolved
core/iwasm/compilation/aot_emit_gc.c Outdated Show resolved Hide resolved
core/iwasm/compilation/aot_emit_gc.c Show resolved Hide resolved
core/iwasm/compilation/aot_emit_gc.c Outdated Show resolved Hide resolved
Copy link
Contributor

@wenyongh wenyongh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wenyongh wenyongh merged commit 760505e into bytecodealliance:dev/gc_refactor Oct 8, 2023
377 checks passed
@TianlongLiang TianlongLiang deleted the dev/gc_refactor_3 branch October 23, 2023 06:13
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

2 participants