-
Notifications
You must be signed in to change notification settings - Fork 21
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
[Feature] Support EIP2315 (Subroutines). #59
Comments
Do you have any comments how subroutines (as proposed in EIP-3215) would affect LLVM backend? In particular can you map LLVM IR functions to EVM subroutines? |
@chfast The subroutine backend actually simplify things. In particular, in the era of Pre-EIP2315 we will have to maintain the caller context all by ourselves, including pushing return address on to stack. Take a look at this graph: https://github.com/etclabscore/evm_llvm/wiki/Stack-and-Memory-management#memory-stack So in Pre-2315:When we see a call:
When we see a return:
You can see that it actually adds a lot of stack manipulations, and makes it a bit harder to debug. What can we do when we have EIP2315:a call to a function will be mapped to the following operations:
And when we see a return instruction:
Now we don't have to push the return address on to stack. this will reduce the number of arguments living on the stack, leading to less stack manipulation instructions, hence better performance. Does it answer your question? |
Greg Colvin has already pushed the changes:
ethereum/EIPs#2576
ethereum/go-ethereum#20619
The text was updated successfully, but these errors were encountered: