aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm/instructions.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-08-14 22:08:49 +0800
committerPéter Szilágyi <peterke@gmail.com>2017-08-14 22:08:49 +0800
commitf8d8b56b280dd921436fb046dbcaa010ef43122d (patch)
tree8e18333c06d7d6d80798d464e5ca81d029ca74ab /core/vm/instructions.go
parentd8aaa3a215ea19c0ccde2419832ac2bd80d8ddf0 (diff)
downloaddexon-f8d8b56b280dd921436fb046dbcaa010ef43122d.tar.gz
dexon-f8d8b56b280dd921436fb046dbcaa010ef43122d.tar.zst
dexon-f8d8b56b280dd921436fb046dbcaa010ef43122d.zip
core/vm: optimize copy-less data retrievals
Diffstat (limited to 'core/vm/instructions.go')
-rw-r--r--core/vm/instructions.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/vm/instructions.go b/core/vm/instructions.go
index f5164fcdd..4f9e45ffe 100644
--- a/core/vm/instructions.go
+++ b/core/vm/instructions.go
@@ -337,7 +337,7 @@ func opCallValue(pc *uint64, evm *EVM, contract *Contract, memory *Memory, stack
}
func opCalldataLoad(pc *uint64, evm *EVM, contract *Contract, memory *Memory, stack *Stack) ([]byte, error) {
- stack.push(new(big.Int).SetBytes(getData(contract.Input, stack.pop(), common.Big32)))
+ stack.push(new(big.Int).SetBytes(getDataBig(contract.Input, stack.pop(), big32)))
return nil, nil
}
@@ -352,7 +352,7 @@ func opCalldataCopy(pc *uint64, evm *EVM, contract *Contract, memory *Memory, st
cOff = stack.pop()
l = stack.pop()
)
- memory.Set(mOff.Uint64(), l.Uint64(), getData(contract.Input, cOff, l))
+ memory.Set(mOff.Uint64(), l.Uint64(), getDataBig(contract.Input, cOff, l))
evm.interpreter.intPool.put(mOff, cOff, l)
return nil, nil
@@ -380,7 +380,7 @@ func opCodeCopy(pc *uint64, evm *EVM, contract *Contract, memory *Memory, stack
cOff = stack.pop()
l = stack.pop()
)
- codeCopy := getData(contract.Code, cOff, l)
+ codeCopy := getDataBig(contract.Code, cOff, l)
memory.Set(mOff.Uint64(), l.Uint64(), codeCopy)
@@ -395,7 +395,7 @@ func opExtCodeCopy(pc *uint64, evm *EVM, contract *Contract, memory *Memory, sta
cOff = stack.pop()
l = stack.pop()
)
- codeCopy := getData(evm.StateDB.GetCode(addr), cOff, l)
+ codeCopy := getDataBig(evm.StateDB.GetCode(addr), cOff, l)
memory.Set(mOff.Uint64(), l.Uint64(), codeCopy)