Skip to content

Commit

Permalink
Update EIP-6206: Add non-returning functions motivation
Browse files Browse the repository at this point in the history
  • Loading branch information
gumb0 committed Jul 18, 2023
1 parent b0b62c4 commit 787a679
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions EIPS/eip-6206.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Additionally the format of the type sections is extended to allow declaring sect

It is common for functions to make a call at the end of the routine only to then return. `JUMPF` optimizes this behavior by changing code sections without needing to update the return stack.

Knowing at validation time that a function will never return control allows for `JUMPF` to such function to be treated similar to terminating instructions, where extra items may be left on the operand stack at execution termination. This provides opportunities for compilers to generate more optimal code, both in code size and in spent gas. It is particularly benefitial for small error handling helpers, that end execution with `REVERT`: they are commonly reused in multiple branches and extracting them into a helper function is efficient, when there is no need to pop extra stack items before `JUMPF` to such helper.

## Specification

### Type section changes
Expand Down

0 comments on commit 787a679

Please sign in to comment.