This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
opcode.pl -> regen/opcode.pl
[perl5.git] / opnames.h
CommitLineData
37442d52
RGS
1/* -*- buffer-read-only: t -*-
2 *
d6376244
JH
3 * opnames.h
4 *
cfc85103 5 * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
e8e5c75e 6 * 2007, 2008 by Larry Wall and others
d6376244
JH
7 *
8 * You may distribute under the terms of either the GNU General Public
9 * License or the Artistic License, as specified in the README file.
10 *
11 *
12 * !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
d006332c
FC
13 * This file is built by regen/opcode.pl from its data. Any changes made
14 * here will be lost!
d6376244 15 */
abdd5c84
GS
16
17typedef enum opcode {
e71197e2
JC
18 OP_NULL = 0,
19 OP_STUB = 1,
20 OP_SCALAR = 2,
21 OP_PUSHMARK = 3,
22 OP_WANTARRAY = 4,
23 OP_CONST = 5,
24 OP_GVSV = 6,
25 OP_GV = 7,
26 OP_GELEM = 8,
27 OP_PADSV = 9,
28 OP_PADAV = 10,
29 OP_PADHV = 11,
30 OP_PADANY = 12,
31 OP_PUSHRE = 13,
32 OP_RV2GV = 14,
33 OP_RV2SV = 15,
34 OP_AV2ARYLEN = 16,
35 OP_RV2CV = 17,
36 OP_ANONCODE = 18,
37 OP_PROTOTYPE = 19,
38 OP_REFGEN = 20,
39 OP_SREFGEN = 21,
40 OP_REF = 22,
41 OP_BLESS = 23,
42 OP_BACKTICK = 24,
43 OP_GLOB = 25,
44 OP_READLINE = 26,
45 OP_RCATLINE = 27,
46 OP_REGCMAYBE = 28,
47 OP_REGCRESET = 29,
48 OP_REGCOMP = 30,
49 OP_MATCH = 31,
50 OP_QR = 32,
51 OP_SUBST = 33,
52 OP_SUBSTCONT = 34,
53 OP_TRANS = 35,
54 OP_SASSIGN = 36,
55 OP_AASSIGN = 37,
56 OP_CHOP = 38,
57 OP_SCHOP = 39,
58 OP_CHOMP = 40,
59 OP_SCHOMP = 41,
60 OP_DEFINED = 42,
61 OP_UNDEF = 43,
62 OP_STUDY = 44,
63 OP_POS = 45,
64 OP_PREINC = 46,
65 OP_I_PREINC = 47,
66 OP_PREDEC = 48,
67 OP_I_PREDEC = 49,
68 OP_POSTINC = 50,
69 OP_I_POSTINC = 51,
70 OP_POSTDEC = 52,
71 OP_I_POSTDEC = 53,
72 OP_POW = 54,
73 OP_MULTIPLY = 55,
74 OP_I_MULTIPLY = 56,
75 OP_DIVIDE = 57,
76 OP_I_DIVIDE = 58,
77 OP_MODULO = 59,
78 OP_I_MODULO = 60,
79 OP_REPEAT = 61,
80 OP_ADD = 62,
81 OP_I_ADD = 63,
82 OP_SUBTRACT = 64,
83 OP_I_SUBTRACT = 65,
84 OP_CONCAT = 66,
85 OP_STRINGIFY = 67,
86 OP_LEFT_SHIFT = 68,
87 OP_RIGHT_SHIFT = 69,
88 OP_LT = 70,
89 OP_I_LT = 71,
90 OP_GT = 72,
91 OP_I_GT = 73,
92 OP_LE = 74,
93 OP_I_LE = 75,
94 OP_GE = 76,
95 OP_I_GE = 77,
96 OP_EQ = 78,
97 OP_I_EQ = 79,
98 OP_NE = 80,
99 OP_I_NE = 81,
100 OP_NCMP = 82,
101 OP_I_NCMP = 83,
102 OP_SLT = 84,
103 OP_SGT = 85,
104 OP_SLE = 86,
105 OP_SGE = 87,
106 OP_SEQ = 88,
107 OP_SNE = 89,
108 OP_SCMP = 90,
109 OP_BIT_AND = 91,
110 OP_BIT_XOR = 92,
111 OP_BIT_OR = 93,
112 OP_NEGATE = 94,
113 OP_I_NEGATE = 95,
114 OP_NOT = 96,
115 OP_COMPLEMENT = 97,
116 OP_SMARTMATCH = 98,
117 OP_ATAN2 = 99,
118 OP_SIN = 100,
119 OP_COS = 101,
120 OP_RAND = 102,
121 OP_SRAND = 103,
122 OP_EXP = 104,
123 OP_LOG = 105,
124 OP_SQRT = 106,
125 OP_INT = 107,
126 OP_HEX = 108,
127 OP_OCT = 109,
128 OP_ABS = 110,
129 OP_LENGTH = 111,
130 OP_SUBSTR = 112,
131 OP_VEC = 113,
132 OP_INDEX = 114,
133 OP_RINDEX = 115,
134 OP_SPRINTF = 116,
135 OP_FORMLINE = 117,
136 OP_ORD = 118,
137 OP_CHR = 119,
138 OP_CRYPT = 120,
139 OP_UCFIRST = 121,
140 OP_LCFIRST = 122,
141 OP_UC = 123,
142 OP_LC = 124,
143 OP_QUOTEMETA = 125,
144 OP_RV2AV = 126,
145 OP_AELEMFAST = 127,
146 OP_AELEM = 128,
147 OP_ASLICE = 129,
148 OP_AEACH = 130,
149 OP_AKEYS = 131,
150 OP_AVALUES = 132,
151 OP_EACH = 133,
152 OP_VALUES = 134,
153 OP_KEYS = 135,
154 OP_DELETE = 136,
155 OP_EXISTS = 137,
156 OP_RV2HV = 138,
157 OP_HELEM = 139,
158 OP_HSLICE = 140,
2e0eeeaa
NC
159 OP_BOOLKEYS = 141,
160 OP_UNPACK = 142,
161 OP_PACK = 143,
162 OP_SPLIT = 144,
163 OP_JOIN = 145,
164 OP_LIST = 146,
165 OP_LSLICE = 147,
166 OP_ANONLIST = 148,
167 OP_ANONHASH = 149,
168 OP_SPLICE = 150,
169 OP_PUSH = 151,
170 OP_POP = 152,
171 OP_SHIFT = 153,
172 OP_UNSHIFT = 154,
173 OP_SORT = 155,
174 OP_REVERSE = 156,
175 OP_GREPSTART = 157,
176 OP_GREPWHILE = 158,
177 OP_MAPSTART = 159,
178 OP_MAPWHILE = 160,
179 OP_RANGE = 161,
180 OP_FLIP = 162,
181 OP_FLOP = 163,
182 OP_AND = 164,
183 OP_OR = 165,
184 OP_XOR = 166,
185 OP_DOR = 167,
186 OP_COND_EXPR = 168,
187 OP_ANDASSIGN = 169,
188 OP_ORASSIGN = 170,
189 OP_DORASSIGN = 171,
190 OP_METHOD = 172,
191 OP_ENTERSUB = 173,
192 OP_LEAVESUB = 174,
193 OP_LEAVESUBLV = 175,
194 OP_CALLER = 176,
195 OP_WARN = 177,
196 OP_DIE = 178,
197 OP_RESET = 179,
198 OP_LINESEQ = 180,
199 OP_NEXTSTATE = 181,
200 OP_DBSTATE = 182,
201 OP_UNSTACK = 183,
202 OP_ENTER = 184,
203 OP_LEAVE = 185,
204 OP_SCOPE = 186,
205 OP_ENTERITER = 187,
206 OP_ITER = 188,
207 OP_ENTERLOOP = 189,
208 OP_LEAVELOOP = 190,
209 OP_RETURN = 191,
210 OP_LAST = 192,
211 OP_NEXT = 193,
212 OP_REDO = 194,
213 OP_DUMP = 195,
214 OP_GOTO = 196,
215 OP_EXIT = 197,
216 OP_METHOD_NAMED = 198,
217 OP_ENTERGIVEN = 199,
218 OP_LEAVEGIVEN = 200,
219 OP_ENTERWHEN = 201,
220 OP_LEAVEWHEN = 202,
221 OP_BREAK = 203,
222 OP_CONTINUE = 204,
223 OP_OPEN = 205,
224 OP_CLOSE = 206,
225 OP_PIPE_OP = 207,
226 OP_FILENO = 208,
227 OP_UMASK = 209,
228 OP_BINMODE = 210,
229 OP_TIE = 211,
230 OP_UNTIE = 212,
231 OP_TIED = 213,
232 OP_DBMOPEN = 214,
233 OP_DBMCLOSE = 215,
234 OP_SSELECT = 216,
235 OP_SELECT = 217,
236 OP_GETC = 218,
237 OP_READ = 219,
238 OP_ENTERWRITE = 220,
239 OP_LEAVEWRITE = 221,
240 OP_PRTF = 222,
241 OP_PRINT = 223,
242 OP_SAY = 224,
243 OP_SYSOPEN = 225,
244 OP_SYSSEEK = 226,
245 OP_SYSREAD = 227,
246 OP_SYSWRITE = 228,
247 OP_EOF = 229,
248 OP_TELL = 230,
249 OP_SEEK = 231,
250 OP_TRUNCATE = 232,
251 OP_FCNTL = 233,
252 OP_IOCTL = 234,
253 OP_FLOCK = 235,
254 OP_SEND = 236,
255 OP_RECV = 237,
256 OP_SOCKET = 238,
257 OP_SOCKPAIR = 239,
258 OP_BIND = 240,
259 OP_CONNECT = 241,
260 OP_LISTEN = 242,
261 OP_ACCEPT = 243,
262 OP_SHUTDOWN = 244,
263 OP_GSOCKOPT = 245,
264 OP_SSOCKOPT = 246,
265 OP_GETSOCKNAME = 247,
266 OP_GETPEERNAME = 248,
267 OP_LSTAT = 249,
268 OP_STAT = 250,
269 OP_FTRREAD = 251,
270 OP_FTRWRITE = 252,
271 OP_FTREXEC = 253,
272 OP_FTEREAD = 254,
273 OP_FTEWRITE = 255,
274 OP_FTEEXEC = 256,
275 OP_FTIS = 257,
276 OP_FTSIZE = 258,
277 OP_FTMTIME = 259,
278 OP_FTATIME = 260,
279 OP_FTCTIME = 261,
280 OP_FTROWNED = 262,
281 OP_FTEOWNED = 263,
282 OP_FTZERO = 264,
283 OP_FTSOCK = 265,
284 OP_FTCHR = 266,
285 OP_FTBLK = 267,
286 OP_FTFILE = 268,
287 OP_FTDIR = 269,
288 OP_FTPIPE = 270,
289 OP_FTSUID = 271,
290 OP_FTSGID = 272,
291 OP_FTSVTX = 273,
292 OP_FTLINK = 274,
293 OP_FTTTY = 275,
294 OP_FTTEXT = 276,
295 OP_FTBINARY = 277,
296 OP_CHDIR = 278,
297 OP_CHOWN = 279,
298 OP_CHROOT = 280,
299 OP_UNLINK = 281,
300 OP_CHMOD = 282,
301 OP_UTIME = 283,
302 OP_RENAME = 284,
303 OP_LINK = 285,
304 OP_SYMLINK = 286,
305 OP_READLINK = 287,
306 OP_MKDIR = 288,
307 OP_RMDIR = 289,
308 OP_OPEN_DIR = 290,
309 OP_READDIR = 291,
310 OP_TELLDIR = 292,
311 OP_SEEKDIR = 293,
312 OP_REWINDDIR = 294,
313 OP_CLOSEDIR = 295,
314 OP_FORK = 296,
315 OP_WAIT = 297,
316 OP_WAITPID = 298,
317 OP_SYSTEM = 299,
318 OP_EXEC = 300,
319 OP_KILL = 301,
320 OP_GETPPID = 302,
321 OP_GETPGRP = 303,
322 OP_SETPGRP = 304,
323 OP_GETPRIORITY = 305,
324 OP_SETPRIORITY = 306,
325 OP_TIME = 307,
326 OP_TMS = 308,
327 OP_LOCALTIME = 309,
328 OP_GMTIME = 310,
329 OP_ALARM = 311,
330 OP_SLEEP = 312,
331 OP_SHMGET = 313,
332 OP_SHMCTL = 314,
333 OP_SHMREAD = 315,
334 OP_SHMWRITE = 316,
335 OP_MSGGET = 317,
336 OP_MSGCTL = 318,
337 OP_MSGSND = 319,
338 OP_MSGRCV = 320,
339 OP_SEMOP = 321,
340 OP_SEMGET = 322,
341 OP_SEMCTL = 323,
342 OP_REQUIRE = 324,
343 OP_DOFILE = 325,
344 OP_HINTSEVAL = 326,
345 OP_ENTEREVAL = 327,
346 OP_LEAVEEVAL = 328,
347 OP_ENTERTRY = 329,
348 OP_LEAVETRY = 330,
349 OP_GHBYNAME = 331,
350 OP_GHBYADDR = 332,
351 OP_GHOSTENT = 333,
352 OP_GNBYNAME = 334,
353 OP_GNBYADDR = 335,
354 OP_GNETENT = 336,
355 OP_GPBYNAME = 337,
356 OP_GPBYNUMBER = 338,
357 OP_GPROTOENT = 339,
358 OP_GSBYNAME = 340,
359 OP_GSBYPORT = 341,
360 OP_GSERVENT = 342,
361 OP_SHOSTENT = 343,
362 OP_SNETENT = 344,
363 OP_SPROTOENT = 345,
364 OP_SSERVENT = 346,
365 OP_EHOSTENT = 347,
366 OP_ENETENT = 348,
367 OP_EPROTOENT = 349,
368 OP_ESERVENT = 350,
369 OP_GPWNAM = 351,
370 OP_GPWUID = 352,
371 OP_GPWENT = 353,
372 OP_SPWENT = 354,
373 OP_EPWENT = 355,
374 OP_GGRNAM = 356,
375 OP_GGRGID = 357,
376 OP_GGRENT = 358,
377 OP_SGRENT = 359,
378 OP_EGRENT = 360,
379 OP_GETLOGIN = 361,
380 OP_SYSCALL = 362,
381 OP_LOCK = 363,
382 OP_ONCE = 364,
383 OP_CUSTOM = 365,
abdd5c84
GS
384 OP_max
385} opcode;
386
867fa1e2 387#define MAXO 366
4c80c0b2
NC
388#define OP_phoney_INPUT_ONLY -1
389#define OP_phoney_OUTPUT_ONLY -2
abdd5c84 390
a85d93d9 391
e71197e2
JC
392/* the OP_IS_(SOCKET|FILETEST) macros are optimized to a simple range
393 check because all the member OPs are contiguous in opcode.pl
394 <DATA> table. opcode.pl verifies the range contiguity. */
a85d93d9 395
e71197e2
JC
396#define OP_IS_SOCKET(op) \
397 ((op) >= OP_SEND && (op) <= OP_GETPEERNAME)
a85d93d9
JH
398
399#define OP_IS_FILETEST(op) \
e71197e2 400 ((op) >= OP_FTRREAD && (op) <= OP_FTBINARY)
a85d93d9 401
6ecf81d6
JC
402#define OP_IS_FILETEST_ACCESS(op) \
403 ((op) >= OP_FTRREAD && (op) <= OP_FTEEXEC)
404
37442d52 405/* ex: set ro: */