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

Stop using commands as keys for tables on the garbage collector #610

Closed
gabrielsferre opened this issue Jul 8, 2024 · 2 comments
Closed

Comments

@gabrielsferre
Copy link
Contributor

We do liveliness analysis to check at each command of the intermediate representation which variables should be saved at the Lua stack before control transfers. Currently, we keep track of live variables per command using a table whose keys are the commands themselves, that is, the ir.Cmd objects: https://github.com/pallene-lang/pallene/blob/57c183789b2b1e0a657a96ce4383c6e6bc5b9e7b/src/pallene/gc.lua#L69-#L88

This approach for indexing the table comes with some aliasing problems (q.v. #575), so we want to replace the table's keys with something else.

@hugomg
Copy link
Member

hugomg commented Jul 8, 2024

In theory, we should be able to index by basic block, like the other analysis.

@hugomg
Copy link
Member

hugomg commented Jul 23, 2024

Done in #615.

@gabrielsferre protip: if you say "closes #615" in the commit message, then github closes the issue automatically

@hugomg hugomg closed this as completed Jul 23, 2024
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

2 participants