Skip to content

Sea of nodes representation #280

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

Closed
1 task
kddnewton opened this issue Feb 5, 2023 · 0 comments · Fixed by #291
Closed
1 task

Sea of nodes representation #280

kddnewton opened this issue Feb 5, 2023 · 0 comments · Fixed by #291
Labels

Comments

@kddnewton
Copy link
Member

kddnewton commented Feb 5, 2023

A sea of nodes representation is a graph that has instructions as vertices and both control and data flow as edges. We've started this work with the CFG and DFG graphs. We should provide this information as a graph that you can access from both the library and ruby-syntax-tree.github.io.

There are a couple of things that need to happen to make this possible before the work can actually begin. This includes:

  • The API on instructions should change from pops/pushes to reads/writes, and they should no longer return an integer but an array. The array should be indices from the end of the stack. This is because instructions like topn and setn actually read and write from inside the stack, not the top. So these APIs should be updated to reflect that and the data flow should account for it. (Currently the data flow does not realize that these instructions modify other values in the stack, making it an incorrect representation.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant