X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=opcode.h;h=ae4011faa166191353436828b69006fb8739b943;hb=ae178db11db50e8d46c66980e186cfba029f0cb9;hp=ab279becb2ee8aff8dd93731e556a56f9d154dc4;hpb=1a67a97c0300941ac67bfb1dd421467b8c59e21c;p=p5sagit%2Fp5-mst-13.2.git diff --git a/opcode.h b/opcode.h index ab279be..ae4011f 100644 --- a/opcode.h +++ b/opcode.h @@ -8,360 +8,6 @@ #define Perl_pp_i_postinc Perl_pp_postinc #define Perl_pp_i_postdec Perl_pp_postdec -typedef enum { - OP_NULL, /* 0 */ - OP_STUB, /* 1 */ - OP_SCALAR, /* 2 */ - OP_PUSHMARK, /* 3 */ - OP_WANTARRAY, /* 4 */ - OP_CONST, /* 5 */ - OP_GVSV, /* 6 */ - OP_GV, /* 7 */ - OP_GELEM, /* 8 */ - OP_PADSV, /* 9 */ - OP_PADAV, /* 10 */ - OP_PADHV, /* 11 */ - OP_PADANY, /* 12 */ - OP_PUSHRE, /* 13 */ - OP_RV2GV, /* 14 */ - OP_RV2SV, /* 15 */ - OP_AV2ARYLEN, /* 16 */ - OP_RV2CV, /* 17 */ - OP_ANONCODE, /* 18 */ - OP_PROTOTYPE, /* 19 */ - OP_REFGEN, /* 20 */ - OP_SREFGEN, /* 21 */ - OP_REF, /* 22 */ - OP_BLESS, /* 23 */ - OP_BACKTICK, /* 24 */ - OP_GLOB, /* 25 */ - OP_READLINE, /* 26 */ - OP_RCATLINE, /* 27 */ - OP_REGCMAYBE, /* 28 */ - OP_REGCRESET, /* 29 */ - OP_REGCOMP, /* 30 */ - OP_MATCH, /* 31 */ - OP_QR, /* 32 */ - OP_SUBST, /* 33 */ - OP_SUBSTCONT, /* 34 */ - OP_TRANS, /* 35 */ - OP_SASSIGN, /* 36 */ - OP_AASSIGN, /* 37 */ - OP_CHOP, /* 38 */ - OP_SCHOP, /* 39 */ - OP_CHOMP, /* 40 */ - OP_SCHOMP, /* 41 */ - OP_DEFINED, /* 42 */ - OP_UNDEF, /* 43 */ - OP_STUDY, /* 44 */ - OP_POS, /* 45 */ - OP_PREINC, /* 46 */ - OP_I_PREINC, /* 47 */ - OP_PREDEC, /* 48 */ - OP_I_PREDEC, /* 49 */ - OP_POSTINC, /* 50 */ - OP_I_POSTINC, /* 51 */ - OP_POSTDEC, /* 52 */ - OP_I_POSTDEC, /* 53 */ - OP_POW, /* 54 */ - OP_MULTIPLY, /* 55 */ - OP_I_MULTIPLY, /* 56 */ - OP_DIVIDE, /* 57 */ - OP_I_DIVIDE, /* 58 */ - OP_MODULO, /* 59 */ - OP_I_MODULO, /* 60 */ - OP_REPEAT, /* 61 */ - OP_ADD, /* 62 */ - OP_I_ADD, /* 63 */ - OP_SUBTRACT, /* 64 */ - OP_I_SUBTRACT, /* 65 */ - OP_CONCAT, /* 66 */ - OP_STRINGIFY, /* 67 */ - OP_LEFT_SHIFT, /* 68 */ - OP_RIGHT_SHIFT, /* 69 */ - OP_LT, /* 70 */ - OP_I_LT, /* 71 */ - OP_GT, /* 72 */ - OP_I_GT, /* 73 */ - OP_LE, /* 74 */ - OP_I_LE, /* 75 */ - OP_GE, /* 76 */ - OP_I_GE, /* 77 */ - OP_EQ, /* 78 */ - OP_I_EQ, /* 79 */ - OP_NE, /* 80 */ - OP_I_NE, /* 81 */ - OP_NCMP, /* 82 */ - OP_I_NCMP, /* 83 */ - OP_SLT, /* 84 */ - OP_SGT, /* 85 */ - OP_SLE, /* 86 */ - OP_SGE, /* 87 */ - OP_SEQ, /* 88 */ - OP_SNE, /* 89 */ - OP_SCMP, /* 90 */ - OP_BIT_AND, /* 91 */ - OP_BIT_XOR, /* 92 */ - OP_BIT_OR, /* 93 */ - OP_NEGATE, /* 94 */ - OP_I_NEGATE, /* 95 */ - OP_NOT, /* 96 */ - OP_COMPLEMENT, /* 97 */ - OP_ATAN2, /* 98 */ - OP_SIN, /* 99 */ - OP_COS, /* 100 */ - OP_RAND, /* 101 */ - OP_SRAND, /* 102 */ - OP_EXP, /* 103 */ - OP_LOG, /* 104 */ - OP_SQRT, /* 105 */ - OP_INT, /* 106 */ - OP_HEX, /* 107 */ - OP_OCT, /* 108 */ - OP_ABS, /* 109 */ - OP_LENGTH, /* 110 */ - OP_SUBSTR, /* 111 */ - OP_VEC, /* 112 */ - OP_INDEX, /* 113 */ - OP_RINDEX, /* 114 */ - OP_SPRINTF, /* 115 */ - OP_FORMLINE, /* 116 */ - OP_ORD, /* 117 */ - OP_CHR, /* 118 */ - OP_CRYPT, /* 119 */ - OP_UCFIRST, /* 120 */ - OP_LCFIRST, /* 121 */ - OP_UC, /* 122 */ - OP_LC, /* 123 */ - OP_QUOTEMETA, /* 124 */ - OP_RV2AV, /* 125 */ - OP_AELEMFAST, /* 126 */ - OP_AELEM, /* 127 */ - OP_ASLICE, /* 128 */ - OP_EACH, /* 129 */ - OP_VALUES, /* 130 */ - OP_KEYS, /* 131 */ - OP_DELETE, /* 132 */ - OP_EXISTS, /* 133 */ - OP_RV2HV, /* 134 */ - OP_HELEM, /* 135 */ - OP_HSLICE, /* 136 */ - OP_UNPACK, /* 137 */ - OP_PACK, /* 138 */ - OP_SPLIT, /* 139 */ - OP_JOIN, /* 140 */ - OP_LIST, /* 141 */ - OP_LSLICE, /* 142 */ - OP_ANONLIST, /* 143 */ - OP_ANONHASH, /* 144 */ - OP_SPLICE, /* 145 */ - OP_PUSH, /* 146 */ - OP_POP, /* 147 */ - OP_SHIFT, /* 148 */ - OP_UNSHIFT, /* 149 */ - OP_SORT, /* 150 */ - OP_REVERSE, /* 151 */ - OP_GREPSTART, /* 152 */ - OP_GREPWHILE, /* 153 */ - OP_MAPSTART, /* 154 */ - OP_MAPWHILE, /* 155 */ - OP_RANGE, /* 156 */ - OP_FLIP, /* 157 */ - OP_FLOP, /* 158 */ - OP_AND, /* 159 */ - OP_OR, /* 160 */ - OP_XOR, /* 161 */ - OP_COND_EXPR, /* 162 */ - OP_ANDASSIGN, /* 163 */ - OP_ORASSIGN, /* 164 */ - OP_METHOD, /* 165 */ - OP_ENTERSUB, /* 166 */ - OP_LEAVESUB, /* 167 */ - OP_CALLER, /* 168 */ - OP_WARN, /* 169 */ - OP_DIE, /* 170 */ - OP_RESET, /* 171 */ - OP_LINESEQ, /* 172 */ - OP_NEXTSTATE, /* 173 */ - OP_DBSTATE, /* 174 */ - OP_UNSTACK, /* 175 */ - OP_ENTER, /* 176 */ - OP_LEAVE, /* 177 */ - OP_SCOPE, /* 178 */ - OP_ENTERITER, /* 179 */ - OP_ITER, /* 180 */ - OP_ENTERLOOP, /* 181 */ - OP_LEAVELOOP, /* 182 */ - OP_RETURN, /* 183 */ - OP_LAST, /* 184 */ - OP_NEXT, /* 185 */ - OP_REDO, /* 186 */ - OP_DUMP, /* 187 */ - OP_GOTO, /* 188 */ - OP_EXIT, /* 189 */ - OP_OPEN, /* 190 */ - OP_CLOSE, /* 191 */ - OP_PIPE_OP, /* 192 */ - OP_FILENO, /* 193 */ - OP_UMASK, /* 194 */ - OP_BINMODE, /* 195 */ - OP_TIE, /* 196 */ - OP_UNTIE, /* 197 */ - OP_TIED, /* 198 */ - OP_DBMOPEN, /* 199 */ - OP_DBMCLOSE, /* 200 */ - OP_SSELECT, /* 201 */ - OP_SELECT, /* 202 */ - OP_GETC, /* 203 */ - OP_READ, /* 204 */ - OP_ENTERWRITE, /* 205 */ - OP_LEAVEWRITE, /* 206 */ - OP_PRTF, /* 207 */ - OP_PRINT, /* 208 */ - OP_SYSOPEN, /* 209 */ - OP_SYSSEEK, /* 210 */ - OP_SYSREAD, /* 211 */ - OP_SYSWRITE, /* 212 */ - OP_SEND, /* 213 */ - OP_RECV, /* 214 */ - OP_EOF, /* 215 */ - OP_TELL, /* 216 */ - OP_SEEK, /* 217 */ - OP_TRUNCATE, /* 218 */ - OP_FCNTL, /* 219 */ - OP_IOCTL, /* 220 */ - OP_FLOCK, /* 221 */ - OP_SOCKET, /* 222 */ - OP_SOCKPAIR, /* 223 */ - OP_BIND, /* 224 */ - OP_CONNECT, /* 225 */ - OP_LISTEN, /* 226 */ - OP_ACCEPT, /* 227 */ - OP_SHUTDOWN, /* 228 */ - OP_GSOCKOPT, /* 229 */ - OP_SSOCKOPT, /* 230 */ - OP_GETSOCKNAME, /* 231 */ - OP_GETPEERNAME, /* 232 */ - OP_LSTAT, /* 233 */ - OP_STAT, /* 234 */ - OP_FTRREAD, /* 235 */ - OP_FTRWRITE, /* 236 */ - OP_FTREXEC, /* 237 */ - OP_FTEREAD, /* 238 */ - OP_FTEWRITE, /* 239 */ - OP_FTEEXEC, /* 240 */ - OP_FTIS, /* 241 */ - OP_FTEOWNED, /* 242 */ - OP_FTROWNED, /* 243 */ - OP_FTZERO, /* 244 */ - OP_FTSIZE, /* 245 */ - OP_FTMTIME, /* 246 */ - OP_FTATIME, /* 247 */ - OP_FTCTIME, /* 248 */ - OP_FTSOCK, /* 249 */ - OP_FTCHR, /* 250 */ - OP_FTBLK, /* 251 */ - OP_FTFILE, /* 252 */ - OP_FTDIR, /* 253 */ - OP_FTPIPE, /* 254 */ - OP_FTLINK, /* 255 */ - OP_FTSUID, /* 256 */ - OP_FTSGID, /* 257 */ - OP_FTSVTX, /* 258 */ - OP_FTTTY, /* 259 */ - OP_FTTEXT, /* 260 */ - OP_FTBINARY, /* 261 */ - OP_CHDIR, /* 262 */ - OP_CHOWN, /* 263 */ - OP_CHROOT, /* 264 */ - OP_UNLINK, /* 265 */ - OP_CHMOD, /* 266 */ - OP_UTIME, /* 267 */ - OP_RENAME, /* 268 */ - OP_LINK, /* 269 */ - OP_SYMLINK, /* 270 */ - OP_READLINK, /* 271 */ - OP_MKDIR, /* 272 */ - OP_RMDIR, /* 273 */ - OP_OPEN_DIR, /* 274 */ - OP_READDIR, /* 275 */ - OP_TELLDIR, /* 276 */ - OP_SEEKDIR, /* 277 */ - OP_REWINDDIR, /* 278 */ - OP_CLOSEDIR, /* 279 */ - OP_FORK, /* 280 */ - OP_WAIT, /* 281 */ - OP_WAITPID, /* 282 */ - OP_SYSTEM, /* 283 */ - OP_EXEC, /* 284 */ - OP_KILL, /* 285 */ - OP_GETPPID, /* 286 */ - OP_GETPGRP, /* 287 */ - OP_SETPGRP, /* 288 */ - OP_GETPRIORITY, /* 289 */ - OP_SETPRIORITY, /* 290 */ - OP_TIME, /* 291 */ - OP_TMS, /* 292 */ - OP_LOCALTIME, /* 293 */ - OP_GMTIME, /* 294 */ - OP_ALARM, /* 295 */ - OP_SLEEP, /* 296 */ - OP_SHMGET, /* 297 */ - OP_SHMCTL, /* 298 */ - OP_SHMREAD, /* 299 */ - OP_SHMWRITE, /* 300 */ - OP_MSGGET, /* 301 */ - OP_MSGCTL, /* 302 */ - OP_MSGSND, /* 303 */ - OP_MSGRCV, /* 304 */ - OP_SEMGET, /* 305 */ - OP_SEMCTL, /* 306 */ - OP_SEMOP, /* 307 */ - OP_REQUIRE, /* 308 */ - OP_DOFILE, /* 309 */ - OP_ENTEREVAL, /* 310 */ - OP_LEAVEEVAL, /* 311 */ - OP_ENTERTRY, /* 312 */ - OP_LEAVETRY, /* 313 */ - OP_GHBYNAME, /* 314 */ - OP_GHBYADDR, /* 315 */ - OP_GHOSTENT, /* 316 */ - OP_GNBYNAME, /* 317 */ - OP_GNBYADDR, /* 318 */ - OP_GNETENT, /* 319 */ - OP_GPBYNAME, /* 320 */ - OP_GPBYNUMBER, /* 321 */ - OP_GPROTOENT, /* 322 */ - OP_GSBYNAME, /* 323 */ - OP_GSBYPORT, /* 324 */ - OP_GSERVENT, /* 325 */ - OP_SHOSTENT, /* 326 */ - OP_SNETENT, /* 327 */ - OP_SPROTOENT, /* 328 */ - OP_SSERVENT, /* 329 */ - OP_EHOSTENT, /* 330 */ - OP_ENETENT, /* 331 */ - OP_EPROTOENT, /* 332 */ - OP_ESERVENT, /* 333 */ - OP_GPWNAM, /* 334 */ - OP_GPWUID, /* 335 */ - OP_GPWENT, /* 336 */ - OP_SPWENT, /* 337 */ - OP_EPWENT, /* 338 */ - OP_GGRNAM, /* 339 */ - OP_GGRGID, /* 340 */ - OP_GGRENT, /* 341 */ - OP_SGRENT, /* 342 */ - OP_EGRENT, /* 343 */ - OP_GETLOGIN, /* 344 */ - OP_SYSCALL, /* 345 */ - OP_LOCK, /* 346 */ - OP_THREADSV, /* 347 */ - OP_max -} opcode; - -#define MAXO 348 - START_EXTERN_C @@ -537,6 +183,7 @@ EXT char *PL_op_name[] = { "method", "entersub", "leavesub", + "leavesublv", "caller", "warn", "die", @@ -717,6 +364,8 @@ EXT char *PL_op_name[] = { "syscall", "lock", "threadsv", + "setstate", + "method_named", }; #endif @@ -736,7 +385,7 @@ EXT char *PL_op_desc[] = { "private variable", "private array", "private hash", - "private something", + "private value", "push regexp", "ref-to-glob cast", "scalar deref", @@ -748,80 +397,80 @@ EXT char *PL_op_desc[] = { "single ref constructor", "reference-type operator", "bless", - "backticks", + "quoted execution (``, qx)", "glob", "", "append I/O operator", - "regexp comp once", - "regexp reset interpolation flag", + "regexp internal guard", + "regexp internal reset", "regexp compilation", - "pattern match", - "pattern quote", - "substitution", - "substitution cont", - "character translation", + "pattern match (m//)", + "pattern quote (qr//)", + "substitution (s///)", + "substitution iterator", + "transliteration (tr///)", "scalar assignment", "list assignment", "chop", "scalar chop", - "safe chop", - "scalar safe chop", + "chomp", + "scalar chomp", "defined operator", "undef operator", "study", "match position", - "preincrement", - "integer preincrement", - "predecrement", - "integer predecrement", - "postincrement", - "integer postincrement", - "postdecrement", - "integer postdecrement", - "exponentiation", - "multiplication", - "integer multiplication", - "division", - "integer division", - "modulus", - "integer modulus", - "repeat", - "addition", - "integer addition", - "subtraction", - "integer subtraction", - "concatenation", + "preincrement (++)", + "integer preincrement (++)", + "predecrement (--)", + "integer predecrement (--)", + "postincrement (++)", + "integer postincrement (++)", + "postdecrement (--)", + "integer postdecrement (--)", + "exponentiation (**)", + "multiplication (*)", + "integer multiplication (*)", + "division (/)", + "integer division (/)", + "modulus (%)", + "integer modulus (%)", + "repeat (x)", + "addition (+)", + "integer addition (+)", + "subtraction (-)", + "integer subtraction (-)", + "concatenation (.)", "string", - "left bitshift", - "right bitshift", - "numeric lt", - "integer lt", - "numeric gt", - "integer gt", - "numeric le", - "integer le", - "numeric ge", - "integer ge", - "numeric eq", - "integer eq", - "numeric ne", - "integer ne", - "spaceship operator", - "integer spaceship", + "left bitshift (<<)", + "right bitshift (>>)", + "numeric lt (<)", + "integer lt (<)", + "numeric gt (>)", + "integer gt (>)", + "numeric le (<=)", + "integer le (<=)", + "numeric ge (>=)", + "integer ge (>=)", + "numeric eq (==)", + "integer eq (==)", + "numeric ne (!=)", + "integer ne (!=)", + "numeric comparison (<=>)", + "integer comparison (<=>)", "string lt", "string gt", "string le", "string ge", "string eq", "string ne", - "string comparison", - "bitwise and", - "bitwise xor", - "bitwise or", - "negate", - "integer negate", + "string comparison (cmp)", + "bitwise and (&)", + "bitwise xor (^)", + "bitwise or (|)", + "negation (-)", + "integer negation (-)", "not", - "1's complement", + "1's complement (~)", "atan2", "sin", "cos", @@ -844,22 +493,22 @@ EXT char *PL_op_desc[] = { "ord", "chr", "crypt", - "upper case first", - "lower case first", - "upper case", - "lower case", - "quote metachars", - "array deref", - "known array element", + "ucfirst", + "lcfirst", + "uc", + "lc", + "quotemeta", + "array dereference", + "constant array element", "array element", "array slice", "each", "values", "keys", "delete", - "exists operator", - "hash deref", - "hash elem", + "exists", + "hash dereference", + "hash element", "hash slice", "unpack", "pack", @@ -867,8 +516,8 @@ EXT char *PL_op_desc[] = { "join", "list", "list slice", - "anonymous list", - "anonymous hash", + "anonymous list ([])", + "anonymous hash ({})", "splice", "push", "pop", @@ -883,19 +532,20 @@ EXT char *PL_op_desc[] = { "flipflop", "range (or flip)", "range (or flop)", - "logical and", - "logical or", + "logical and (&&)", + "logical or (||)", "logical xor", "conditional expression", - "logical and assignment", - "logical or assignment", + "logical and assignment (&&=)", + "logical or assignment (||=)", "method lookup", "subroutine entry", "subroutine exit", + "lvalue subroutine exit", "caller", "warn", "die", - "reset", + "symbol reset", "line sequence", "next statement", "debug next statement", @@ -1033,11 +683,11 @@ EXT char *PL_op_desc[] = { "semctl", "semop", "require", - "do 'file'", - "eval string", - "eval exit", - "eval block", - "eval block exit", + "do \"file\"", + "eval \"string\"", + "eval \"string\" exit", + "eval {block}", + "eval {block} exit", "gethostbyname", "gethostbyaddr", "gethostent", @@ -1071,7 +721,9 @@ EXT char *PL_op_desc[] = { "getlogin", "syscall", "lock", - "per-thread variable", + "per-thread value", + "set statement info", + "method with known name", }; #endif @@ -1252,6 +904,7 @@ EXT OP * (CPERLscope(*PL_ppaddr)[])(pTHX) = { Perl_pp_method, Perl_pp_entersub, Perl_pp_leavesub, + Perl_pp_leavesublv, Perl_pp_caller, Perl_pp_warn, Perl_pp_die, @@ -1432,6 +1085,8 @@ EXT OP * (CPERLscope(*PL_ppaddr)[])(pTHX) = { Perl_pp_syscall, Perl_pp_lock, Perl_pp_threadsv, + Perl_pp_setstate, + Perl_pp_method_named, }; #endif @@ -1579,7 +1234,7 @@ EXT OP * (CPERLscope(*PL_check)[]) (pTHX_ OP *op) = { Perl_ck_fun, /* unpack */ Perl_ck_fun, /* pack */ Perl_ck_split, /* split */ - Perl_ck_fun, /* join */ + Perl_ck_join, /* join */ Perl_ck_null, /* list */ Perl_ck_null, /* lslice */ Perl_ck_fun, /* anonlist */ @@ -1604,9 +1259,10 @@ EXT OP * (CPERLscope(*PL_check)[]) (pTHX_ OP *op) = { Perl_ck_null, /* cond_expr */ Perl_ck_null, /* andassign */ Perl_ck_null, /* orassign */ - Perl_ck_null, /* method */ + Perl_ck_method, /* method */ Perl_ck_subr, /* entersub */ Perl_ck_null, /* leavesub */ + Perl_ck_null, /* leavesublv */ Perl_ck_fun, /* caller */ Perl_ck_fun, /* warn */ Perl_ck_fun, /* die */ @@ -1787,6 +1443,8 @@ EXT OP * (CPERLscope(*PL_check)[]) (pTHX_ OP *op) = { Perl_ck_fun, /* syscall */ Perl_ck_rfun, /* lock */ Perl_ck_null, /* threadsv */ + Perl_ck_null, /* setstate */ + Perl_ck_null, /* method_named */ }; #endif @@ -1923,7 +1581,7 @@ EXT U32 PL_opargs[] = { 0x00026e04, /* aelemfast */ 0x00026404, /* aelem */ 0x00046801, /* aslice */ - 0x00009608, /* each */ + 0x00009600, /* each */ 0x00009608, /* values */ 0x00009608, /* keys */ 0x00003600, /* delete */ @@ -1955,13 +1613,14 @@ EXT U32 PL_opargs[] = { 0x00000200, /* flop */ 0x00000600, /* and */ 0x00000600, /* or */ - 0x00022606, /* xor */ + 0x00022406, /* xor */ 0x00000640, /* cond_expr */ 0x00000604, /* andassign */ 0x00000604, /* orassign */ 0x00000240, /* method */ 0x00004249, /* entersub */ 0x00000200, /* leavesub */ + 0x00000200, /* leavesublv */ 0x00013608, /* caller */ 0x0000481d, /* warn */ 0x0000485d, /* die */ @@ -1984,7 +1643,7 @@ EXT U32 PL_opargs[] = { 0x00001a44, /* dump */ 0x00001a44, /* goto */ 0x00013644, /* exit */ - 0x0012c81c, /* open */ + 0x0132c81c, /* open */ 0x0001d614, /* close */ 0x000cc814, /* pipe_op */ 0x0000d61c, /* fileno */ @@ -2142,6 +1801,8 @@ EXT U32 PL_opargs[] = { 0x0004281d, /* syscall */ 0x00003604, /* lock */ 0x00000044, /* threadsv */ + 0x00001404, /* setstate */ + 0x00000c40, /* method_named */ }; #endif