mirror of
https://github.com/status-im/EIPs.git
synced 2025-02-23 12:18:16 +00:00
Automatically merged updates to draft EIP(s) 2315 (#2510)
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
This commit is contained in:
parent
962cdd4f7e
commit
9eaf4569b2
@ -37,39 +37,42 @@ These changes do not affect the semantics of existing EVM code.
|
||||
|
||||
## Test Cases
|
||||
```
|
||||
offset step op stack
|
||||
0 0 PUSH1 3 []
|
||||
1 1 JUMPSUB [3]
|
||||
2 4 STOP []
|
||||
3 2 JUMPDEST []
|
||||
4 3 RETURNSUB []
|
||||
data return
|
||||
offset step opcode stack stack
|
||||
0 0 PUSH1 3 [] []
|
||||
1 1 JUMPSUB [3] [1]
|
||||
2 4 STOP [] [1]
|
||||
3 2 JUMPDEST [] [1]
|
||||
4 3 RETURNSUB [] []
|
||||
```
|
||||
The above code should terminate after 4 steps with an empty stack.
|
||||
```
|
||||
offset step op stack
|
||||
0 0 PUSH1 2 []
|
||||
1 1 JUMPSUB [2]
|
||||
2 2 JUMPDEST []
|
||||
3 3 RETURNSUB []
|
||||
data return
|
||||
offset step opcode stack stack
|
||||
0 0 PUSH1 2 [] []
|
||||
1 1 JUMPSUB [2] [1]
|
||||
2 2 JUMPDEST [] [1]
|
||||
3 3 RETURNSUB [] []
|
||||
```
|
||||
The above code should terminate after 4 steps with an empty stack.
|
||||
```
|
||||
offset step op stack
|
||||
0 0 PUSH1 2 []
|
||||
1 1 JUMPSUB [3]
|
||||
2 8 STOP []
|
||||
3 2 JUMPDEST []
|
||||
4 3 PUSH1 7 []
|
||||
5 4 JUMPSUB [7]
|
||||
6 7 RETURNSUB []
|
||||
7 5 JUMPDEST []
|
||||
8 6 RETURNSUB []
|
||||
data return
|
||||
offset step opcode stack stack
|
||||
0 0 PUSH1 3 [] []
|
||||
1 1 JUMPSUB [3] [1]
|
||||
2 8 STOP [] []
|
||||
3 2 JUMPDEST [] [1]
|
||||
4 3 PUSH1 7 [] [1]
|
||||
5 4 JUMPSUB [7] [1,5]
|
||||
6 7 RETURNSUB [] [1]
|
||||
7 5 JUMPDEST [] [1]
|
||||
8 6 RETURNSUB [] [1]
|
||||
```
|
||||
The above code should terminate after 8 steps with an empty stack.
|
||||
The above code should terminate after 8 steps with an empty stack. The above code should terminate after 8 steps with an empty stack.
|
||||
|
||||
## Implementations
|
||||
|
||||
No clients have implemented this proposal as of yet, but there is a Draft PR on the [evmone interpreter](https://github.com/ethereum/evmone/pull/229).
|
||||
No clients have implemented this proposal as of yet, but there are Draft PRs on the [evmone](https://github.com/ethereum/evmone/pull/229) and [geth](https://github.com/ethereum/go-ethereum/pull/20619) interpreters.
|
||||
|
||||
The new operators proposed here are demonstrated by the following pseudocode, which in seven lines adds a return stack and cases for `JUMPSUB` and `RETURNSUB` to a simple loop-and-switch interpreter.
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user