-
Notifications
You must be signed in to change notification settings - Fork 777
Add C/JS APIs to copy expressions #2840
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
|
A radical solution might be to remove tracing entirely, since it complicates / limits the C-API with very little benefit imho. Even though it seems nice to have on paper, I actually never used it. Also caught myself several times worrying about the subtle slowdown it introduces since there are like a quadrillion C-API calls in the AssemblyScript compiler. |
I'm open to removing the tracing API. It was very useful originally with a few early embedders of the C API, but I can't remember the last time it was helpful. Maybe we are stable enough it's not that necessary. |
Going to give that a try in a separate PR :) |
With API tracing removed this should be good now as well :) |
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.
Sorry for the delay!
This API enables use cases where we want to keep the original expression, yet utilize passes like `vacuum` or `precompute` to evaluate it without implicitly modifying the original. C-API: **BinaryenExpressionCopy**(expr, module) JS-API: **Module#copyExpression**(expr)
This API enables use cases where we want to keep the original expression, yet utilize passes like
vacuum
orprecompute
to evaluate it without implicitly modifying the original.C-API: BinaryenExpressionCopy(expr, module)
JS-API: Module#copyExpression(expr)