Skip to content

Control flow graph #222

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

Draft
wants to merge 54 commits into
base: main
Choose a base branch
from
Draft

Control flow graph #222

wants to merge 54 commits into from

Conversation

JeanJPNM
Copy link
Member

@JeanJPNM JeanJPNM commented Jan 11, 2024

Copy link

netlify bot commented Jan 11, 2024

Deploy Preview for mlogjs ready!

Name Link
🔨 Latest commit 81f0609
🔍 Latest deploy log https://app.netlify.com/sites/mlogjs/deploys/67902e348720670008947d22
😎 Deploy Preview https://deploy-preview-222--mlogjs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@JeanJPNM JeanJPNM force-pushed the control-flow-graph branch from 91582fe to da23012 Compare April 17, 2024 18:12
JeanJPNM added 17 commits April 17, 2024 15:21
By having most control flow constructs of the language use the negated version of their condition instead of the condition itself,
we can prevent (most of the time) the ugly code generation that caused two parts of the same construct (e.g. a for loop) to be distant from each other on the generated code.
While that didn't  have any impact on performance, it still made the generated code harder to read and reason about.
Since the end instruction does the same thing as a jump 0 always, the end-if represents its conditional counterpart, allowing us to use a single instruction
in the generated code to do something previously done by two
For some reason I suddenly started having cyclical dependency issues in which EJumpKind would be undefined
so I decided to just remove the file since it was no longer used anyways
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

Successfully merging this pull request may close these issues.

Reassigning function parameters breaks function calls Useless jumps with nested if Use an intermediate representation
1 participant