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

Lacking BrTable optimization #8

Closed
Rerumu opened this issue Jun 16, 2022 · 0 comments
Closed

Lacking BrTable optimization #8

Rerumu opened this issue Jun 16, 2022 · 0 comments

Comments

@Rerumu
Copy link
Owner

Rerumu commented Jun 16, 2022

The BrTable AST node is currently not emitted with any form of optimization, as it used to be. The reason being that this causes problems consolidating the stack as different branches have different alignments that must be emitted before doing the jump.

Nonetheless, it should still be possible to at least generate a binary search instead of a linear search for the branch or otherwise optimize the lookup.

https://github.com/Rerumu/Wasynth/blob/master/codegen-luajit/src/backend/statement.rs#L31
https://github.com/Rerumu/Wasynth/blob/master/codegen-luau/src/backend/statement.rs#L42

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

No branches or pull requests

1 participant