Skip to content

Commit 8dc8941

Browse files
authored
core/vm: use a callcontext struct (#20761)
* core/vm: use a callcontext struct * core/vm: fix tests * core/vm/runtime: benchmark * core/vm: make intpool push inlineable, unexpose callcontext
1 parent 0bec6a4 commit 8dc8941

File tree

7 files changed

+349
-292
lines changed

7 files changed

+349
-292
lines changed

core/vm/eips.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ func enable1884(jt *JumpTable) {
6060
}
6161
}
6262

63-
func opSelfBalance(pc *uint64, interpreter *EVMInterpreter, contract *Contract, memory *Memory, stack *Stack) ([]byte, error) {
64-
balance := interpreter.intPool.get().Set(interpreter.evm.StateDB.GetBalance(contract.Address()))
65-
stack.push(balance)
63+
func opSelfBalance(pc *uint64, interpreter *EVMInterpreter, callContext *callCtx) ([]byte, error) {
64+
balance := interpreter.intPool.get().Set(interpreter.evm.StateDB.GetBalance(callContext.contract.Address()))
65+
callContext.stack.push(balance)
6666
return nil, nil
6767
}
6868

@@ -80,9 +80,9 @@ func enable1344(jt *JumpTable) {
8080
}
8181

8282
// opChainID implements CHAINID opcode
83-
func opChainID(pc *uint64, interpreter *EVMInterpreter, contract *Contract, memory *Memory, stack *Stack) ([]byte, error) {
83+
func opChainID(pc *uint64, interpreter *EVMInterpreter, callContext *callCtx) ([]byte, error) {
8484
chainId := interpreter.intPool.get().Set(interpreter.evm.chainConfig.ChainID)
85-
stack.push(chainId)
85+
callContext.stack.push(chainId)
8686
return nil, nil
8787
}
8888

0 commit comments

Comments
 (0)