Skip to content

Commit

Permalink
Automatically merged updates to draft EIP(s) 2315 (ethereum#2527)
Browse files Browse the repository at this point in the history
Hi, I'm a bot! This change was automatically merged because:

 - It only modifies existing Draft or Last Call EIP(s)
 - The PR was approved or written by at least one author of each modified EIP
 - The build is passing
  • Loading branch information
gcolvin authored and tkstanczak committed Nov 7, 2020
1 parent 9ed8e20 commit d1ac906
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions EIPS/eip-2315.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,28 +138,32 @@ contract fun {
```
Here is solc 0.6.3 assembly code with labeled destinations.
```
TEST:
TEST:
jumpdest
0x00
RTN
0x02
0x03
TEST_MUL
jump
TEST_MUL:
TEST_MUL:
jumpdest
0x00
RTN
dup4
dup4
MULTIPLY
jump
RTN:
RTN:
jumpdest
swap4
swap3
pop
pop
pop
jump
MULTIPLY:
MULTIPLY:
jumpdest
mul
swap1
jump
Expand All @@ -168,17 +172,20 @@ solc does a good job with the multiply() function, which is a leaf. Non-leaf fu

This is the same code written using `jumpsub` and `returnsub`. Calling `fun.test()` will cost _34 gas_ (plus 5).
```
TEST:
TEST:
beginsub
0x02
0x03
TEST_MUL
jumpsub
returnsub
TEST_MUL:
TEST_MUL:
beginsub
MULTIPLY
jumpsub
returnsub
MULTIPLY:
MULTIPLY:
beginsub
mul
returnsub
```
Expand Down

0 comments on commit d1ac906

Please sign in to comment.