From 61b17227452a6463c665dc1a8c45bd5664e03395 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 20 May 2020 15:52:24 +0300 Subject: [PATCH] opcode: swap ROT and OLDPUSH1 Because of how stringer generates String() method, the first of them will be used as the result. --- pkg/vm/opcode/opcode.go | 2 +- pkg/vm/opcode/opcode_string.go | 230 ++++++++++++++++----------------- 2 files changed, 116 insertions(+), 116 deletions(-) diff --git a/pkg/vm/opcode/opcode.go b/pkg/vm/opcode/opcode.go index 6b5a8ee5a..b8d56666e 100644 --- a/pkg/vm/opcode/opcode.go +++ b/pkg/vm/opcode/opcode.go @@ -86,8 +86,8 @@ const ( PICK Opcode = 0x4D TUCK Opcode = 0x4E SWAP Opcode = 0x50 - OLDPUSH1 Opcode = 0x51 // FIXME remove #927 ROT Opcode = 0x51 + OLDPUSH1 Opcode = 0x51 // FIXME remove #927 ROLL Opcode = 0x52 REVERSE3 Opcode = 0x53 REVERSE4 Opcode = 0x54 diff --git a/pkg/vm/opcode/opcode_string.go b/pkg/vm/opcode/opcode_string.go index e8e5cf92d..d5ab10d51 100644 --- a/pkg/vm/opcode/opcode_string.go +++ b/pkg/vm/opcode/opcode_string.go @@ -76,8 +76,8 @@ func _() { _ = x[PICK-77] _ = x[TUCK-78] _ = x[SWAP-80] - _ = x[OLDPUSH1-81] _ = x[ROT-81] + _ = x[OLDPUSH1-81] _ = x[ROLL-82] _ = x[REVERSE3-83] _ = x[REVERSE4-84] @@ -192,7 +192,7 @@ func _() { _ = x[CONVERT-219] } -const _Opcode_name = "PUSHINT8PUSHINT16PUSHINT32PUSHINT64PUSHINT128PUSHINT256PUSHAPUSHNULLPUSHDATA1PUSHDATA2PUSHDATA4PUSHM1PUSH0PUSH1PUSH2PUSH3PUSH4PUSH5PUSH6PUSH7PUSH8PUSH9PUSH10PUSH11PUSH12PUSH13PUSH14PUSH15PUSH16NOPJMPJMP_LJMPIFJMPIF_LJMPIFNOTJMPIFNOT_LJMPEQJMPEQ_LJMPNEJMPNE_LJMPGTJMPGT_LJMPGEJMPGE_LJMPLTJMPLT_LJMPLEJMPLE_LCALLCALL_LCALLAABORTASSERTTHROWRETSYSCALLDEPTHDROPNIPXDROPCLEARDUPOVERPICKTUCKSWAPFIXME remove #927ROLLREVERSE3REVERSE4REVERSENINITSSLOTINITSLOTLDSFLD0LDSFLD1LDSFLD2LDSFLD3LDSFLD4LDSFLD5LDSFLD6LDSFLDSTSFLD0STSFLD1STSFLD2STSFLD3STSFLD4STSFLD5STSFLD6STSFLDLDLOC0LDLOC1LDLOC2LDLOC3LDLOC4LDLOC5LDLOC6LDLOCSTLOC0STLOC1STLOC2STLOC3STLOC4STLOC5STLOC6STLOCLDARG0LDARG1LDARG2LDARG3LDARG4LDARG5LDARG6LDARGSTARG0STARG1STARG2STARG3STARG4STARG5STARG6STARGNEWBUFFERMEMCPYCATSUBSTRLEFTRIGHTINVERTANDORXOREQUALNOTEQUALSIGNABSNEGATEINCDECADDSUBMULDIVMODSHLSHRNOTBOOLANDBOOLORNZNUMEQUALNUMNOTEQUALLTLTEGTGTEMINMAXWITHINPACKUNPACKNEWARRAY0NEWARRAYNEWARRAY_TNEWSTRUCT0NEWSTRUCTNEWMAPSIZEHASKEYKEYSVALUESPICKITEMAPPENDSETITEMREVERSEITEMSREMOVECLEARITEMSISNULLISTYPECONVERT" +const _Opcode_name = "PUSHINT8PUSHINT16PUSHINT32PUSHINT64PUSHINT128PUSHINT256PUSHAPUSHNULLPUSHDATA1PUSHDATA2PUSHDATA4PUSHM1PUSH0PUSH1PUSH2PUSH3PUSH4PUSH5PUSH6PUSH7PUSH8PUSH9PUSH10PUSH11PUSH12PUSH13PUSH14PUSH15PUSH16NOPJMPJMP_LJMPIFJMPIF_LJMPIFNOTJMPIFNOT_LJMPEQJMPEQ_LJMPNEJMPNE_LJMPGTJMPGT_LJMPGEJMPGE_LJMPLTJMPLT_LJMPLEJMPLE_LCALLCALL_LCALLAABORTASSERTTHROWRETSYSCALLDEPTHDROPNIPXDROPCLEARDUPOVERPICKTUCKSWAPROTROLLREVERSE3REVERSE4REVERSENINITSSLOTINITSLOTLDSFLD0LDSFLD1LDSFLD2LDSFLD3LDSFLD4LDSFLD5LDSFLD6LDSFLDSTSFLD0STSFLD1STSFLD2STSFLD3STSFLD4STSFLD5STSFLD6STSFLDLDLOC0LDLOC1LDLOC2LDLOC3LDLOC4LDLOC5LDLOC6LDLOCSTLOC0STLOC1STLOC2STLOC3STLOC4STLOC5STLOC6STLOCLDARG0LDARG1LDARG2LDARG3LDARG4LDARG5LDARG6LDARGSTARG0STARG1STARG2STARG3STARG4STARG5STARG6STARGNEWBUFFERMEMCPYCATSUBSTRLEFTRIGHTINVERTANDORXOREQUALNOTEQUALSIGNABSNEGATEINCDECADDSUBMULDIVMODSHLSHRNOTBOOLANDBOOLORNZNUMEQUALNUMNOTEQUALLTLTEGTGTEMINMAXWITHINPACKUNPACKNEWARRAY0NEWARRAYNEWARRAY_TNEWSTRUCT0NEWSTRUCTNEWMAPSIZEHASKEYKEYSVALUESPICKITEMAPPENDSETITEMREVERSEITEMSREMOVECLEARITEMSISNULLISTYPECONVERT" var _Opcode_map = map[Opcode]string{ 0: _Opcode_name[0:8], @@ -261,119 +261,119 @@ var _Opcode_map = map[Opcode]string{ 77: _Opcode_name[376:380], 78: _Opcode_name[380:384], 80: _Opcode_name[384:388], - 81: _Opcode_name[388:405], - 82: _Opcode_name[405:409], - 83: _Opcode_name[409:417], - 84: _Opcode_name[417:425], - 85: _Opcode_name[425:433], - 86: _Opcode_name[433:442], - 87: _Opcode_name[442:450], - 88: _Opcode_name[450:457], - 89: _Opcode_name[457:464], - 90: _Opcode_name[464:471], - 91: _Opcode_name[471:478], - 92: _Opcode_name[478:485], - 93: _Opcode_name[485:492], - 94: _Opcode_name[492:499], - 95: _Opcode_name[499:505], - 96: _Opcode_name[505:512], - 97: _Opcode_name[512:519], - 98: _Opcode_name[519:526], - 99: _Opcode_name[526:533], - 100: _Opcode_name[533:540], - 101: _Opcode_name[540:547], - 102: _Opcode_name[547:554], - 103: _Opcode_name[554:560], - 104: _Opcode_name[560:566], - 105: _Opcode_name[566:572], - 106: _Opcode_name[572:578], - 107: _Opcode_name[578:584], - 108: _Opcode_name[584:590], - 109: _Opcode_name[590:596], - 110: _Opcode_name[596:602], - 111: _Opcode_name[602:607], - 112: _Opcode_name[607:613], - 113: _Opcode_name[613:619], - 114: _Opcode_name[619:625], - 115: _Opcode_name[625:631], - 116: _Opcode_name[631:637], - 117: _Opcode_name[637:643], - 118: _Opcode_name[643:649], - 119: _Opcode_name[649:654], - 120: _Opcode_name[654:660], - 121: _Opcode_name[660:666], - 122: _Opcode_name[666:672], - 123: _Opcode_name[672:678], - 124: _Opcode_name[678:684], - 125: _Opcode_name[684:690], - 126: _Opcode_name[690:696], - 127: _Opcode_name[696:701], - 128: _Opcode_name[701:707], - 129: _Opcode_name[707:713], - 130: _Opcode_name[713:719], - 131: _Opcode_name[719:725], - 132: _Opcode_name[725:731], - 133: _Opcode_name[731:737], - 134: _Opcode_name[737:743], - 135: _Opcode_name[743:748], - 136: _Opcode_name[748:757], - 137: _Opcode_name[757:763], - 139: _Opcode_name[763:766], - 140: _Opcode_name[766:772], - 141: _Opcode_name[772:776], - 142: _Opcode_name[776:781], - 144: _Opcode_name[781:787], - 145: _Opcode_name[787:790], - 146: _Opcode_name[790:792], - 147: _Opcode_name[792:795], - 151: _Opcode_name[795:800], - 152: _Opcode_name[800:808], - 153: _Opcode_name[808:812], - 154: _Opcode_name[812:815], - 155: _Opcode_name[815:821], - 156: _Opcode_name[821:824], - 157: _Opcode_name[824:827], - 158: _Opcode_name[827:830], - 159: _Opcode_name[830:833], - 160: _Opcode_name[833:836], - 161: _Opcode_name[836:839], - 162: _Opcode_name[839:842], - 168: _Opcode_name[842:845], - 169: _Opcode_name[845:848], - 170: _Opcode_name[848:851], - 171: _Opcode_name[851:858], - 172: _Opcode_name[858:864], - 177: _Opcode_name[864:866], - 179: _Opcode_name[866:874], - 180: _Opcode_name[874:885], - 181: _Opcode_name[885:887], - 182: _Opcode_name[887:890], - 183: _Opcode_name[890:892], - 184: _Opcode_name[892:895], - 185: _Opcode_name[895:898], - 186: _Opcode_name[898:901], - 187: _Opcode_name[901:907], - 192: _Opcode_name[907:911], - 193: _Opcode_name[911:917], - 194: _Opcode_name[917:926], - 195: _Opcode_name[926:934], - 196: _Opcode_name[934:944], - 197: _Opcode_name[944:954], - 198: _Opcode_name[954:963], - 200: _Opcode_name[963:969], - 202: _Opcode_name[969:973], - 203: _Opcode_name[973:979], - 204: _Opcode_name[979:983], - 205: _Opcode_name[983:989], - 206: _Opcode_name[989:997], - 207: _Opcode_name[997:1003], - 208: _Opcode_name[1003:1010], - 209: _Opcode_name[1010:1022], - 210: _Opcode_name[1022:1028], - 211: _Opcode_name[1028:1038], - 216: _Opcode_name[1038:1044], - 217: _Opcode_name[1044:1050], - 219: _Opcode_name[1050:1057], + 81: _Opcode_name[388:391], + 82: _Opcode_name[391:395], + 83: _Opcode_name[395:403], + 84: _Opcode_name[403:411], + 85: _Opcode_name[411:419], + 86: _Opcode_name[419:428], + 87: _Opcode_name[428:436], + 88: _Opcode_name[436:443], + 89: _Opcode_name[443:450], + 90: _Opcode_name[450:457], + 91: _Opcode_name[457:464], + 92: _Opcode_name[464:471], + 93: _Opcode_name[471:478], + 94: _Opcode_name[478:485], + 95: _Opcode_name[485:491], + 96: _Opcode_name[491:498], + 97: _Opcode_name[498:505], + 98: _Opcode_name[505:512], + 99: _Opcode_name[512:519], + 100: _Opcode_name[519:526], + 101: _Opcode_name[526:533], + 102: _Opcode_name[533:540], + 103: _Opcode_name[540:546], + 104: _Opcode_name[546:552], + 105: _Opcode_name[552:558], + 106: _Opcode_name[558:564], + 107: _Opcode_name[564:570], + 108: _Opcode_name[570:576], + 109: _Opcode_name[576:582], + 110: _Opcode_name[582:588], + 111: _Opcode_name[588:593], + 112: _Opcode_name[593:599], + 113: _Opcode_name[599:605], + 114: _Opcode_name[605:611], + 115: _Opcode_name[611:617], + 116: _Opcode_name[617:623], + 117: _Opcode_name[623:629], + 118: _Opcode_name[629:635], + 119: _Opcode_name[635:640], + 120: _Opcode_name[640:646], + 121: _Opcode_name[646:652], + 122: _Opcode_name[652:658], + 123: _Opcode_name[658:664], + 124: _Opcode_name[664:670], + 125: _Opcode_name[670:676], + 126: _Opcode_name[676:682], + 127: _Opcode_name[682:687], + 128: _Opcode_name[687:693], + 129: _Opcode_name[693:699], + 130: _Opcode_name[699:705], + 131: _Opcode_name[705:711], + 132: _Opcode_name[711:717], + 133: _Opcode_name[717:723], + 134: _Opcode_name[723:729], + 135: _Opcode_name[729:734], + 136: _Opcode_name[734:743], + 137: _Opcode_name[743:749], + 139: _Opcode_name[749:752], + 140: _Opcode_name[752:758], + 141: _Opcode_name[758:762], + 142: _Opcode_name[762:767], + 144: _Opcode_name[767:773], + 145: _Opcode_name[773:776], + 146: _Opcode_name[776:778], + 147: _Opcode_name[778:781], + 151: _Opcode_name[781:786], + 152: _Opcode_name[786:794], + 153: _Opcode_name[794:798], + 154: _Opcode_name[798:801], + 155: _Opcode_name[801:807], + 156: _Opcode_name[807:810], + 157: _Opcode_name[810:813], + 158: _Opcode_name[813:816], + 159: _Opcode_name[816:819], + 160: _Opcode_name[819:822], + 161: _Opcode_name[822:825], + 162: _Opcode_name[825:828], + 168: _Opcode_name[828:831], + 169: _Opcode_name[831:834], + 170: _Opcode_name[834:837], + 171: _Opcode_name[837:844], + 172: _Opcode_name[844:850], + 177: _Opcode_name[850:852], + 179: _Opcode_name[852:860], + 180: _Opcode_name[860:871], + 181: _Opcode_name[871:873], + 182: _Opcode_name[873:876], + 183: _Opcode_name[876:878], + 184: _Opcode_name[878:881], + 185: _Opcode_name[881:884], + 186: _Opcode_name[884:887], + 187: _Opcode_name[887:893], + 192: _Opcode_name[893:897], + 193: _Opcode_name[897:903], + 194: _Opcode_name[903:912], + 195: _Opcode_name[912:920], + 196: _Opcode_name[920:930], + 197: _Opcode_name[930:940], + 198: _Opcode_name[940:949], + 200: _Opcode_name[949:955], + 202: _Opcode_name[955:959], + 203: _Opcode_name[959:965], + 204: _Opcode_name[965:969], + 205: _Opcode_name[969:975], + 206: _Opcode_name[975:983], + 207: _Opcode_name[983:989], + 208: _Opcode_name[989:996], + 209: _Opcode_name[996:1008], + 210: _Opcode_name[1008:1014], + 211: _Opcode_name[1014:1024], + 216: _Opcode_name[1024:1030], + 217: _Opcode_name[1030:1036], + 219: _Opcode_name[1036:1043], } func (i Opcode) String() string {