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

Feat: New function strategy #34

Merged
merged 2 commits into from
Feb 11, 2024
Merged

Feat: New function strategy #34

merged 2 commits into from
Feb 11, 2024

Conversation

deleterium
Copy link
Owner

Function variables are globally assigned, due to the fact there is no good way to interact with Signum User Stack. Actually only pushing and popping possible, and for a good use of it, it would be needed to set/read values from the stack without needing to removing them.

That said, there was no meaning to push and pop values if they are always assigned to the same variable, so this new strategy saves instructions cycles and in most of cases removes all stack operations. Without stack operations, the contracts can save one page of 'User Stack Page' on deployment, and also cost a little less for the execution.

The implementation continues to use stack if there is a recursive function, or if we need to save the registers from caller.

Dozens tests and also some simulations for the edge cases proves this is a good move.

@deleterium deleterium merged commit 06b1a2c into main Feb 11, 2024
2 checks passed
@deleterium deleterium deleted the feat/newFunctionStrategy branch February 11, 2024 14:07
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.

1 participant