-
Notifications
You must be signed in to change notification settings - Fork 777
Expose GC API to Binaryen.JS #7466
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
Conversation
There are some functions I'm unsure how to implement. For example, I can't seem to find a C implementation of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it looks like ArrayInitElem
needs to be added to the C API, first.
Looks like there are errors on CI, might make sense to fix those before I do an in-depth review here, but let me know if you are stuck. |
I'm not stuck, just doing some experiments. I will re-request review when I'm done, thanks! The missing C API is already there, just need to add JS wrapper & tests. I had some issues with testing locally, so I had to use CI for that purpose, but I finally managed to resolve this problem. I think that tests are just not optimized for Windows. |
…`ArraySet`, `ArrayLen`, `ArrayCopy`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, thanks @GulgDev !
Adds
TypeBuilder
interface and the following WasmGC instructions to JS:ref.test
,ref.cast
,any.convert_extern
,extern.convert_any
,br_on_null
,br_on_non_null
,br_on_cast
,br_on_cast_fail
,struct.new
,struct.new_default
,struct.get
,struct.set
,array.new
,array.new_default
,array.new_fixed
,array.new_data
,array.new_elem
*,array.get
,array.set
,array.len
,array.fill
*,array.copy
,array.init_data
*,array.init_elem
*.Instructions that were added both to JS and to C are marked with an asterisk (
*
).The corresponding test case was also added (
gc.js
).Fixes #5921
This PR also fixes memory leaks caused by stack allocations that are not wrapped in
preserveStack
.