core/vm: removed type destinations

This commit is contained in:
Martin Holst Swende 2018-10-03 14:26:55 +02:00
parent 5d5a01e3f3
commit 843d483240
No known key found for this signature in database
GPG key ID: 683B438C05A5DDF0
2 changed files with 3 additions and 11 deletions

View file

@ -16,14 +16,6 @@
package vm package vm
import (
"github.com/ethereum/go-ethereum/common"
)
// destinations stores one bitmap per contract (keyed by hash of code).
// The bitmaps mark code and data-sections for a piece of contract code
type destinations map[common.Hash]bitvec
// bitvec is a bit vector which maps bytes in a program. // bitvec is a bit vector which maps bytes in a program.
// An unset bit means the byte is an opcode, a set bit means // An unset bit means the byte is an opcode, a set bit means
// it's data (i.e. argument of PUSHxx). // it's data (i.e. argument of PUSHxx).

View file

@ -49,8 +49,8 @@ type Contract struct {
caller ContractRef caller ContractRef
self ContractRef self ContractRef
jumpdests destinations // Aggregated result of JUMPDEST analysis. jumpdests map[common.Hash]bitvec // Aggregated result of JUMPDEST analysis.
analysis bitvec // Locally cached result of JUMPDEST analysis analysis bitvec // Locally cached result of JUMPDEST analysis
Code []byte Code []byte
CodeHash common.Hash CodeHash common.Hash
@ -69,7 +69,7 @@ func NewContract(caller ContractRef, object ContractRef, value *big.Int, gas uin
// Reuse JUMPDEST analysis from parent context if available. // Reuse JUMPDEST analysis from parent context if available.
c.jumpdests = parent.jumpdests c.jumpdests = parent.jumpdests
} else { } else {
c.jumpdests = make(destinations) c.jumpdests = make(map[common.Hash]bitvec)
} }
// Gas should be a pointer so it can safely be reduced through the run // Gas should be a pointer so it can safely be reduced through the run