EIP-2315 Simple Subroutines for the EVM

EIP-2315 doesn’t prevent you from using JUMP in the way that you have. But indeed it is a highly artificial example, not likely to be generated by Solidity or most any other compiler. (I don’t think you could write it that way in Wasm either.) So I’m trying to use examples that are not artificial - just one routine calling another.

The raw improvement in gas cost and the complexity of calling conventions seem obvious to me.

  • 47 gas, 11 instructions reduced to 31 gas, 8 instructions – for an optimal ordinary routine.
  • 32 gas, 7 instructions reduced to 29 gas, 7 instructions – for a tail-optimized routine.

Whether that is enough of a difference to make a difference depends on the program being compiled and how well it is optimized, which is not just a matter of the “typical” Solidity program.

Anyway, given the schedule of upcoming upgrades this EIP has no hope of going in for many months, and would be most valuable as part of a more integrated set of EIPs. Thus I’ve opened discussions at EVM evolution Working Group Formation - #3 by gcolvin.

1 Like