core/vm: optimize mstore a bit

This commit is contained in:
Martin Holst Swende 2019-10-23 16:09:27 +02:00
parent 8d39aed22c
commit c9ff3e1680
No known key found for this signature in database
GPG key ID: 683B438C05A5DDF0

View file

@ -602,11 +602,9 @@ func opPop(pc *uint64, interpreter *EVMInterpreter, contract *Contract, memory *
} }
func opMload(pc *uint64, interpreter *EVMInterpreter, contract *Contract, memory *Memory, stack *Stack) ([]byte, error) { func opMload(pc *uint64, interpreter *EVMInterpreter, contract *Contract, memory *Memory, stack *Stack) ([]byte, error) {
offset := stack.pop() v := stack.peek()
val := interpreter.intPool.get().SetBytes(memory.Get(offset.Int64(), 32)) offset := v.Int64()
stack.push(val) v.SetBytes(memory.GetPtr(offset, 32))
interpreter.intPool.put(offset)
return nil, nil return nil, nil
} }