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

use List instead of Map for <locals> cell #2

Merged
merged 1 commit into from
Jun 21, 2024
Merged

use List instead of Map for <locals> cell #2

merged 1 commit into from
Jun 21, 2024

Conversation

dwightguth
Copy link

Not ready for review yet.

This PR attempts to optimize the local.get and local.set instructions by means of replacing the Map used by the <locals> cell with a List.

@dwightguth dwightguth marked this pull request as ready for review June 20, 2024 16:54
Copy link

@theo25 theo25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

Copy link

@Robertorosmaninho Robertorosmaninho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides my question, it looks good to me!

@@ -1187,7 +1184,7 @@ The `#take` function will return the parameter stack in the reversed order, then
...
</instrs>
<valstack> VALSTACK => .ValStack </valstack>
<locals> LOCAL => .Map </locals>
<locals> LOCAL </locals>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use Locals => .List?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because this rule is immediately followed by the one for init_locals which rewrites this cell to the empty list.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense! Thanks!

@dwightguth dwightguth merged commit 0187310 into master Jun 21, 2024
2 checks passed
@dwightguth dwightguth deleted the locals branch June 21, 2024 18:09
dwightguth pushed a commit that referenced this pull request Jun 25, 2024
dwightguth pushed a commit that referenced this pull request Jul 9, 2024
dwightguth pushed a commit that referenced this pull request Aug 6, 2024
dwightguth pushed a commit that referenced this pull request Aug 9, 2024
dwightguth pushed a commit that referenced this pull request Sep 26, 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

Successfully merging this pull request may close these issues.

3 participants