-
Notifications
You must be signed in to change notification settings - Fork 20
refactor: allow more flexibility in the types of imports/exports #48
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
…nify embedded js code
|
Awesome work. I've tested this using a Go plugin to call a JS export as a host function and it works great. I will do more testing with it tonight.. curious if you have any specific paths that you'd like me to focus on? |
|
Thanks for taking a look!
I think just testing it out is the most helpful One future improvement worth calling out is the ability to use types like |
nilslice
left a comment
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.
Ok, ran through some more tests and re-ran the previous ones since the latest commits & everything works great!
Unless @bhelx wants to do a quick run though, this LGTM,
This sounds nice!! |
__arg_startis called to push a new call onto the argument stack (a globalVec<Vec<JSValue>>), then for each argument an arg function like__arg_i32or__arg_f32gets called, this pushes the value to the end of the vector at the the top of the stack, then when a function is called it pops the topVec<JSValue>off of the stack to use as its arguments.__invokeHostFunc_1_1,__invokeHostFunc_2_1, ...) , there are too many combinations to allow for any type to be usedHost.invokeFunc0to call a host function that takes 0 argumentsHost.invokeFuncandHost.invokeFunc0determine the number of arguments passed and select the proper__invokeHostFunc_$nparams_$nresultsfunction to callwasm-optinstead ofbinaryencrate