This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Refactoring to Sv*_set() macros - patch #5
[perl5.git] / ext / ByteLoader / byterun.c
CommitLineData
79ee8297 1/*
a6c40364 2 * Copyright (c) 1996-1999 Malcolm Beattie
79ee8297
MB
3 *
4 * You may distribute under the terms of either the GNU General Public
5 * License or the Artistic License, as specified in the README file.
6 *
7 */
8/*
9 * This file is autogenerated from bytecode.pl. Changes made here will be lost.
10 */
11
c5be433b 12#define PERL_NO_GET_CONTEXT
79ee8297
MB
13#include "EXTERN.h"
14#include "perl.h"
0cb96387
GS
15#define NO_XSLOCKS
16#include "XSUB.h"
17
e8edd1e6
TH
18#include "byterun.h"
19#include "bytecode.h"
20
0cb96387 21
059a8bb7 22static const int optype_size[] = {
e8edd1e6
TH
23 sizeof(OP),
24 sizeof(UNOP),
25 sizeof(BINOP),
26 sizeof(LOGOP),
e8edd1e6
TH
27 sizeof(LISTOP),
28 sizeof(PMOP),
29 sizeof(SVOP),
7934575e 30 sizeof(PADOP),
e8edd1e6
TH
31 sizeof(PVOP),
32 sizeof(LOOP),
33 sizeof(COP)
34};
35
d613ef02 36void *
acfe0abc 37bset_obj_store(pTHX_ struct byteloader_state *bstate, void *obj, I32 ix)
d613ef02 38{
059a8bb7
JH
39 if (ix > bstate->bs_obj_list_fill) {
40 Renew(bstate->bs_obj_list, ix + 32, void*);
41 bstate->bs_obj_list_fill = ix + 31;
d613ef02 42 }
059a8bb7 43 bstate->bs_obj_list[ix] = obj;
d613ef02
GS
44 return obj;
45}
79ee8297 46
3610fdac 47int
acfe0abc 48byterun(pTHX_ register struct byteloader_state *bstate)
79ee8297 49{
059a8bb7
JH
50 register int insn;
51 U32 ix;
52 SV *specialsv_list[6];
53
54 BYTECODE_HEADER_CHECK; /* croak if incorrect platform */
55 New(666, bstate->bs_obj_list, 32, void*); /* set op objlist */
56 bstate->bs_obj_list_fill = 31;
3610fdac 57 bstate->bs_obj_list[0] = NULL; /* first is always Null */
566ece03 58 bstate->bs_ix = 1;
e8edd1e6
TH
59
60 specialsv_list[0] = Nullsv;
61 specialsv_list[1] = &PL_sv_undef;
62 specialsv_list[2] = &PL_sv_yes;
63 specialsv_list[3] = &PL_sv_no;
059a8bb7
JH
64 specialsv_list[4] = pWARN_ALL;
65 specialsv_list[5] = pWARN_NONE;
e8edd1e6 66
47358472 67 while ((insn = BGET_FGETC()) != EOF) {
79ee8297
MB
68 switch (insn) {
69 case INSN_COMMENT: /* 35 */
70 {
34e97019 71 comment_t arg;
fe3a57c4 72 BGET_comment_t(arg);
79ee8297
MB
73 arg = arg;
74 break;
75 }
76 case INSN_NOP: /* 10 */
77 {
78 break;
79 }
80 case INSN_RET: /* 0 */
81 {
82 BSET_ret(none);
83 break;
84 }
85 case INSN_LDSV: /* 1 */
86 {
87 svindex arg;
01f988be 88 BGET_svindex(arg);
059a8bb7 89 bstate->bs_sv = arg;
79ee8297
MB
90 break;
91 }
92 case INSN_LDOP: /* 2 */
93 {
94 opindex arg;
01f988be 95 BGET_opindex(arg);
533c011a 96 PL_op = arg;
79ee8297
MB
97 break;
98 }
99 case INSN_STSV: /* 3 */
100 {
101 U32 arg;
102 BGET_U32(arg);
059a8bb7 103 BSET_OBJ_STORE(bstate->bs_sv, arg);
79ee8297
MB
104 break;
105 }
106 case INSN_STOP: /* 4 */
107 {
108 U32 arg;
109 BGET_U32(arg);
533c011a 110 BSET_OBJ_STORE(PL_op, arg);
79ee8297
MB
111 break;
112 }
059a8bb7
JH
113 case INSN_STPV: /* 5 */
114 {
115 U32 arg;
116 BGET_U32(arg);
117 BSET_stpv(bstate->bs_pv.xpv_pv, arg);
118 break;
119 }
120 case INSN_LDSPECSV: /* 6 */
79ee8297
MB
121 {
122 U8 arg;
123 BGET_U8(arg);
059a8bb7 124 BSET_ldspecsv(bstate->bs_sv, arg);
79ee8297
MB
125 break;
126 }
566ece03
JH
127 case INSN_LDSPECSVX: /* 7 */
128 {
129 U8 arg;
130 BGET_U8(arg);
131 BSET_ldspecsvx(bstate->bs_sv, arg);
132 break;
133 }
134 case INSN_NEWSV: /* 8 */
79ee8297
MB
135 {
136 U8 arg;
137 BGET_U8(arg);
059a8bb7 138 BSET_newsv(bstate->bs_sv, arg);
79ee8297
MB
139 break;
140 }
566ece03
JH
141 case INSN_NEWSVX: /* 9 */
142 {
143 U32 arg;
144 BGET_U32(arg);
145 BSET_newsvx(bstate->bs_sv, arg);
146 break;
147 }
148 case INSN_NEWOP: /* 11 */
79ee8297
MB
149 {
150 U8 arg;
151 BGET_U8(arg);
533c011a 152 BSET_newop(PL_op, arg);
79ee8297
MB
153 break;
154 }
566ece03
JH
155 case INSN_NEWOPX: /* 12 */
156 {
157 U16 arg;
158 BGET_U16(arg);
159 BSET_newopx(PL_op, arg);
160 break;
161 }
162 case INSN_NEWOPN: /* 13 */
79ee8297
MB
163 {
164 U8 arg;
165 BGET_U8(arg);
533c011a 166 BSET_newopn(PL_op, arg);
79ee8297
MB
167 break;
168 }
566ece03 169 case INSN_NEWPV: /* 14 */
79ee8297
MB
170 {
171 PV arg;
172 BGET_PV(arg);
173 break;
174 }
566ece03 175 case INSN_PV_CUR: /* 15 */
79ee8297
MB
176 {
177 STRLEN arg;
ebc18564 178 BGET_PADOFFSET(arg);
059a8bb7 179 bstate->bs_pv.xpv_cur = arg;
79ee8297
MB
180 break;
181 }
566ece03 182 case INSN_PV_FREE: /* 16 */
79ee8297 183 {
059a8bb7 184 BSET_pv_free(bstate->bs_pv);
79ee8297
MB
185 break;
186 }
566ece03 187 case INSN_SV_UPGRADE: /* 17 */
79ee8297 188 {
6e21dc91 189 U8 arg;
79ee8297 190 BGET_U8(arg);
059a8bb7 191 BSET_sv_upgrade(bstate->bs_sv, arg);
79ee8297
MB
192 break;
193 }
566ece03 194 case INSN_SV_REFCNT: /* 18 */
79ee8297
MB
195 {
196 U32 arg;
197 BGET_U32(arg);
059a8bb7 198 SvREFCNT(bstate->bs_sv) = arg;
79ee8297
MB
199 break;
200 }
566ece03 201 case INSN_SV_REFCNT_ADD: /* 19 */
79ee8297
MB
202 {
203 I32 arg;
204 BGET_I32(arg);
059a8bb7 205 BSET_sv_refcnt_add(SvREFCNT(bstate->bs_sv), arg);
79ee8297
MB
206 break;
207 }
566ece03 208 case INSN_SV_FLAGS: /* 20 */
79ee8297
MB
209 {
210 U32 arg;
211 BGET_U32(arg);
059a8bb7 212 SvFLAGS(bstate->bs_sv) = arg;
79ee8297
MB
213 break;
214 }
566ece03 215 case INSN_XRV: /* 21 */
79ee8297
MB
216 {
217 svindex arg;
01f988be 218 BGET_svindex(arg);
b162af07 219 SvRV_set(bstate->bs_sv, arg);
79ee8297
MB
220 break;
221 }
566ece03 222 case INSN_XPV: /* 22 */
79ee8297 223 {
059a8bb7 224 BSET_xpv(bstate->bs_sv);
79ee8297
MB
225 break;
226 }
b162af07 227 case INSN_XPV_CUR: /* 23 */
79ee8297 228 {
3610fdac 229 STRLEN arg;
ebc18564 230 BGET_PADOFFSET(arg);
b162af07 231 SvCUR_set(bstate->bs_sv, arg);
3610fdac
JH
232 break;
233 }
566ece03 234 case INSN_XPV_LEN: /* 24 */
3610fdac
JH
235 {
236 STRLEN arg;
ebc18564 237 BGET_PADOFFSET(arg);
b162af07 238 SvLEN_set(bstate->bs_sv, arg);
79ee8297
MB
239 break;
240 }
566ece03 241 case INSN_XIV: /* 25 */
79ee8297 242 {
3610fdac
JH
243 IV arg;
244 BGET_IV(arg);
a6f787ca 245 SvIV_set(bstate->bs_sv, arg);
79ee8297
MB
246 break;
247 }
566ece03 248 case INSN_XNV: /* 26 */
79ee8297 249 {
65202027
DS
250 NV arg;
251 BGET_NV(arg);
9d6ce603 252 SvNV_set(bstate->bs_sv, arg);
79ee8297
MB
253 break;
254 }
566ece03 255 case INSN_XLV_TARGOFF: /* 27 */
79ee8297
MB
256 {
257 STRLEN arg;
ebc18564 258 BGET_PADOFFSET(arg);
059a8bb7 259 LvTARGOFF(bstate->bs_sv) = arg;
79ee8297
MB
260 break;
261 }
566ece03 262 case INSN_XLV_TARGLEN: /* 28 */
79ee8297
MB
263 {
264 STRLEN arg;
ebc18564 265 BGET_PADOFFSET(arg);
059a8bb7 266 LvTARGLEN(bstate->bs_sv) = arg;
79ee8297
MB
267 break;
268 }
566ece03 269 case INSN_XLV_TARG: /* 29 */
79ee8297
MB
270 {
271 svindex arg;
01f988be 272 BGET_svindex(arg);
059a8bb7 273 LvTARG(bstate->bs_sv) = arg;
79ee8297
MB
274 break;
275 }
566ece03 276 case INSN_XLV_TYPE: /* 30 */
79ee8297
MB
277 {
278 char arg;
279 BGET_U8(arg);
059a8bb7 280 LvTYPE(bstate->bs_sv) = arg;
79ee8297
MB
281 break;
282 }
566ece03 283 case INSN_XBM_USEFUL: /* 31 */
79ee8297
MB
284 {
285 I32 arg;
286 BGET_I32(arg);
059a8bb7 287 BmUSEFUL(bstate->bs_sv) = arg;
79ee8297
MB
288 break;
289 }
566ece03 290 case INSN_XBM_PREVIOUS: /* 32 */
79ee8297
MB
291 {
292 U16 arg;
293 BGET_U16(arg);
059a8bb7 294 BmPREVIOUS(bstate->bs_sv) = arg;
79ee8297
MB
295 break;
296 }
566ece03 297 case INSN_XBM_RARE: /* 33 */
79ee8297
MB
298 {
299 U8 arg;
300 BGET_U8(arg);
059a8bb7 301 BmRARE(bstate->bs_sv) = arg;
79ee8297
MB
302 break;
303 }
566ece03 304 case INSN_XFM_LINES: /* 34 */
79ee8297 305 {
11a7ac70
JH
306 IV arg;
307 BGET_IV(arg);
059a8bb7 308 FmLINES(bstate->bs_sv) = arg;
79ee8297
MB
309 break;
310 }
566ece03 311 case INSN_XIO_LINES: /* 36 */
79ee8297 312 {
11a7ac70
JH
313 IV arg;
314 BGET_IV(arg);
059a8bb7 315 IoLINES(bstate->bs_sv) = arg;
79ee8297
MB
316 break;
317 }
566ece03 318 case INSN_XIO_PAGE: /* 37 */
79ee8297 319 {
11a7ac70
JH
320 IV arg;
321 BGET_IV(arg);
059a8bb7 322 IoPAGE(bstate->bs_sv) = arg;
79ee8297
MB
323 break;
324 }
566ece03 325 case INSN_XIO_PAGE_LEN: /* 38 */
79ee8297 326 {
11a7ac70
JH
327 IV arg;
328 BGET_IV(arg);
059a8bb7 329 IoPAGE_LEN(bstate->bs_sv) = arg;
79ee8297
MB
330 break;
331 }
566ece03 332 case INSN_XIO_LINES_LEFT: /* 39 */
79ee8297 333 {
11a7ac70
JH
334 IV arg;
335 BGET_IV(arg);
059a8bb7 336 IoLINES_LEFT(bstate->bs_sv) = arg;
79ee8297
MB
337 break;
338 }
566ece03 339 case INSN_XIO_TOP_NAME: /* 40 */
79ee8297 340 {
3610fdac
JH
341 pvindex arg;
342 BGET_pvindex(arg);
059a8bb7 343 IoTOP_NAME(bstate->bs_sv) = arg;
79ee8297
MB
344 break;
345 }
566ece03 346 case INSN_XIO_TOP_GV: /* 41 */
79ee8297
MB
347 {
348 svindex arg;
01f988be 349 BGET_svindex(arg);
059a8bb7 350 *(SV**)&IoTOP_GV(bstate->bs_sv) = arg;
79ee8297
MB
351 break;
352 }
566ece03 353 case INSN_XIO_FMT_NAME: /* 42 */
79ee8297 354 {
3610fdac
JH
355 pvindex arg;
356 BGET_pvindex(arg);
059a8bb7 357 IoFMT_NAME(bstate->bs_sv) = arg;
79ee8297
MB
358 break;
359 }
566ece03 360 case INSN_XIO_FMT_GV: /* 43 */
79ee8297
MB
361 {
362 svindex arg;
01f988be 363 BGET_svindex(arg);
059a8bb7 364 *(SV**)&IoFMT_GV(bstate->bs_sv) = arg;
79ee8297
MB
365 break;
366 }
566ece03 367 case INSN_XIO_BOTTOM_NAME: /* 44 */
79ee8297 368 {
3610fdac
JH
369 pvindex arg;
370 BGET_pvindex(arg);
059a8bb7 371 IoBOTTOM_NAME(bstate->bs_sv) = arg;
79ee8297
MB
372 break;
373 }
566ece03 374 case INSN_XIO_BOTTOM_GV: /* 45 */
79ee8297
MB
375 {
376 svindex arg;
01f988be 377 BGET_svindex(arg);
059a8bb7 378 *(SV**)&IoBOTTOM_GV(bstate->bs_sv) = arg;
79ee8297
MB
379 break;
380 }
566ece03 381 case INSN_XIO_SUBPROCESS: /* 46 */
79ee8297
MB
382 {
383 short arg;
384 BGET_U16(arg);
059a8bb7 385 IoSUBPROCESS(bstate->bs_sv) = arg;
79ee8297
MB
386 break;
387 }
566ece03 388 case INSN_XIO_TYPE: /* 47 */
79ee8297
MB
389 {
390 char arg;
391 BGET_U8(arg);
059a8bb7 392 IoTYPE(bstate->bs_sv) = arg;
79ee8297
MB
393 break;
394 }
566ece03 395 case INSN_XIO_FLAGS: /* 48 */
79ee8297
MB
396 {
397 char arg;
398 BGET_U8(arg);
059a8bb7 399 IoFLAGS(bstate->bs_sv) = arg;
79ee8297
MB
400 break;
401 }
566ece03 402 case INSN_XCV_XSUBANY: /* 49 */
3610fdac
JH
403 {
404 svindex arg;
405 BGET_svindex(arg);
406 *(SV**)&CvXSUBANY(bstate->bs_sv).any_ptr = arg;
407 break;
408 }
566ece03 409 case INSN_XCV_STASH: /* 50 */
79ee8297
MB
410 {
411 svindex arg;
01f988be 412 BGET_svindex(arg);
059a8bb7 413 *(SV**)&CvSTASH(bstate->bs_sv) = arg;
79ee8297
MB
414 break;
415 }
566ece03 416 case INSN_XCV_START: /* 51 */
79ee8297
MB
417 {
418 opindex arg;
01f988be 419 BGET_opindex(arg);
059a8bb7 420 CvSTART(bstate->bs_sv) = arg;
79ee8297
MB
421 break;
422 }
566ece03 423 case INSN_XCV_ROOT: /* 52 */
79ee8297
MB
424 {
425 opindex arg;
01f988be 426 BGET_opindex(arg);
059a8bb7 427 CvROOT(bstate->bs_sv) = arg;
79ee8297
MB
428 break;
429 }
566ece03 430 case INSN_XCV_GV: /* 53 */
79ee8297
MB
431 {
432 svindex arg;
01f988be 433 BGET_svindex(arg);
059a8bb7 434 *(SV**)&CvGV(bstate->bs_sv) = arg;
79ee8297
MB
435 break;
436 }
566ece03 437 case INSN_XCV_FILE: /* 54 */
57843af0 438 {
059a8bb7
JH
439 pvindex arg;
440 BGET_pvindex(arg);
441 CvFILE(bstate->bs_sv) = arg;
57843af0
GS
442 break;
443 }
566ece03 444 case INSN_XCV_DEPTH: /* 55 */
79ee8297
MB
445 {
446 long arg;
ebc18564 447 BGET_long(arg);
059a8bb7 448 CvDEPTH(bstate->bs_sv) = arg;
79ee8297
MB
449 break;
450 }
566ece03 451 case INSN_XCV_PADLIST: /* 56 */
79ee8297
MB
452 {
453 svindex arg;
01f988be 454 BGET_svindex(arg);
059a8bb7 455 *(SV**)&CvPADLIST(bstate->bs_sv) = arg;
79ee8297
MB
456 break;
457 }
566ece03 458 case INSN_XCV_OUTSIDE: /* 57 */
79ee8297
MB
459 {
460 svindex arg;
01f988be 461 BGET_svindex(arg);
059a8bb7 462 *(SV**)&CvOUTSIDE(bstate->bs_sv) = arg;
79ee8297
MB
463 break;
464 }
566ece03 465 case INSN_XCV_OUTSIDE_SEQ: /* 58 */
f52873be
AE
466 {
467 U32 arg;
468 BGET_U32(arg);
469 CvOUTSIDE_SEQ(bstate->bs_sv) = arg;
470 break;
471 }
566ece03 472 case INSN_XCV_FLAGS: /* 59 */
79ee8297 473 {
fc290457
GS
474 U16 arg;
475 BGET_U16(arg);
059a8bb7 476 CvFLAGS(bstate->bs_sv) = arg;
79ee8297
MB
477 break;
478 }
566ece03 479 case INSN_AV_EXTEND: /* 60 */
79ee8297
MB
480 {
481 SSize_t arg;
ebc18564 482 BGET_PADOFFSET(arg);
059a8bb7 483 BSET_av_extend(bstate->bs_sv, arg);
79ee8297
MB
484 break;
485 }
566ece03 486 case INSN_AV_PUSHX: /* 61 */
3610fdac
JH
487 {
488 svindex arg;
489 BGET_svindex(arg);
490 BSET_av_pushx(bstate->bs_sv, arg);
491 break;
492 }
566ece03 493 case INSN_AV_PUSH: /* 62 */
79ee8297
MB
494 {
495 svindex arg;
01f988be 496 BGET_svindex(arg);
059a8bb7 497 BSET_av_push(bstate->bs_sv, arg);
79ee8297
MB
498 break;
499 }
566ece03 500 case INSN_XAV_FILL: /* 63 */
79ee8297
MB
501 {
502 SSize_t arg;
ebc18564 503 BGET_PADOFFSET(arg);
059a8bb7 504 AvFILLp(bstate->bs_sv) = arg;
79ee8297
MB
505 break;
506 }
566ece03 507 case INSN_XAV_MAX: /* 64 */
79ee8297
MB
508 {
509 SSize_t arg;
ebc18564 510 BGET_PADOFFSET(arg);
059a8bb7 511 AvMAX(bstate->bs_sv) = arg;
79ee8297
MB
512 break;
513 }
566ece03 514 case INSN_XAV_FLAGS: /* 65 */
79ee8297
MB
515 {
516 U8 arg;
517 BGET_U8(arg);
059a8bb7 518 AvFLAGS(bstate->bs_sv) = arg;
79ee8297
MB
519 break;
520 }
566ece03 521 case INSN_XHV_RITER: /* 66 */
79ee8297
MB
522 {
523 I32 arg;
524 BGET_I32(arg);
059a8bb7 525 HvRITER(bstate->bs_sv) = arg;
79ee8297
MB
526 break;
527 }
566ece03 528 case INSN_XHV_NAME: /* 67 */
79ee8297 529 {
3610fdac
JH
530 pvindex arg;
531 BGET_pvindex(arg);
059a8bb7 532 HvNAME(bstate->bs_sv) = arg;
79ee8297
MB
533 break;
534 }
566ece03 535 case INSN_XHV_PMROOT: /* 68 */
3610fdac
JH
536 {
537 opindex arg;
538 BGET_opindex(arg);
539 *(OP**)&HvPMROOT(bstate->bs_sv) = arg;
540 break;
541 }
566ece03 542 case INSN_HV_STORE: /* 69 */
79ee8297
MB
543 {
544 svindex arg;
01f988be 545 BGET_svindex(arg);
059a8bb7 546 BSET_hv_store(bstate->bs_sv, arg);
79ee8297
MB
547 break;
548 }
566ece03 549 case INSN_SV_MAGIC: /* 70 */
79ee8297
MB
550 {
551 char arg;
552 BGET_U8(arg);
059a8bb7 553 BSET_sv_magic(bstate->bs_sv, arg);
79ee8297
MB
554 break;
555 }
566ece03 556 case INSN_MG_OBJ: /* 71 */
79ee8297
MB
557 {
558 svindex arg;
01f988be 559 BGET_svindex(arg);
059a8bb7 560 SvMAGIC(bstate->bs_sv)->mg_obj = arg;
79ee8297
MB
561 break;
562 }
566ece03 563 case INSN_MG_PRIVATE: /* 72 */
79ee8297
MB
564 {
565 U16 arg;
566 BGET_U16(arg);
059a8bb7 567 SvMAGIC(bstate->bs_sv)->mg_private = arg;
79ee8297
MB
568 break;
569 }
566ece03 570 case INSN_MG_FLAGS: /* 73 */
79ee8297
MB
571 {
572 U8 arg;
573 BGET_U8(arg);
059a8bb7 574 SvMAGIC(bstate->bs_sv)->mg_flags = arg;
79ee8297
MB
575 break;
576 }
566ece03 577 case INSN_MG_NAME: /* 74 */
79ee8297
MB
578 {
579 pvcontents arg;
580 BGET_pvcontents(arg);
3610fdac
JH
581 BSET_mg_name(SvMAGIC(bstate->bs_sv), arg);
582 break;
583 }
566ece03 584 case INSN_MG_NAMEX: /* 75 */
3610fdac
JH
585 {
586 svindex arg;
587 BGET_svindex(arg);
588 BSET_mg_namex(SvMAGIC(bstate->bs_sv), arg);
79ee8297
MB
589 break;
590 }
566ece03 591 case INSN_XMG_STASH: /* 76 */
79ee8297
MB
592 {
593 svindex arg;
01f988be 594 BGET_svindex(arg);
059a8bb7 595 *(SV**)&SvSTASH(bstate->bs_sv) = arg;
79ee8297
MB
596 break;
597 }
566ece03 598 case INSN_GV_FETCHPV: /* 77 */
79ee8297
MB
599 {
600 strconst arg;
601 BGET_strconst(arg);
059a8bb7 602 BSET_gv_fetchpv(bstate->bs_sv, arg);
79ee8297
MB
603 break;
604 }
566ece03
JH
605 case INSN_GV_FETCHPVX: /* 78 */
606 {
607 strconst arg;
608 BGET_strconst(arg);
609 BSET_gv_fetchpvx(bstate->bs_sv, arg);
610 break;
611 }
612 case INSN_GV_STASHPV: /* 79 */
79ee8297
MB
613 {
614 strconst arg;
615 BGET_strconst(arg);
059a8bb7 616 BSET_gv_stashpv(bstate->bs_sv, arg);
79ee8297
MB
617 break;
618 }
566ece03
JH
619 case INSN_GV_STASHPVX: /* 80 */
620 {
621 strconst arg;
622 BGET_strconst(arg);
623 BSET_gv_stashpvx(bstate->bs_sv, arg);
624 break;
625 }
626 case INSN_GP_SV: /* 81 */
79ee8297
MB
627 {
628 svindex arg;
01f988be 629 BGET_svindex(arg);
059a8bb7 630 GvSV(bstate->bs_sv) = arg;
79ee8297
MB
631 break;
632 }
566ece03 633 case INSN_GP_REFCNT: /* 82 */
79ee8297
MB
634 {
635 U32 arg;
636 BGET_U32(arg);
059a8bb7 637 GvREFCNT(bstate->bs_sv) = arg;
79ee8297
MB
638 break;
639 }
566ece03 640 case INSN_GP_REFCNT_ADD: /* 83 */
79ee8297
MB
641 {
642 I32 arg;
643 BGET_I32(arg);
059a8bb7 644 BSET_gp_refcnt_add(GvREFCNT(bstate->bs_sv), arg);
79ee8297
MB
645 break;
646 }
566ece03 647 case INSN_GP_AV: /* 84 */
79ee8297
MB
648 {
649 svindex arg;
01f988be 650 BGET_svindex(arg);
059a8bb7 651 *(SV**)&GvAV(bstate->bs_sv) = arg;
79ee8297
MB
652 break;
653 }
566ece03 654 case INSN_GP_HV: /* 85 */
79ee8297
MB
655 {
656 svindex arg;
01f988be 657 BGET_svindex(arg);
059a8bb7 658 *(SV**)&GvHV(bstate->bs_sv) = arg;
79ee8297
MB
659 break;
660 }
566ece03 661 case INSN_GP_CV: /* 86 */
79ee8297
MB
662 {
663 svindex arg;
01f988be 664 BGET_svindex(arg);
059a8bb7 665 *(SV**)&GvCV(bstate->bs_sv) = arg;
79ee8297
MB
666 break;
667 }
566ece03 668 case INSN_GP_FILE: /* 87 */
79ee8297 669 {
059a8bb7
JH
670 pvindex arg;
671 BGET_pvindex(arg);
672 GvFILE(bstate->bs_sv) = arg;
79ee8297
MB
673 break;
674 }
566ece03 675 case INSN_GP_IO: /* 88 */
79ee8297
MB
676 {
677 svindex arg;
01f988be 678 BGET_svindex(arg);
059a8bb7 679 *(SV**)&GvIOp(bstate->bs_sv) = arg;
79ee8297
MB
680 break;
681 }
566ece03 682 case INSN_GP_FORM: /* 89 */
79ee8297
MB
683 {
684 svindex arg;
01f988be 685 BGET_svindex(arg);
059a8bb7 686 *(SV**)&GvFORM(bstate->bs_sv) = arg;
79ee8297
MB
687 break;
688 }
566ece03 689 case INSN_GP_CVGEN: /* 90 */
79ee8297
MB
690 {
691 U32 arg;
692 BGET_U32(arg);
059a8bb7 693 GvCVGEN(bstate->bs_sv) = arg;
79ee8297
MB
694 break;
695 }
566ece03 696 case INSN_GP_LINE: /* 91 */
79ee8297
MB
697 {
698 line_t arg;
dea28490 699 BGET_U32(arg);
059a8bb7 700 GvLINE(bstate->bs_sv) = arg;
79ee8297
MB
701 break;
702 }
566ece03 703 case INSN_GP_SHARE: /* 92 */
79ee8297
MB
704 {
705 svindex arg;
01f988be 706 BGET_svindex(arg);
059a8bb7 707 BSET_gp_share(bstate->bs_sv, arg);
79ee8297
MB
708 break;
709 }
566ece03 710 case INSN_XGV_FLAGS: /* 93 */
79ee8297
MB
711 {
712 U8 arg;
713 BGET_U8(arg);
059a8bb7 714 GvFLAGS(bstate->bs_sv) = arg;
79ee8297
MB
715 break;
716 }
566ece03 717 case INSN_OP_NEXT: /* 94 */
79ee8297
MB
718 {
719 opindex arg;
01f988be 720 BGET_opindex(arg);
533c011a 721 PL_op->op_next = arg;
79ee8297
MB
722 break;
723 }
566ece03 724 case INSN_OP_SIBLING: /* 95 */
79ee8297
MB
725 {
726 opindex arg;
01f988be 727 BGET_opindex(arg);
533c011a 728 PL_op->op_sibling = arg;
79ee8297
MB
729 break;
730 }
566ece03 731 case INSN_OP_PPADDR: /* 96 */
79ee8297
MB
732 {
733 strconst arg;
734 BGET_strconst(arg);
6b88bc9c 735 BSET_op_ppaddr(PL_op->op_ppaddr, arg);
79ee8297
MB
736 break;
737 }
566ece03 738 case INSN_OP_TARG: /* 97 */
79ee8297
MB
739 {
740 PADOFFSET arg;
ca337316 741 BGET_PADOFFSET(arg);
533c011a 742 PL_op->op_targ = arg;
79ee8297
MB
743 break;
744 }
566ece03 745 case INSN_OP_TYPE: /* 98 */
79ee8297
MB
746 {
747 OPCODE arg;
748 BGET_U16(arg);
533c011a 749 BSET_op_type(PL_op, arg);
79ee8297
MB
750 break;
751 }
2814eb74 752 case INSN_OP_OPT: /* 99 */
79ee8297 753 {
2814eb74
PJ
754 U8 arg;
755 BGET_U8(arg);
756 PL_op->op_opt = arg;
757 break;
758 }
759 case INSN_OP_STATIC: /* 100 */
760 {
761 U8 arg;
762 BGET_U8(arg);
763 PL_op->op_static = arg;
79ee8297
MB
764 break;
765 }
2814eb74 766 case INSN_OP_FLAGS: /* 101 */
79ee8297
MB
767 {
768 U8 arg;
769 BGET_U8(arg);
533c011a 770 PL_op->op_flags = arg;
79ee8297
MB
771 break;
772 }
2814eb74 773 case INSN_OP_PRIVATE: /* 102 */
79ee8297
MB
774 {
775 U8 arg;
776 BGET_U8(arg);
533c011a 777 PL_op->op_private = arg;
79ee8297
MB
778 break;
779 }
2814eb74 780 case INSN_OP_FIRST: /* 103 */
79ee8297
MB
781 {
782 opindex arg;
01f988be 783 BGET_opindex(arg);
79ee8297
MB
784 cUNOP->op_first = arg;
785 break;
786 }
2814eb74 787 case INSN_OP_LAST: /* 104 */
79ee8297
MB
788 {
789 opindex arg;
01f988be 790 BGET_opindex(arg);
79ee8297
MB
791 cBINOP->op_last = arg;
792 break;
793 }
2814eb74 794 case INSN_OP_OTHER: /* 105 */
79ee8297
MB
795 {
796 opindex arg;
01f988be 797 BGET_opindex(arg);
79ee8297
MB
798 cLOGOP->op_other = arg;
799 break;
800 }
2814eb74 801 case INSN_OP_PMREPLROOT: /* 106 */
79ee8297
MB
802 {
803 opindex arg;
01f988be 804 BGET_opindex(arg);
79ee8297
MB
805 cPMOP->op_pmreplroot = arg;
806 break;
807 }
2814eb74 808 case INSN_OP_PMREPLSTART: /* 107 */
79ee8297
MB
809 {
810 opindex arg;
01f988be 811 BGET_opindex(arg);
79ee8297
MB
812 cPMOP->op_pmreplstart = arg;
813 break;
814 }
2814eb74 815 case INSN_OP_PMNEXT: /* 108 */
79ee8297
MB
816 {
817 opindex arg;
01f988be 818 BGET_opindex(arg);
79ee8297
MB
819 *(OP**)&cPMOP->op_pmnext = arg;
820 break;
821 }
3610fdac 822#ifdef USE_ITHREADS
2814eb74 823 case INSN_OP_PMSTASHPV: /* 109 */
3610fdac
JH
824 {
825 pvindex arg;
826 BGET_pvindex(arg);
47682f07 827 BSET_op_pmstashpv(cPMOP, arg);
3610fdac
JH
828 break;
829 }
2814eb74 830 case INSN_OP_PMREPLROOTPO: /* 110 */
3610fdac
JH
831 {
832 PADOFFSET arg;
ca337316 833 BGET_PADOFFSET(arg);
b97332e7 834 cPMOP->op_pmreplroot = (OP*)arg;
3610fdac
JH
835 break;
836 }
837#else
2814eb74 838 case INSN_OP_PMSTASH: /* 111 */
3610fdac
JH
839 {
840 svindex arg;
841 BGET_svindex(arg);
842 *(SV**)&cPMOP->op_pmstash = arg;
843 break;
844 }
2814eb74 845 case INSN_OP_PMREPLROOTGV: /* 112 */
3610fdac
JH
846 {
847 svindex arg;
848 BGET_svindex(arg);
849 *(SV**)&cPMOP->op_pmreplroot = arg;
850 break;
851 }
852#endif
2814eb74 853 case INSN_PREGCOMP: /* 113 */
79ee8297
MB
854 {
855 pvcontents arg;
856 BGET_pvcontents(arg);
533c011a 857 BSET_pregcomp(PL_op, arg);
79ee8297
MB
858 break;
859 }
2814eb74 860 case INSN_OP_PMFLAGS: /* 114 */
79ee8297
MB
861 {
862 U16 arg;
863 BGET_U16(arg);
864 cPMOP->op_pmflags = arg;
865 break;
866 }
2814eb74 867 case INSN_OP_PMPERMFLAGS: /* 115 */
79ee8297
MB
868 {
869 U16 arg;
870 BGET_U16(arg);
871 cPMOP->op_pmpermflags = arg;
872 break;
873 }
2814eb74 874 case INSN_OP_PMDYNFLAGS: /* 116 */
3610fdac
JH
875 {
876 U8 arg;
877 BGET_U8(arg);
878 cPMOP->op_pmdynflags = arg;
879 break;
880 }
2814eb74 881 case INSN_OP_SV: /* 117 */
79ee8297
MB
882 {
883 svindex arg;
01f988be 884 BGET_svindex(arg);
79ee8297
MB
885 cSVOP->op_sv = arg;
886 break;
887 }
2814eb74 888 case INSN_OP_PADIX: /* 118 */
79ee8297 889 {
7934575e 890 PADOFFSET arg;
ca337316 891 BGET_PADOFFSET(arg);
7934575e 892 cPADOP->op_padix = arg;
79ee8297
MB
893 break;
894 }
2814eb74 895 case INSN_OP_PV: /* 119 */
79ee8297
MB
896 {
897 pvcontents arg;
898 BGET_pvcontents(arg);
899 cPVOP->op_pv = arg;
900 break;
901 }
2814eb74 902 case INSN_OP_PV_TR: /* 120 */
79ee8297
MB
903 {
904 op_tr_array arg;
905 BGET_op_tr_array(arg);
906 cPVOP->op_pv = arg;
907 break;
908 }
2814eb74 909 case INSN_OP_REDOOP: /* 121 */
79ee8297
MB
910 {
911 opindex arg;
01f988be 912 BGET_opindex(arg);
79ee8297
MB
913 cLOOP->op_redoop = arg;
914 break;
915 }
2814eb74 916 case INSN_OP_NEXTOP: /* 122 */
79ee8297
MB
917 {
918 opindex arg;
01f988be 919 BGET_opindex(arg);
79ee8297
MB
920 cLOOP->op_nextop = arg;
921 break;
922 }
2814eb74 923 case INSN_OP_LASTOP: /* 123 */
79ee8297
MB
924 {
925 opindex arg;
01f988be 926 BGET_opindex(arg);
79ee8297
MB
927 cLOOP->op_lastop = arg;
928 break;
929 }
2814eb74 930 case INSN_COP_LABEL: /* 124 */
79ee8297 931 {
059a8bb7
JH
932 pvindex arg;
933 BGET_pvindex(arg);
79ee8297
MB
934 cCOP->cop_label = arg;
935 break;
936 }
3610fdac 937#ifdef USE_ITHREADS
2814eb74 938 case INSN_COP_STASHPV: /* 125 */
79ee8297 939 {
059a8bb7
JH
940 pvindex arg;
941 BGET_pvindex(arg);
11faa288 942 BSET_cop_stashpv(cCOP, arg);
79ee8297
MB
943 break;
944 }
2814eb74 945 case INSN_COP_FILE: /* 126 */
79ee8297 946 {
059a8bb7
JH
947 pvindex arg;
948 BGET_pvindex(arg);
57843af0 949 BSET_cop_file(cCOP, arg);
79ee8297
MB
950 break;
951 }
3610fdac 952#else
2814eb74 953 case INSN_COP_STASH: /* 127 */
3610fdac
JH
954 {
955 svindex arg;
956 BGET_svindex(arg);
957 BSET_cop_stash(cCOP, arg);
958 break;
959 }
2814eb74 960 case INSN_COP_FILEGV: /* 128 */
3610fdac
JH
961 {
962 svindex arg;
963 BGET_svindex(arg);
964 BSET_cop_filegv(cCOP, arg);
965 break;
966 }
967#endif
2814eb74 968 case INSN_COP_SEQ: /* 129 */
79ee8297
MB
969 {
970 U32 arg;
971 BGET_U32(arg);
972 cCOP->cop_seq = arg;
973 break;
974 }
2814eb74 975 case INSN_COP_ARYBASE: /* 130 */
79ee8297
MB
976 {
977 I32 arg;
978 BGET_I32(arg);
979 cCOP->cop_arybase = arg;
980 break;
981 }
2814eb74 982 case INSN_COP_LINE: /* 131 */
79ee8297
MB
983 {
984 line_t arg;
dea28490 985 BGET_U32(arg);
3610fdac
JH
986 cCOP->cop_line = arg;
987 break;
988 }
2814eb74 989 case INSN_COP_IO: /* 132 */
3610fdac
JH
990 {
991 svindex arg;
992 BGET_svindex(arg);
993 cCOP->cop_io = arg;
79ee8297
MB
994 break;
995 }
2814eb74 996 case INSN_COP_WARNINGS: /* 133 */
b295d113
TH
997 {
998 svindex arg;
999 BGET_svindex(arg);
1000 cCOP->cop_warnings = arg;
1001 break;
1002 }
2814eb74 1003 case INSN_MAIN_START: /* 134 */
79ee8297
MB
1004 {
1005 opindex arg;
01f988be 1006 BGET_opindex(arg);
3280af22 1007 PL_main_start = arg;
79ee8297
MB
1008 break;
1009 }
2814eb74 1010 case INSN_MAIN_ROOT: /* 135 */
79ee8297
MB
1011 {
1012 opindex arg;
01f988be 1013 BGET_opindex(arg);
3280af22 1014 PL_main_root = arg;
79ee8297
MB
1015 break;
1016 }
2814eb74 1017 case INSN_MAIN_CV: /* 136 */
3610fdac
JH
1018 {
1019 svindex arg;
1020 BGET_svindex(arg);
1021 *(SV**)&PL_main_cv = arg;
1022 break;
1023 }
2814eb74 1024 case INSN_CURPAD: /* 137 */
79ee8297
MB
1025 {
1026 svindex arg;
01f988be 1027 BGET_svindex(arg);
3280af22 1028 BSET_curpad(PL_curpad, arg);
79ee8297
MB
1029 break;
1030 }
2814eb74 1031 case INSN_PUSH_BEGIN: /* 138 */
059a8bb7
JH
1032 {
1033 svindex arg;
1034 BGET_svindex(arg);
1035 BSET_push_begin(PL_beginav, arg);
1036 break;
1037 }
2814eb74 1038 case INSN_PUSH_INIT: /* 139 */
059a8bb7
JH
1039 {
1040 svindex arg;
1041 BGET_svindex(arg);
1042 BSET_push_init(PL_initav, arg);
1043 break;
1044 }
2814eb74 1045 case INSN_PUSH_END: /* 140 */
059a8bb7
JH
1046 {
1047 svindex arg;
1048 BGET_svindex(arg);
1049 BSET_push_end(PL_endav, arg);
1050 break;
1051 }
2814eb74 1052 case INSN_CURSTASH: /* 141 */
3610fdac
JH
1053 {
1054 svindex arg;
1055 BGET_svindex(arg);
1056 *(SV**)&PL_curstash = arg;
1057 break;
1058 }
2814eb74 1059 case INSN_DEFSTASH: /* 142 */
3610fdac
JH
1060 {
1061 svindex arg;
1062 BGET_svindex(arg);
1063 *(SV**)&PL_defstash = arg;
1064 break;
1065 }
2814eb74 1066 case INSN_DATA: /* 143 */
3610fdac
JH
1067 {
1068 U8 arg;
1069 BGET_U8(arg);
1070 BSET_data(none, arg);
1071 break;
1072 }
2814eb74 1073 case INSN_INCAV: /* 144 */
3610fdac
JH
1074 {
1075 svindex arg;
1076 BGET_svindex(arg);
0ac16f7c 1077 *(SV**)&GvAV(PL_incgv) = arg;
3610fdac
JH
1078 break;
1079 }
2814eb74 1080 case INSN_LOAD_GLOB: /* 145 */
3610fdac
JH
1081 {
1082 svindex arg;
1083 BGET_svindex(arg);
1084 BSET_load_glob(none, arg);
1085 break;
1086 }
1087#ifdef USE_ITHREADS
2814eb74 1088 case INSN_REGEX_PADAV: /* 146 */
3610fdac
JH
1089 {
1090 svindex arg;
1091 BGET_svindex(arg);
1092 *(SV**)&PL_regex_padav = arg;
1093 break;
1094 }
1095#endif
2814eb74 1096 case INSN_DOWARN: /* 147 */
3610fdac
JH
1097 {
1098 U8 arg;
1099 BGET_U8(arg);
1100 PL_dowarn = arg;
1101 break;
1102 }
2814eb74 1103 case INSN_COMPPAD_NAME: /* 148 */
3610fdac
JH
1104 {
1105 svindex arg;
1106 BGET_svindex(arg);
1107 *(SV**)&PL_comppad_name = arg;
1108 break;
1109 }
2814eb74 1110 case INSN_XGV_STASH: /* 149 */
3610fdac
JH
1111 {
1112 svindex arg;
1113 BGET_svindex(arg);
1114 *(SV**)&GvSTASH(bstate->bs_sv) = arg;
1115 break;
1116 }
2814eb74 1117 case INSN_SIGNAL: /* 150 */
3610fdac
JH
1118 {
1119 strconst arg;
1120 BGET_strconst(arg);
1121 BSET_signal(bstate->bs_sv, arg);
1122 break;
1123 }
2814eb74 1124 case INSN_FORMFEED: /* 151 */
3610fdac
JH
1125 {
1126 svindex arg;
1127 BGET_svindex(arg);
1128 PL_formfeed = arg;
1129 break;
1130 }
79ee8297 1131 default:
cea2e8a9 1132 Perl_croak(aTHX_ "Illegal bytecode instruction %d\n", insn);
79ee8297
MB
1133 /* NOTREACHED */
1134 }
1135 }
3610fdac 1136 return 0;
79ee8297 1137}