diff options
author | Leif Jurvetson <leijurv@gmail.com> | 2016-03-16 02:08:18 +0800 |
---|---|---|
committer | Leif Jurvetson <leijurv@gmail.com> | 2016-03-16 02:08:18 +0800 |
commit | b7bb2d8589ddfb4f893c881edb6422bacdb6e53b (patch) | |
tree | 39ab548f4995eab28d26274d0d40cfd7be036915 /core/vm | |
parent | e189fb839c688b418b43ad6533111c246c109a93 (diff) | |
download | go-tangerine-b7bb2d8589ddfb4f893c881edb6422bacdb6e53b.tar go-tangerine-b7bb2d8589ddfb4f893c881edb6422bacdb6e53b.tar.gz go-tangerine-b7bb2d8589ddfb4f893c881edb6422bacdb6e53b.tar.bz2 go-tangerine-b7bb2d8589ddfb4f893c881edb6422bacdb6e53b.tar.lz go-tangerine-b7bb2d8589ddfb4f893c881edb6422bacdb6e53b.tar.xz go-tangerine-b7bb2d8589ddfb4f893c881edb6422bacdb6e53b.tar.zst go-tangerine-b7bb2d8589ddfb4f893c881edb6422bacdb6e53b.zip |
core: various typos
Diffstat (limited to 'core/vm')
-rw-r--r-- | core/vm/asm.go | 2 | ||||
-rw-r--r-- | core/vm/doc.go | 2 | ||||
-rw-r--r-- | core/vm/environment.go | 6 | ||||
-rw-r--r-- | core/vm/jit.go | 6 | ||||
-rw-r--r-- | core/vm/jit_test.go | 2 | ||||
-rw-r--r-- | core/vm/jit_util.go | 2 | ||||
-rw-r--r-- | core/vm/runtime/runtime.go | 2 | ||||
-rw-r--r-- | core/vm/vm.go | 8 | ||||
-rw-r--r-- | core/vm/vm_jit.go | 6 |
9 files changed, 18 insertions, 18 deletions
diff --git a/core/vm/asm.go b/core/vm/asm.go index 065d3eb97..b248838a7 100644 --- a/core/vm/asm.go +++ b/core/vm/asm.go @@ -23,7 +23,7 @@ import ( "github.com/ethereum/go-ethereum/common" ) -// Dissassemble dissassembles the byte code and returns the string +// Disassemble disassembles the byte code and returns the string // representation (human readable opcodes). func Disassemble(script []byte) (asm []string) { pc := new(big.Int) diff --git a/core/vm/doc.go b/core/vm/doc.go index debbdb35e..de7fa6021 100644 --- a/core/vm/doc.go +++ b/core/vm/doc.go @@ -20,7 +20,7 @@ Package vm implements the Ethereum Virtual Machine. The vm package implements two EVMs, a byte code VM and a JIT VM. The BC (Byte Code) VM loops over a set of bytes and executes them according to the set of rules defined in the Ethereum yellow paper. When the BC VM is invoked it -invokes the JIT VM in a seperate goroutine and compiles the byte code in JIT +invokes the JIT VM in a separate goroutine and compiles the byte code in JIT instructions. The JIT VM, when invoked, loops around a set of pre-defined instructions until diff --git a/core/vm/environment.go b/core/vm/environment.go index a58e3ba2b..d5d21a45b 100644 --- a/core/vm/environment.go +++ b/core/vm/environment.go @@ -34,9 +34,9 @@ type Environment interface { MakeSnapshot() Database // Set database to previous snapshot SetSnapshot(Database) - // Address of the original invoker (first occurance of the VM invoker) + // Address of the original invoker (first occurrence of the VM invoker) Origin() common.Address - // The block number this VM is invoken on + // The block number this VM is invoked on BlockNumber() *big.Int // The n'th hash ago from this block number GetHash(uint64) common.Hash @@ -101,7 +101,7 @@ type Database interface { IsDeleted(common.Address) bool } -// StructLog is emited to the Environment each cycle and lists information about the curent internal state +// StructLog is emitted to the Environment each cycle and lists information about the current internal state // prior to the execution of the statement. type StructLog struct { Pc uint64 diff --git a/core/vm/jit.go b/core/vm/jit.go index 5404730c1..71ffcf0f6 100644 --- a/core/vm/jit.go +++ b/core/vm/jit.go @@ -300,7 +300,7 @@ func CompileProgram(program *Program) (err error) { return nil } -// RunProgram runs the program given the enviroment and contract and returns an +// RunProgram runs the program given the environment and contract and returns an // error if the execution failed (non-consensus) func RunProgram(program *Program, env Environment, contract *Contract, input []byte) ([]byte, error) { return runProgram(program, 0, NewMemory(), newstack(), env, contract, input) @@ -346,7 +346,7 @@ func runProgram(program *Program, pcstart uint64, mem *Memory, stack *stack, env return nil, nil } -// validDest checks if the given distination is a valid one given the +// validDest checks if the given destination is a valid one given the // destination table of the program func validDest(dests map[uint64]struct{}, dest *big.Int) bool { // PC cannot go beyond len(code) and certainly can't be bigger than 64bits. @@ -416,7 +416,7 @@ func jitCalculateGasAndSize(env Environment, contract *Contract, instr instructi // This checks for 3 scenario's and calculates gas accordingly // 1. From a zero-value address to a non-zero value (NEW VALUE) // 2. From a non-zero value address to a zero-value address (DELETE) - // 3. From a nen-zero to a non-zero (CHANGE) + // 3. From a non-zero to a non-zero (CHANGE) if common.EmptyHash(val) && !common.EmptyHash(common.BigToHash(y)) { g = params.SstoreSetGas } else if !common.EmptyHash(val) && common.EmptyHash(common.BigToHash(y)) { diff --git a/core/vm/jit_test.go b/core/vm/jit_test.go index 4174c666f..19261827b 100644 --- a/core/vm/jit_test.go +++ b/core/vm/jit_test.go @@ -77,7 +77,7 @@ func TestCompiling(t *testing.T) { } if len(prog.instructions) != 1 { - t.Error("exected 1 compiled instruction, got", len(prog.instructions)) + t.Error("expected 1 compiled instruction, got", len(prog.instructions)) } } diff --git a/core/vm/jit_util.go b/core/vm/jit_util.go index 0d3d6d701..72e9ccf8f 100644 --- a/core/vm/jit_util.go +++ b/core/vm/jit_util.go @@ -41,7 +41,7 @@ func Parse(code []byte) (opcodes []OpCode) { // MatchFn searcher for match in the given input and calls matcheFn if it finds // an appropriate match. matcherFn yields the starting position in the input. -// MatchFn will continue to search for a match until it reacher the end of the +// MatchFn will continue to search for a match until it reaches the end of the // buffer or if matcherFn return false. func MatchFn(input, match []OpCode, matcherFn func(int) bool) { // short circuit if either input or match is empty or if the match is diff --git a/core/vm/runtime/runtime.go b/core/vm/runtime/runtime.go index 565ce7b73..3e6057142 100644 --- a/core/vm/runtime/runtime.go +++ b/core/vm/runtime/runtime.go @@ -27,7 +27,7 @@ import ( "github.com/ethereum/go-ethereum/ethdb" ) -// Config is a basic type specifing certain configuration flags for running +// Config is a basic type specifying certain configuration flags for running // the EVM. type Config struct { Difficulty *big.Int diff --git a/core/vm/vm.go b/core/vm/vm.go index d45d136b5..95d27c64c 100644 --- a/core/vm/vm.go +++ b/core/vm/vm.go @@ -63,7 +63,7 @@ func (self *Vm) Run(contract *Contract, input []byte) (ret []byte, err error) { ) if EnableJit { // If the JIT is enabled check the status of the JIT program, - // if it doesn't exist compile a new program in a seperate + // if it doesn't exist compile a new program in a separate // goroutine or wait for compilation to finish if the JIT is // forced. switch GetProgramStatus(codehash) { @@ -80,7 +80,7 @@ func (self *Vm) Run(contract *Contract, input []byte) (ret []byte, err error) { glog.V(logger.Info).Infoln("error compiling program", err) } else { // create and compile the program. Compilation - // is done in a seperate goroutine + // is done in a separate goroutine program = NewProgram(contract.Code) go func() { err := CompileProgram(program) @@ -103,7 +103,7 @@ func (self *Vm) Run(contract *Contract, input []byte) (ret []byte, err error) { stack = newstack() // local stack statedb = self.env.Db() // current state // For optimisation reason we're using uint64 as the program counter. - // It's theoretically possible to go above 2^64. The YP defines the PC to be uint256. Pratically much less so feasible. + // It's theoretically possible to go above 2^64. The YP defines the PC to be uint256. Practically much less so feasible. pc = uint64(0) // program counter // jump evaluates and checks whether the given jump destination is a valid one @@ -271,7 +271,7 @@ func calculateGasAndSize(env Environment, contract *Contract, caller ContractRef // This checks for 3 scenario's and calculates gas accordingly // 1. From a zero-value address to a non-zero value (NEW VALUE) // 2. From a non-zero value address to a zero-value address (DELETE) - // 3. From a nen-zero to a non-zero (CHANGE) + // 3. From a non-zero to a non-zero (CHANGE) if common.EmptyHash(val) && !common.EmptyHash(common.BigToHash(y)) { // 0 => non 0 g = params.SstoreSetGas diff --git a/core/vm/vm_jit.go b/core/vm/vm_jit.go index 589c30fa8..f6e4a515b 100644 --- a/core/vm/vm_jit.go +++ b/core/vm/vm_jit.go @@ -138,7 +138,7 @@ func llvm2big(m *i256) *big.Int { } // llvm2bytesRef creates a []byte slice that references byte buffer on LLVM side (as of that not controller by GC) -// User must asure that referenced memory is available to Go until the data is copied or not needed any more +// User must ensure that referenced memory is available to Go until the data is copied or not needed any more func llvm2bytesRef(data *byte, length uint64) []byte { if length == 0 { return nil @@ -171,7 +171,7 @@ func (self *JitVm) Run(me, caller ContextRef, code []byte, value, gas, price *bi // TODO: Move it to Env.Call() or sth if Precompiled[string(me.Address())] != nil { - // if it's address of precopiled contract + // if it's address of precompiled contract // fallback to standard VM stdVm := New(self.env) return stdVm.Run(me, caller, code, value, gas, price, callData) @@ -348,7 +348,7 @@ func env_create(_vm unsafe.Pointer, _gas *int64, _value unsafe.Pointer, initData gas := big.NewInt(*_gas) ret, suberr, ref := vm.env.Create(vm.me, nil, initData, gas, vm.price, value) if suberr == nil { - dataGas := big.NewInt(int64(len(ret))) // TODO: Nto the best design. env.Create can do it, it has the reference to gas counter + dataGas := big.NewInt(int64(len(ret))) // TODO: Not the best design. env.Create can do it, it has the reference to gas counter dataGas.Mul(dataGas, params.CreateDataGas) gas.Sub(gas, dataGas) *result = hash2llvm(ref.Address()) |