github.com/yinchengtsinghua/golang-Eos-dpos-Ethereum@v0.0.0-20190121132951-92cc4225ed8e/core/vm/jump_table.go (about)

     1  
     2  //此源码被清华学神尹成大魔王专业翻译分析并修改
     3  //尹成QQ77025077
     4  //尹成微信18510341407
     5  //尹成所在QQ群721929980
     6  //尹成邮箱 yinc13@mails.tsinghua.edu.cn
     7  //尹成毕业于清华大学,微软区块链领域全球最有价值专家
     8  //https://mvp.microsoft.com/zh-cn/PublicProfile/4033620
     9  //版权所有2015 Go Ethereum作者
    10  //此文件是Go以太坊库的一部分。
    11  //
    12  //Go-Ethereum库是免费软件:您可以重新分发它和/或修改
    13  //根据GNU发布的较低通用公共许可证的条款
    14  //自由软件基金会,或者许可证的第3版,或者
    15  //(由您选择)任何更高版本。
    16  //
    17  //Go以太坊图书馆的发行目的是希望它会有用,
    18  //但没有任何保证;甚至没有
    19  //适销性或特定用途的适用性。见
    20  //GNU较低的通用公共许可证,了解更多详细信息。
    21  //
    22  //你应该收到一份GNU较低级别的公共许可证副本
    23  //以及Go以太坊图书馆。如果没有,请参见<http://www.gnu.org/licenses/>。
    24  
    25  package vm
    26  
    27  import (
    28  	"errors"
    29  	"math/big"
    30  
    31  	"github.com/ethereum/go-ethereum/params"
    32  )
    33  
    34  type (
    35  	executionFunc       func(pc *uint64, interpreter *EVMInterpreter, contract *Contract, memory *Memory, stack *Stack) ([]byte, error)
    36  gasFunc             func(params.GasTable, *EVM, *Contract, *Stack, *Memory, uint64) (uint64, error) //最后一个参数是作为uint64请求的内存大小
    37  	stackValidationFunc func(*Stack) error
    38  	memorySizeFunc      func(*Stack) *big.Int
    39  )
    40  
    41  var errGasUintOverflow = errors.New("gas uint64 overflow")
    42  
    43  type operation struct {
    44  //执行是操作功能
    45  	execute executionFunc
    46  //gascost是gas函数,返回执行所需的气体。
    47  	gasCost gasFunc
    48  //validatestack验证操作的堆栈(大小)
    49  	validateStack stackValidationFunc
    50  //memory size返回操作所需的内存大小
    51  	memorySize memorySizeFunc
    52  
    53  halts   bool //指示操作是否应停止进一步执行
    54  jumps   bool //指示程序计数器是否不应递增
    55  writes  bool //确定此操作是否为状态修改操作
    56  valid   bool //指示检索到的操作是否有效和已知
    57  reverts bool //确定操作是否还原状态(隐式停止)
    58  returns bool //确定操作是否设置返回数据内容。
    59  }
    60  
    61  var (
    62  	frontierInstructionSet       = newFrontierInstructionSet()
    63  	homesteadInstructionSet      = newHomesteadInstructionSet()
    64  	byzantiumInstructionSet      = newByzantiumInstructionSet()
    65  	constantinopleInstructionSet = newConstantinopleInstructionSet()
    66  )
    67  
    68  //NewConstantinopleinstructionset返回边界,宅基地
    69  //拜占庭和康坦丁堡的指示。
    70  func newConstantinopleInstructionSet() [256]operation {
    71  //可以在拜占庭阶段执行的指令。
    72  	instructionSet := newByzantiumInstructionSet()
    73  	instructionSet[SHL] = operation{
    74  		execute:       opSHL,
    75  		gasCost:       constGasFunc(GasFastestStep),
    76  		validateStack: makeStackFunc(2, 1),
    77  		valid:         true,
    78  	}
    79  	instructionSet[SHR] = operation{
    80  		execute:       opSHR,
    81  		gasCost:       constGasFunc(GasFastestStep),
    82  		validateStack: makeStackFunc(2, 1),
    83  		valid:         true,
    84  	}
    85  	instructionSet[SAR] = operation{
    86  		execute:       opSAR,
    87  		gasCost:       constGasFunc(GasFastestStep),
    88  		validateStack: makeStackFunc(2, 1),
    89  		valid:         true,
    90  	}
    91  	instructionSet[EXTCODEHASH] = operation{
    92  		execute:       opExtCodeHash,
    93  		gasCost:       gasExtCodeHash,
    94  		validateStack: makeStackFunc(1, 1),
    95  		valid:         true,
    96  	}
    97  	instructionSet[CREATE2] = operation{
    98  		execute:       opCreate2,
    99  		gasCost:       gasCreate2,
   100  		validateStack: makeStackFunc(4, 1),
   101  		memorySize:    memoryCreate2,
   102  		valid:         true,
   103  		writes:        true,
   104  		returns:       true,
   105  	}
   106  	return instructionSet
   107  }
   108  
   109  //Newyzantiuminstructionset返回边界、宅基地和
   110  //拜占庭指示。
   111  func newByzantiumInstructionSet() [256]operation {
   112  //可在宅基地阶段执行的指令。
   113  	instructionSet := newHomesteadInstructionSet()
   114  	instructionSet[STATICCALL] = operation{
   115  		execute:       opStaticCall,
   116  		gasCost:       gasStaticCall,
   117  		validateStack: makeStackFunc(6, 1),
   118  		memorySize:    memoryStaticCall,
   119  		valid:         true,
   120  		returns:       true,
   121  	}
   122  	instructionSet[RETURNDATASIZE] = operation{
   123  		execute:       opReturnDataSize,
   124  		gasCost:       constGasFunc(GasQuickStep),
   125  		validateStack: makeStackFunc(0, 1),
   126  		valid:         true,
   127  	}
   128  	instructionSet[RETURNDATACOPY] = operation{
   129  		execute:       opReturnDataCopy,
   130  		gasCost:       gasReturnDataCopy,
   131  		validateStack: makeStackFunc(3, 0),
   132  		memorySize:    memoryReturnDataCopy,
   133  		valid:         true,
   134  	}
   135  	instructionSet[REVERT] = operation{
   136  		execute:       opRevert,
   137  		gasCost:       gasRevert,
   138  		validateStack: makeStackFunc(2, 0),
   139  		memorySize:    memoryRevert,
   140  		valid:         true,
   141  		reverts:       true,
   142  		returns:       true,
   143  	}
   144  	return instructionSet
   145  }
   146  
   147  //新宅基地结构集返回边界和宅基地
   148  //可在宅基地阶段执行的指令。
   149  func newHomesteadInstructionSet() [256]operation {
   150  	instructionSet := newFrontierInstructionSet()
   151  	instructionSet[DELEGATECALL] = operation{
   152  		execute:       opDelegateCall,
   153  		gasCost:       gasDelegateCall,
   154  		validateStack: makeStackFunc(6, 1),
   155  		memorySize:    memoryDelegateCall,
   156  		valid:         true,
   157  		returns:       true,
   158  	}
   159  	return instructionSet
   160  }
   161  
   162  //newfrontierinstructionset返回frontier指令
   163  //可以在边境阶段执行。
   164  func newFrontierInstructionSet() [256]operation {
   165  	return [256]operation{
   166  		STOP: {
   167  			execute:       opStop,
   168  			gasCost:       constGasFunc(0),
   169  			validateStack: makeStackFunc(0, 0),
   170  			halts:         true,
   171  			valid:         true,
   172  		},
   173  		ADD: {
   174  			execute:       opAdd,
   175  			gasCost:       constGasFunc(GasFastestStep),
   176  			validateStack: makeStackFunc(2, 1),
   177  			valid:         true,
   178  		},
   179  		MUL: {
   180  			execute:       opMul,
   181  			gasCost:       constGasFunc(GasFastStep),
   182  			validateStack: makeStackFunc(2, 1),
   183  			valid:         true,
   184  		},
   185  		SUB: {
   186  			execute:       opSub,
   187  			gasCost:       constGasFunc(GasFastestStep),
   188  			validateStack: makeStackFunc(2, 1),
   189  			valid:         true,
   190  		},
   191  		DIV: {
   192  			execute:       opDiv,
   193  			gasCost:       constGasFunc(GasFastStep),
   194  			validateStack: makeStackFunc(2, 1),
   195  			valid:         true,
   196  		},
   197  		SDIV: {
   198  			execute:       opSdiv,
   199  			gasCost:       constGasFunc(GasFastStep),
   200  			validateStack: makeStackFunc(2, 1),
   201  			valid:         true,
   202  		},
   203  		MOD: {
   204  			execute:       opMod,
   205  			gasCost:       constGasFunc(GasFastStep),
   206  			validateStack: makeStackFunc(2, 1),
   207  			valid:         true,
   208  		},
   209  		SMOD: {
   210  			execute:       opSmod,
   211  			gasCost:       constGasFunc(GasFastStep),
   212  			validateStack: makeStackFunc(2, 1),
   213  			valid:         true,
   214  		},
   215  		ADDMOD: {
   216  			execute:       opAddmod,
   217  			gasCost:       constGasFunc(GasMidStep),
   218  			validateStack: makeStackFunc(3, 1),
   219  			valid:         true,
   220  		},
   221  		MULMOD: {
   222  			execute:       opMulmod,
   223  			gasCost:       constGasFunc(GasMidStep),
   224  			validateStack: makeStackFunc(3, 1),
   225  			valid:         true,
   226  		},
   227  		EXP: {
   228  			execute:       opExp,
   229  			gasCost:       gasExp,
   230  			validateStack: makeStackFunc(2, 1),
   231  			valid:         true,
   232  		},
   233  		SIGNEXTEND: {
   234  			execute:       opSignExtend,
   235  			gasCost:       constGasFunc(GasFastStep),
   236  			validateStack: makeStackFunc(2, 1),
   237  			valid:         true,
   238  		},
   239  		LT: {
   240  			execute:       opLt,
   241  			gasCost:       constGasFunc(GasFastestStep),
   242  			validateStack: makeStackFunc(2, 1),
   243  			valid:         true,
   244  		},
   245  		GT: {
   246  			execute:       opGt,
   247  			gasCost:       constGasFunc(GasFastestStep),
   248  			validateStack: makeStackFunc(2, 1),
   249  			valid:         true,
   250  		},
   251  		SLT: {
   252  			execute:       opSlt,
   253  			gasCost:       constGasFunc(GasFastestStep),
   254  			validateStack: makeStackFunc(2, 1),
   255  			valid:         true,
   256  		},
   257  		SGT: {
   258  			execute:       opSgt,
   259  			gasCost:       constGasFunc(GasFastestStep),
   260  			validateStack: makeStackFunc(2, 1),
   261  			valid:         true,
   262  		},
   263  		EQ: {
   264  			execute:       opEq,
   265  			gasCost:       constGasFunc(GasFastestStep),
   266  			validateStack: makeStackFunc(2, 1),
   267  			valid:         true,
   268  		},
   269  		ISZERO: {
   270  			execute:       opIszero,
   271  			gasCost:       constGasFunc(GasFastestStep),
   272  			validateStack: makeStackFunc(1, 1),
   273  			valid:         true,
   274  		},
   275  		AND: {
   276  			execute:       opAnd,
   277  			gasCost:       constGasFunc(GasFastestStep),
   278  			validateStack: makeStackFunc(2, 1),
   279  			valid:         true,
   280  		},
   281  		XOR: {
   282  			execute:       opXor,
   283  			gasCost:       constGasFunc(GasFastestStep),
   284  			validateStack: makeStackFunc(2, 1),
   285  			valid:         true,
   286  		},
   287  		OR: {
   288  			execute:       opOr,
   289  			gasCost:       constGasFunc(GasFastestStep),
   290  			validateStack: makeStackFunc(2, 1),
   291  			valid:         true,
   292  		},
   293  		NOT: {
   294  			execute:       opNot,
   295  			gasCost:       constGasFunc(GasFastestStep),
   296  			validateStack: makeStackFunc(1, 1),
   297  			valid:         true,
   298  		},
   299  		BYTE: {
   300  			execute:       opByte,
   301  			gasCost:       constGasFunc(GasFastestStep),
   302  			validateStack: makeStackFunc(2, 1),
   303  			valid:         true,
   304  		},
   305  		SHA3: {
   306  			execute:       opSha3,
   307  			gasCost:       gasSha3,
   308  			validateStack: makeStackFunc(2, 1),
   309  			memorySize:    memorySha3,
   310  			valid:         true,
   311  		},
   312  		ADDRESS: {
   313  			execute:       opAddress,
   314  			gasCost:       constGasFunc(GasQuickStep),
   315  			validateStack: makeStackFunc(0, 1),
   316  			valid:         true,
   317  		},
   318  		BALANCE: {
   319  			execute:       opBalance,
   320  			gasCost:       gasBalance,
   321  			validateStack: makeStackFunc(1, 1),
   322  			valid:         true,
   323  		},
   324  		ORIGIN: {
   325  			execute:       opOrigin,
   326  			gasCost:       constGasFunc(GasQuickStep),
   327  			validateStack: makeStackFunc(0, 1),
   328  			valid:         true,
   329  		},
   330  		CALLER: {
   331  			execute:       opCaller,
   332  			gasCost:       constGasFunc(GasQuickStep),
   333  			validateStack: makeStackFunc(0, 1),
   334  			valid:         true,
   335  		},
   336  		CALLVALUE: {
   337  			execute:       opCallValue,
   338  			gasCost:       constGasFunc(GasQuickStep),
   339  			validateStack: makeStackFunc(0, 1),
   340  			valid:         true,
   341  		},
   342  		CALLDATALOAD: {
   343  			execute:       opCallDataLoad,
   344  			gasCost:       constGasFunc(GasFastestStep),
   345  			validateStack: makeStackFunc(1, 1),
   346  			valid:         true,
   347  		},
   348  		CALLDATASIZE: {
   349  			execute:       opCallDataSize,
   350  			gasCost:       constGasFunc(GasQuickStep),
   351  			validateStack: makeStackFunc(0, 1),
   352  			valid:         true,
   353  		},
   354  		CALLDATACOPY: {
   355  			execute:       opCallDataCopy,
   356  			gasCost:       gasCallDataCopy,
   357  			validateStack: makeStackFunc(3, 0),
   358  			memorySize:    memoryCallDataCopy,
   359  			valid:         true,
   360  		},
   361  		CODESIZE: {
   362  			execute:       opCodeSize,
   363  			gasCost:       constGasFunc(GasQuickStep),
   364  			validateStack: makeStackFunc(0, 1),
   365  			valid:         true,
   366  		},
   367  		CODECOPY: {
   368  			execute:       opCodeCopy,
   369  			gasCost:       gasCodeCopy,
   370  			validateStack: makeStackFunc(3, 0),
   371  			memorySize:    memoryCodeCopy,
   372  			valid:         true,
   373  		},
   374  		GASPRICE: {
   375  			execute:       opGasprice,
   376  			gasCost:       constGasFunc(GasQuickStep),
   377  			validateStack: makeStackFunc(0, 1),
   378  			valid:         true,
   379  		},
   380  		EXTCODESIZE: {
   381  			execute:       opExtCodeSize,
   382  			gasCost:       gasExtCodeSize,
   383  			validateStack: makeStackFunc(1, 1),
   384  			valid:         true,
   385  		},
   386  		EXTCODECOPY: {
   387  			execute:       opExtCodeCopy,
   388  			gasCost:       gasExtCodeCopy,
   389  			validateStack: makeStackFunc(4, 0),
   390  			memorySize:    memoryExtCodeCopy,
   391  			valid:         true,
   392  		},
   393  		BLOCKHASH: {
   394  			execute:       opBlockhash,
   395  			gasCost:       constGasFunc(GasExtStep),
   396  			validateStack: makeStackFunc(1, 1),
   397  			valid:         true,
   398  		},
   399  		COINBASE: {
   400  			execute:       opCoinbase,
   401  			gasCost:       constGasFunc(GasQuickStep),
   402  			validateStack: makeStackFunc(0, 1),
   403  			valid:         true,
   404  		},
   405  		TIMESTAMP: {
   406  			execute:       opTimestamp,
   407  			gasCost:       constGasFunc(GasQuickStep),
   408  			validateStack: makeStackFunc(0, 1),
   409  			valid:         true,
   410  		},
   411  		NUMBER: {
   412  			execute:       opNumber,
   413  			gasCost:       constGasFunc(GasQuickStep),
   414  			validateStack: makeStackFunc(0, 1),
   415  			valid:         true,
   416  		},
   417  		DIFFICULTY: {
   418  			execute:       opDifficulty,
   419  			gasCost:       constGasFunc(GasQuickStep),
   420  			validateStack: makeStackFunc(0, 1),
   421  			valid:         true,
   422  		},
   423  		GASLIMIT: {
   424  			execute:       opGasLimit,
   425  			gasCost:       constGasFunc(GasQuickStep),
   426  			validateStack: makeStackFunc(0, 1),
   427  			valid:         true,
   428  		},
   429  		POP: {
   430  			execute:       opPop,
   431  			gasCost:       constGasFunc(GasQuickStep),
   432  			validateStack: makeStackFunc(1, 0),
   433  			valid:         true,
   434  		},
   435  		MLOAD: {
   436  			execute:       opMload,
   437  			gasCost:       gasMLoad,
   438  			validateStack: makeStackFunc(1, 1),
   439  			memorySize:    memoryMLoad,
   440  			valid:         true,
   441  		},
   442  		MSTORE: {
   443  			execute:       opMstore,
   444  			gasCost:       gasMStore,
   445  			validateStack: makeStackFunc(2, 0),
   446  			memorySize:    memoryMStore,
   447  			valid:         true,
   448  		},
   449  		MSTORE8: {
   450  			execute:       opMstore8,
   451  			gasCost:       gasMStore8,
   452  			memorySize:    memoryMStore8,
   453  			validateStack: makeStackFunc(2, 0),
   454  
   455  			valid: true,
   456  		},
   457  		SLOAD: {
   458  			execute:       opSload,
   459  			gasCost:       gasSLoad,
   460  			validateStack: makeStackFunc(1, 1),
   461  			valid:         true,
   462  		},
   463  		SSTORE: {
   464  			execute:       opSstore,
   465  			gasCost:       gasSStore,
   466  			validateStack: makeStackFunc(2, 0),
   467  			valid:         true,
   468  			writes:        true,
   469  		},
   470  		JUMP: {
   471  			execute:       opJump,
   472  			gasCost:       constGasFunc(GasMidStep),
   473  			validateStack: makeStackFunc(1, 0),
   474  			jumps:         true,
   475  			valid:         true,
   476  		},
   477  		JUMPI: {
   478  			execute:       opJumpi,
   479  			gasCost:       constGasFunc(GasSlowStep),
   480  			validateStack: makeStackFunc(2, 0),
   481  			jumps:         true,
   482  			valid:         true,
   483  		},
   484  		PC: {
   485  			execute:       opPc,
   486  			gasCost:       constGasFunc(GasQuickStep),
   487  			validateStack: makeStackFunc(0, 1),
   488  			valid:         true,
   489  		},
   490  		MSIZE: {
   491  			execute:       opMsize,
   492  			gasCost:       constGasFunc(GasQuickStep),
   493  			validateStack: makeStackFunc(0, 1),
   494  			valid:         true,
   495  		},
   496  		GAS: {
   497  			execute:       opGas,
   498  			gasCost:       constGasFunc(GasQuickStep),
   499  			validateStack: makeStackFunc(0, 1),
   500  			valid:         true,
   501  		},
   502  		JUMPDEST: {
   503  			execute:       opJumpdest,
   504  			gasCost:       constGasFunc(params.JumpdestGas),
   505  			validateStack: makeStackFunc(0, 0),
   506  			valid:         true,
   507  		},
   508  		PUSH1: {
   509  			execute:       makePush(1, 1),
   510  			gasCost:       gasPush,
   511  			validateStack: makeStackFunc(0, 1),
   512  			valid:         true,
   513  		},
   514  		PUSH2: {
   515  			execute:       makePush(2, 2),
   516  			gasCost:       gasPush,
   517  			validateStack: makeStackFunc(0, 1),
   518  			valid:         true,
   519  		},
   520  		PUSH3: {
   521  			execute:       makePush(3, 3),
   522  			gasCost:       gasPush,
   523  			validateStack: makeStackFunc(0, 1),
   524  			valid:         true,
   525  		},
   526  		PUSH4: {
   527  			execute:       makePush(4, 4),
   528  			gasCost:       gasPush,
   529  			validateStack: makeStackFunc(0, 1),
   530  			valid:         true,
   531  		},
   532  		PUSH5: {
   533  			execute:       makePush(5, 5),
   534  			gasCost:       gasPush,
   535  			validateStack: makeStackFunc(0, 1),
   536  			valid:         true,
   537  		},
   538  		PUSH6: {
   539  			execute:       makePush(6, 6),
   540  			gasCost:       gasPush,
   541  			validateStack: makeStackFunc(0, 1),
   542  			valid:         true,
   543  		},
   544  		PUSH7: {
   545  			execute:       makePush(7, 7),
   546  			gasCost:       gasPush,
   547  			validateStack: makeStackFunc(0, 1),
   548  			valid:         true,
   549  		},
   550  		PUSH8: {
   551  			execute:       makePush(8, 8),
   552  			gasCost:       gasPush,
   553  			validateStack: makeStackFunc(0, 1),
   554  			valid:         true,
   555  		},
   556  		PUSH9: {
   557  			execute:       makePush(9, 9),
   558  			gasCost:       gasPush,
   559  			validateStack: makeStackFunc(0, 1),
   560  			valid:         true,
   561  		},
   562  		PUSH10: {
   563  			execute:       makePush(10, 10),
   564  			gasCost:       gasPush,
   565  			validateStack: makeStackFunc(0, 1),
   566  			valid:         true,
   567  		},
   568  		PUSH11: {
   569  			execute:       makePush(11, 11),
   570  			gasCost:       gasPush,
   571  			validateStack: makeStackFunc(0, 1),
   572  			valid:         true,
   573  		},
   574  		PUSH12: {
   575  			execute:       makePush(12, 12),
   576  			gasCost:       gasPush,
   577  			validateStack: makeStackFunc(0, 1),
   578  			valid:         true,
   579  		},
   580  		PUSH13: {
   581  			execute:       makePush(13, 13),
   582  			gasCost:       gasPush,
   583  			validateStack: makeStackFunc(0, 1),
   584  			valid:         true,
   585  		},
   586  		PUSH14: {
   587  			execute:       makePush(14, 14),
   588  			gasCost:       gasPush,
   589  			validateStack: makeStackFunc(0, 1),
   590  			valid:         true,
   591  		},
   592  		PUSH15: {
   593  			execute:       makePush(15, 15),
   594  			gasCost:       gasPush,
   595  			validateStack: makeStackFunc(0, 1),
   596  			valid:         true,
   597  		},
   598  		PUSH16: {
   599  			execute:       makePush(16, 16),
   600  			gasCost:       gasPush,
   601  			validateStack: makeStackFunc(0, 1),
   602  			valid:         true,
   603  		},
   604  		PUSH17: {
   605  			execute:       makePush(17, 17),
   606  			gasCost:       gasPush,
   607  			validateStack: makeStackFunc(0, 1),
   608  			valid:         true,
   609  		},
   610  		PUSH18: {
   611  			execute:       makePush(18, 18),
   612  			gasCost:       gasPush,
   613  			validateStack: makeStackFunc(0, 1),
   614  			valid:         true,
   615  		},
   616  		PUSH19: {
   617  			execute:       makePush(19, 19),
   618  			gasCost:       gasPush,
   619  			validateStack: makeStackFunc(0, 1),
   620  			valid:         true,
   621  		},
   622  		PUSH20: {
   623  			execute:       makePush(20, 20),
   624  			gasCost:       gasPush,
   625  			validateStack: makeStackFunc(0, 1),
   626  			valid:         true,
   627  		},
   628  		PUSH21: {
   629  			execute:       makePush(21, 21),
   630  			gasCost:       gasPush,
   631  			validateStack: makeStackFunc(0, 1),
   632  			valid:         true,
   633  		},
   634  		PUSH22: {
   635  			execute:       makePush(22, 22),
   636  			gasCost:       gasPush,
   637  			validateStack: makeStackFunc(0, 1),
   638  			valid:         true,
   639  		},
   640  		PUSH23: {
   641  			execute:       makePush(23, 23),
   642  			gasCost:       gasPush,
   643  			validateStack: makeStackFunc(0, 1),
   644  			valid:         true,
   645  		},
   646  		PUSH24: {
   647  			execute:       makePush(24, 24),
   648  			gasCost:       gasPush,
   649  			validateStack: makeStackFunc(0, 1),
   650  			valid:         true,
   651  		},
   652  		PUSH25: {
   653  			execute:       makePush(25, 25),
   654  			gasCost:       gasPush,
   655  			validateStack: makeStackFunc(0, 1),
   656  			valid:         true,
   657  		},
   658  		PUSH26: {
   659  			execute:       makePush(26, 26),
   660  			gasCost:       gasPush,
   661  			validateStack: makeStackFunc(0, 1),
   662  			valid:         true,
   663  		},
   664  		PUSH27: {
   665  			execute:       makePush(27, 27),
   666  			gasCost:       gasPush,
   667  			validateStack: makeStackFunc(0, 1),
   668  			valid:         true,
   669  		},
   670  		PUSH28: {
   671  			execute:       makePush(28, 28),
   672  			gasCost:       gasPush,
   673  			validateStack: makeStackFunc(0, 1),
   674  			valid:         true,
   675  		},
   676  		PUSH29: {
   677  			execute:       makePush(29, 29),
   678  			gasCost:       gasPush,
   679  			validateStack: makeStackFunc(0, 1),
   680  			valid:         true,
   681  		},
   682  		PUSH30: {
   683  			execute:       makePush(30, 30),
   684  			gasCost:       gasPush,
   685  			validateStack: makeStackFunc(0, 1),
   686  			valid:         true,
   687  		},
   688  		PUSH31: {
   689  			execute:       makePush(31, 31),
   690  			gasCost:       gasPush,
   691  			validateStack: makeStackFunc(0, 1),
   692  			valid:         true,
   693  		},
   694  		PUSH32: {
   695  			execute:       makePush(32, 32),
   696  			gasCost:       gasPush,
   697  			validateStack: makeStackFunc(0, 1),
   698  			valid:         true,
   699  		},
   700  		DUP1: {
   701  			execute:       makeDup(1),
   702  			gasCost:       gasDup,
   703  			validateStack: makeDupStackFunc(1),
   704  			valid:         true,
   705  		},
   706  		DUP2: {
   707  			execute:       makeDup(2),
   708  			gasCost:       gasDup,
   709  			validateStack: makeDupStackFunc(2),
   710  			valid:         true,
   711  		},
   712  		DUP3: {
   713  			execute:       makeDup(3),
   714  			gasCost:       gasDup,
   715  			validateStack: makeDupStackFunc(3),
   716  			valid:         true,
   717  		},
   718  		DUP4: {
   719  			execute:       makeDup(4),
   720  			gasCost:       gasDup,
   721  			validateStack: makeDupStackFunc(4),
   722  			valid:         true,
   723  		},
   724  		DUP5: {
   725  			execute:       makeDup(5),
   726  			gasCost:       gasDup,
   727  			validateStack: makeDupStackFunc(5),
   728  			valid:         true,
   729  		},
   730  		DUP6: {
   731  			execute:       makeDup(6),
   732  			gasCost:       gasDup,
   733  			validateStack: makeDupStackFunc(6),
   734  			valid:         true,
   735  		},
   736  		DUP7: {
   737  			execute:       makeDup(7),
   738  			gasCost:       gasDup,
   739  			validateStack: makeDupStackFunc(7),
   740  			valid:         true,
   741  		},
   742  		DUP8: {
   743  			execute:       makeDup(8),
   744  			gasCost:       gasDup,
   745  			validateStack: makeDupStackFunc(8),
   746  			valid:         true,
   747  		},
   748  		DUP9: {
   749  			execute:       makeDup(9),
   750  			gasCost:       gasDup,
   751  			validateStack: makeDupStackFunc(9),
   752  			valid:         true,
   753  		},
   754  		DUP10: {
   755  			execute:       makeDup(10),
   756  			gasCost:       gasDup,
   757  			validateStack: makeDupStackFunc(10),
   758  			valid:         true,
   759  		},
   760  		DUP11: {
   761  			execute:       makeDup(11),
   762  			gasCost:       gasDup,
   763  			validateStack: makeDupStackFunc(11),
   764  			valid:         true,
   765  		},
   766  		DUP12: {
   767  			execute:       makeDup(12),
   768  			gasCost:       gasDup,
   769  			validateStack: makeDupStackFunc(12),
   770  			valid:         true,
   771  		},
   772  		DUP13: {
   773  			execute:       makeDup(13),
   774  			gasCost:       gasDup,
   775  			validateStack: makeDupStackFunc(13),
   776  			valid:         true,
   777  		},
   778  		DUP14: {
   779  			execute:       makeDup(14),
   780  			gasCost:       gasDup,
   781  			validateStack: makeDupStackFunc(14),
   782  			valid:         true,
   783  		},
   784  		DUP15: {
   785  			execute:       makeDup(15),
   786  			gasCost:       gasDup,
   787  			validateStack: makeDupStackFunc(15),
   788  			valid:         true,
   789  		},
   790  		DUP16: {
   791  			execute:       makeDup(16),
   792  			gasCost:       gasDup,
   793  			validateStack: makeDupStackFunc(16),
   794  			valid:         true,
   795  		},
   796  		SWAP1: {
   797  			execute:       makeSwap(1),
   798  			gasCost:       gasSwap,
   799  			validateStack: makeSwapStackFunc(2),
   800  			valid:         true,
   801  		},
   802  		SWAP2: {
   803  			execute:       makeSwap(2),
   804  			gasCost:       gasSwap,
   805  			validateStack: makeSwapStackFunc(3),
   806  			valid:         true,
   807  		},
   808  		SWAP3: {
   809  			execute:       makeSwap(3),
   810  			gasCost:       gasSwap,
   811  			validateStack: makeSwapStackFunc(4),
   812  			valid:         true,
   813  		},
   814  		SWAP4: {
   815  			execute:       makeSwap(4),
   816  			gasCost:       gasSwap,
   817  			validateStack: makeSwapStackFunc(5),
   818  			valid:         true,
   819  		},
   820  		SWAP5: {
   821  			execute:       makeSwap(5),
   822  			gasCost:       gasSwap,
   823  			validateStack: makeSwapStackFunc(6),
   824  			valid:         true,
   825  		},
   826  		SWAP6: {
   827  			execute:       makeSwap(6),
   828  			gasCost:       gasSwap,
   829  			validateStack: makeSwapStackFunc(7),
   830  			valid:         true,
   831  		},
   832  		SWAP7: {
   833  			execute:       makeSwap(7),
   834  			gasCost:       gasSwap,
   835  			validateStack: makeSwapStackFunc(8),
   836  			valid:         true,
   837  		},
   838  		SWAP8: {
   839  			execute:       makeSwap(8),
   840  			gasCost:       gasSwap,
   841  			validateStack: makeSwapStackFunc(9),
   842  			valid:         true,
   843  		},
   844  		SWAP9: {
   845  			execute:       makeSwap(9),
   846  			gasCost:       gasSwap,
   847  			validateStack: makeSwapStackFunc(10),
   848  			valid:         true,
   849  		},
   850  		SWAP10: {
   851  			execute:       makeSwap(10),
   852  			gasCost:       gasSwap,
   853  			validateStack: makeSwapStackFunc(11),
   854  			valid:         true,
   855  		},
   856  		SWAP11: {
   857  			execute:       makeSwap(11),
   858  			gasCost:       gasSwap,
   859  			validateStack: makeSwapStackFunc(12),
   860  			valid:         true,
   861  		},
   862  		SWAP12: {
   863  			execute:       makeSwap(12),
   864  			gasCost:       gasSwap,
   865  			validateStack: makeSwapStackFunc(13),
   866  			valid:         true,
   867  		},
   868  		SWAP13: {
   869  			execute:       makeSwap(13),
   870  			gasCost:       gasSwap,
   871  			validateStack: makeSwapStackFunc(14),
   872  			valid:         true,
   873  		},
   874  		SWAP14: {
   875  			execute:       makeSwap(14),
   876  			gasCost:       gasSwap,
   877  			validateStack: makeSwapStackFunc(15),
   878  			valid:         true,
   879  		},
   880  		SWAP15: {
   881  			execute:       makeSwap(15),
   882  			gasCost:       gasSwap,
   883  			validateStack: makeSwapStackFunc(16),
   884  			valid:         true,
   885  		},
   886  		SWAP16: {
   887  			execute:       makeSwap(16),
   888  			gasCost:       gasSwap,
   889  			validateStack: makeSwapStackFunc(17),
   890  			valid:         true,
   891  		},
   892  		LOG0: {
   893  			execute:       makeLog(0),
   894  			gasCost:       makeGasLog(0),
   895  			validateStack: makeStackFunc(2, 0),
   896  			memorySize:    memoryLog,
   897  			valid:         true,
   898  			writes:        true,
   899  		},
   900  		LOG1: {
   901  			execute:       makeLog(1),
   902  			gasCost:       makeGasLog(1),
   903  			validateStack: makeStackFunc(3, 0),
   904  			memorySize:    memoryLog,
   905  			valid:         true,
   906  			writes:        true,
   907  		},
   908  		LOG2: {
   909  			execute:       makeLog(2),
   910  			gasCost:       makeGasLog(2),
   911  			validateStack: makeStackFunc(4, 0),
   912  			memorySize:    memoryLog,
   913  			valid:         true,
   914  			writes:        true,
   915  		},
   916  		LOG3: {
   917  			execute:       makeLog(3),
   918  			gasCost:       makeGasLog(3),
   919  			validateStack: makeStackFunc(5, 0),
   920  			memorySize:    memoryLog,
   921  			valid:         true,
   922  			writes:        true,
   923  		},
   924  		LOG4: {
   925  			execute:       makeLog(4),
   926  			gasCost:       makeGasLog(4),
   927  			validateStack: makeStackFunc(6, 0),
   928  			memorySize:    memoryLog,
   929  			valid:         true,
   930  			writes:        true,
   931  		},
   932  		CREATE: {
   933  			execute:       opCreate,
   934  			gasCost:       gasCreate,
   935  			validateStack: makeStackFunc(3, 1),
   936  			memorySize:    memoryCreate,
   937  			valid:         true,
   938  			writes:        true,
   939  			returns:       true,
   940  		},
   941  		CALL: {
   942  			execute:       opCall,
   943  			gasCost:       gasCall,
   944  			validateStack: makeStackFunc(7, 1),
   945  			memorySize:    memoryCall,
   946  			valid:         true,
   947  			returns:       true,
   948  		},
   949  		CALLCODE: {
   950  			execute:       opCallCode,
   951  			gasCost:       gasCallCode,
   952  			validateStack: makeStackFunc(7, 1),
   953  			memorySize:    memoryCall,
   954  			valid:         true,
   955  			returns:       true,
   956  		},
   957  		RETURN: {
   958  			execute:       opReturn,
   959  			gasCost:       gasReturn,
   960  			validateStack: makeStackFunc(2, 0),
   961  			memorySize:    memoryReturn,
   962  			halts:         true,
   963  			valid:         true,
   964  		},
   965  		SELFDESTRUCT: {
   966  			execute:       opSuicide,
   967  			gasCost:       gasSuicide,
   968  			validateStack: makeStackFunc(1, 0),
   969  			halts:         true,
   970  			valid:         true,
   971  			writes:        true,
   972  		},
   973  	}
   974  }