2 * Copyright (c) 1996-1999 Malcolm Beattie
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.
9 * This file is autogenerated from bytecode.pl. Changes made here will be lost.
12 #define PERL_NO_GET_CONTEXT
22 static const int optype_size[] = {
37 bset_obj_store(pTHX_ struct byteloader_state *bstate, void *obj, I32 ix)
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;
43 bstate->bs_obj_list[ix] = obj;
48 byterun(pTHX_ register struct byteloader_state *bstate)
52 SV *specialsv_list[6];
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;
57 bstate->bs_obj_list[0] = NULL; /* first is always Null */
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;
64 specialsv_list[4] = pWARN_ALL;
65 specialsv_list[5] = pWARN_NONE;
67 while ((insn = BGET_FGETC()) != EOF) {
69 case INSN_COMMENT: /* 35 */
76 case INSN_NOP: /* 10 */
80 case INSN_RET: /* 0 */
85 case INSN_LDSV: /* 1 */
92 case INSN_LDOP: /* 2 */
99 case INSN_STSV: /* 3 */
103 BSET_OBJ_STORE(bstate->bs_sv, arg);
106 case INSN_STOP: /* 4 */
110 BSET_OBJ_STORE(PL_op, arg);
113 case INSN_STPV: /* 5 */
117 BSET_stpv(bstate->bs_pv.xpv_pv, arg);
120 case INSN_LDSPECSV: /* 6 */
124 BSET_ldspecsv(bstate->bs_sv, arg);
127 case INSN_LDSPECSVX: /* 7 */
131 BSET_ldspecsvx(bstate->bs_sv, arg);
134 case INSN_NEWSV: /* 8 */
138 BSET_newsv(bstate->bs_sv, arg);
141 case INSN_NEWSVX: /* 9 */
145 BSET_newsvx(bstate->bs_sv, arg);
148 case INSN_NEWOP: /* 11 */
152 BSET_newop(PL_op, arg);
155 case INSN_NEWOPX: /* 12 */
159 BSET_newopx(PL_op, arg);
162 case INSN_NEWOPN: /* 13 */
166 BSET_newopn(PL_op, arg);
169 case INSN_NEWPV: /* 14 */
175 case INSN_PV_CUR: /* 15 */
179 bstate->bs_pv.xpv_cur = arg;
182 case INSN_PV_FREE: /* 16 */
184 BSET_pv_free(bstate->bs_pv);
187 case INSN_SV_UPGRADE: /* 17 */
191 BSET_sv_upgrade(bstate->bs_sv, arg);
194 case INSN_SV_REFCNT: /* 18 */
198 SvREFCNT(bstate->bs_sv) = arg;
201 case INSN_SV_REFCNT_ADD: /* 19 */
205 BSET_sv_refcnt_add(SvREFCNT(bstate->bs_sv), arg);
208 case INSN_SV_FLAGS: /* 20 */
212 SvFLAGS(bstate->bs_sv) = arg;
215 case INSN_XRV: /* 21 */
219 SvRV(bstate->bs_sv) = arg;
222 case INSN_XPV: /* 22 */
224 BSET_xpv(bstate->bs_sv);
227 case INSN_XPV_CUR: /* 23 */
231 SvCUR(bstate->bs_sv) = arg;
234 case INSN_XPV_LEN: /* 24 */
238 SvLEN(bstate->bs_sv) = arg;
241 case INSN_XIV: /* 25 */
245 SvIVX(bstate->bs_sv) = arg;
248 case INSN_XNV: /* 26 */
252 SvNVX(bstate->bs_sv) = arg;
255 case INSN_XLV_TARGOFF: /* 27 */
259 LvTARGOFF(bstate->bs_sv) = arg;
262 case INSN_XLV_TARGLEN: /* 28 */
266 LvTARGLEN(bstate->bs_sv) = arg;
269 case INSN_XLV_TARG: /* 29 */
273 LvTARG(bstate->bs_sv) = arg;
276 case INSN_XLV_TYPE: /* 30 */
280 LvTYPE(bstate->bs_sv) = arg;
283 case INSN_XBM_USEFUL: /* 31 */
287 BmUSEFUL(bstate->bs_sv) = arg;
290 case INSN_XBM_PREVIOUS: /* 32 */
294 BmPREVIOUS(bstate->bs_sv) = arg;
297 case INSN_XBM_RARE: /* 33 */
301 BmRARE(bstate->bs_sv) = arg;
304 case INSN_XFM_LINES: /* 34 */
308 FmLINES(bstate->bs_sv) = arg;
311 case INSN_XIO_LINES: /* 36 */
315 IoLINES(bstate->bs_sv) = arg;
318 case INSN_XIO_PAGE: /* 37 */
322 IoPAGE(bstate->bs_sv) = arg;
325 case INSN_XIO_PAGE_LEN: /* 38 */
329 IoPAGE_LEN(bstate->bs_sv) = arg;
332 case INSN_XIO_LINES_LEFT: /* 39 */
336 IoLINES_LEFT(bstate->bs_sv) = arg;
339 case INSN_XIO_TOP_NAME: /* 40 */
343 IoTOP_NAME(bstate->bs_sv) = arg;
346 case INSN_XIO_TOP_GV: /* 41 */
350 *(SV**)&IoTOP_GV(bstate->bs_sv) = arg;
353 case INSN_XIO_FMT_NAME: /* 42 */
357 IoFMT_NAME(bstate->bs_sv) = arg;
360 case INSN_XIO_FMT_GV: /* 43 */
364 *(SV**)&IoFMT_GV(bstate->bs_sv) = arg;
367 case INSN_XIO_BOTTOM_NAME: /* 44 */
371 IoBOTTOM_NAME(bstate->bs_sv) = arg;
374 case INSN_XIO_BOTTOM_GV: /* 45 */
378 *(SV**)&IoBOTTOM_GV(bstate->bs_sv) = arg;
381 case INSN_XIO_SUBPROCESS: /* 46 */
385 IoSUBPROCESS(bstate->bs_sv) = arg;
388 case INSN_XIO_TYPE: /* 47 */
392 IoTYPE(bstate->bs_sv) = arg;
395 case INSN_XIO_FLAGS: /* 48 */
399 IoFLAGS(bstate->bs_sv) = arg;
402 case INSN_XCV_XSUBANY: /* 49 */
406 *(SV**)&CvXSUBANY(bstate->bs_sv).any_ptr = arg;
409 case INSN_XCV_STASH: /* 50 */
413 *(SV**)&CvSTASH(bstate->bs_sv) = arg;
416 case INSN_XCV_START: /* 51 */
420 CvSTART(bstate->bs_sv) = arg;
423 case INSN_XCV_ROOT: /* 52 */
427 CvROOT(bstate->bs_sv) = arg;
430 case INSN_XCV_GV: /* 53 */
434 *(SV**)&CvGV(bstate->bs_sv) = arg;
437 case INSN_XCV_FILE: /* 54 */
441 CvFILE(bstate->bs_sv) = arg;
444 case INSN_XCV_DEPTH: /* 55 */
448 CvDEPTH(bstate->bs_sv) = arg;
451 case INSN_XCV_PADLIST: /* 56 */
455 *(SV**)&CvPADLIST(bstate->bs_sv) = arg;
458 case INSN_XCV_OUTSIDE: /* 57 */
462 *(SV**)&CvOUTSIDE(bstate->bs_sv) = arg;
465 case INSN_XCV_OUTSIDE_SEQ: /* 58 */
469 CvOUTSIDE_SEQ(bstate->bs_sv) = arg;
472 case INSN_XCV_FLAGS: /* 59 */
476 CvFLAGS(bstate->bs_sv) = arg;
479 case INSN_AV_EXTEND: /* 60 */
483 BSET_av_extend(bstate->bs_sv, arg);
486 case INSN_AV_PUSHX: /* 61 */
490 BSET_av_pushx(bstate->bs_sv, arg);
493 case INSN_AV_PUSH: /* 62 */
497 BSET_av_push(bstate->bs_sv, arg);
500 case INSN_XAV_FILL: /* 63 */
504 AvFILLp(bstate->bs_sv) = arg;
507 case INSN_XAV_MAX: /* 64 */
511 AvMAX(bstate->bs_sv) = arg;
514 case INSN_XAV_FLAGS: /* 65 */
518 AvFLAGS(bstate->bs_sv) = arg;
521 case INSN_XHV_RITER: /* 66 */
525 HvRITER(bstate->bs_sv) = arg;
528 case INSN_XHV_NAME: /* 67 */
532 HvNAME(bstate->bs_sv) = arg;
535 case INSN_XHV_PMROOT: /* 68 */
539 *(OP**)&HvPMROOT(bstate->bs_sv) = arg;
542 case INSN_HV_STORE: /* 69 */
546 BSET_hv_store(bstate->bs_sv, arg);
549 case INSN_SV_MAGIC: /* 70 */
553 BSET_sv_magic(bstate->bs_sv, arg);
556 case INSN_MG_OBJ: /* 71 */
560 SvMAGIC(bstate->bs_sv)->mg_obj = arg;
563 case INSN_MG_PRIVATE: /* 72 */
567 SvMAGIC(bstate->bs_sv)->mg_private = arg;
570 case INSN_MG_FLAGS: /* 73 */
574 SvMAGIC(bstate->bs_sv)->mg_flags = arg;
577 case INSN_MG_NAME: /* 74 */
580 BGET_pvcontents(arg);
581 BSET_mg_name(SvMAGIC(bstate->bs_sv), arg);
584 case INSN_MG_NAMEX: /* 75 */
588 BSET_mg_namex(SvMAGIC(bstate->bs_sv), arg);
591 case INSN_XMG_STASH: /* 76 */
595 *(SV**)&SvSTASH(bstate->bs_sv) = arg;
598 case INSN_GV_FETCHPV: /* 77 */
602 BSET_gv_fetchpv(bstate->bs_sv, arg);
605 case INSN_GV_FETCHPVX: /* 78 */
609 BSET_gv_fetchpvx(bstate->bs_sv, arg);
612 case INSN_GV_STASHPV: /* 79 */
616 BSET_gv_stashpv(bstate->bs_sv, arg);
619 case INSN_GV_STASHPVX: /* 80 */
623 BSET_gv_stashpvx(bstate->bs_sv, arg);
626 case INSN_GP_SV: /* 81 */
630 GvSV(bstate->bs_sv) = arg;
633 case INSN_GP_REFCNT: /* 82 */
637 GvREFCNT(bstate->bs_sv) = arg;
640 case INSN_GP_REFCNT_ADD: /* 83 */
644 BSET_gp_refcnt_add(GvREFCNT(bstate->bs_sv), arg);
647 case INSN_GP_AV: /* 84 */
651 *(SV**)&GvAV(bstate->bs_sv) = arg;
654 case INSN_GP_HV: /* 85 */
658 *(SV**)&GvHV(bstate->bs_sv) = arg;
661 case INSN_GP_CV: /* 86 */
665 *(SV**)&GvCV(bstate->bs_sv) = arg;
668 case INSN_GP_FILE: /* 87 */
672 GvFILE(bstate->bs_sv) = arg;
675 case INSN_GP_IO: /* 88 */
679 *(SV**)&GvIOp(bstate->bs_sv) = arg;
682 case INSN_GP_FORM: /* 89 */
686 *(SV**)&GvFORM(bstate->bs_sv) = arg;
689 case INSN_GP_CVGEN: /* 90 */
693 GvCVGEN(bstate->bs_sv) = arg;
696 case INSN_GP_LINE: /* 91 */
700 GvLINE(bstate->bs_sv) = arg;
703 case INSN_GP_SHARE: /* 92 */
707 BSET_gp_share(bstate->bs_sv, arg);
710 case INSN_XGV_FLAGS: /* 93 */
714 GvFLAGS(bstate->bs_sv) = arg;
717 case INSN_OP_NEXT: /* 94 */
721 PL_op->op_next = arg;
724 case INSN_OP_SIBLING: /* 95 */
728 PL_op->op_sibling = arg;
731 case INSN_OP_PPADDR: /* 96 */
735 BSET_op_ppaddr(PL_op->op_ppaddr, arg);
738 case INSN_OP_TARG: /* 97 */
742 PL_op->op_targ = arg;
745 case INSN_OP_TYPE: /* 98 */
749 BSET_op_type(PL_op, arg);
752 case INSN_OP_SEQ: /* 99 */
759 case INSN_OP_FLAGS: /* 100 */
763 PL_op->op_flags = arg;
766 case INSN_OP_PRIVATE: /* 101 */
770 PL_op->op_private = arg;
773 case INSN_OP_FIRST: /* 102 */
777 cUNOP->op_first = arg;
780 case INSN_OP_LAST: /* 103 */
784 cBINOP->op_last = arg;
787 case INSN_OP_OTHER: /* 104 */
791 cLOGOP->op_other = arg;
794 case INSN_OP_PMREPLROOT: /* 105 */
798 cPMOP->op_pmreplroot = arg;
801 case INSN_OP_PMREPLSTART: /* 106 */
805 cPMOP->op_pmreplstart = arg;
808 case INSN_OP_PMNEXT: /* 107 */
812 *(OP**)&cPMOP->op_pmnext = arg;
816 case INSN_OP_PMSTASHPV: /* 108 */
820 cPMOP->op_pmstashpv = arg;
823 case INSN_OP_PMREPLROOTPO: /* 109 */
827 cPMOP->op_pmreplroot = (OP*)arg;
831 case INSN_OP_PMSTASH: /* 110 */
835 *(SV**)&cPMOP->op_pmstash = arg;
838 case INSN_OP_PMREPLROOTGV: /* 111 */
842 *(SV**)&cPMOP->op_pmreplroot = arg;
846 case INSN_PREGCOMP: /* 112 */
849 BGET_pvcontents(arg);
850 BSET_pregcomp(PL_op, arg);
853 case INSN_OP_PMFLAGS: /* 113 */
857 cPMOP->op_pmflags = arg;
860 case INSN_OP_PMPERMFLAGS: /* 114 */
864 cPMOP->op_pmpermflags = arg;
867 case INSN_OP_PMDYNFLAGS: /* 115 */
871 cPMOP->op_pmdynflags = arg;
874 case INSN_OP_SV: /* 116 */
881 case INSN_OP_PADIX: /* 117 */
885 cPADOP->op_padix = arg;
888 case INSN_OP_PV: /* 118 */
891 BGET_pvcontents(arg);
895 case INSN_OP_PV_TR: /* 119 */
898 BGET_op_tr_array(arg);
902 case INSN_OP_REDOOP: /* 120 */
906 cLOOP->op_redoop = arg;
909 case INSN_OP_NEXTOP: /* 121 */
913 cLOOP->op_nextop = arg;
916 case INSN_OP_LASTOP: /* 122 */
920 cLOOP->op_lastop = arg;
923 case INSN_COP_LABEL: /* 123 */
927 cCOP->cop_label = arg;
931 case INSN_COP_STASHPV: /* 124 */
935 BSET_cop_stashpv(cCOP, arg);
938 case INSN_COP_FILE: /* 125 */
942 BSET_cop_file(cCOP, arg);
946 case INSN_COP_STASH: /* 126 */
950 BSET_cop_stash(cCOP, arg);
953 case INSN_COP_FILEGV: /* 127 */
957 BSET_cop_filegv(cCOP, arg);
961 case INSN_COP_SEQ: /* 128 */
968 case INSN_COP_ARYBASE: /* 129 */
972 cCOP->cop_arybase = arg;
975 case INSN_COP_LINE: /* 130 */
979 cCOP->cop_line = arg;
982 case INSN_COP_IO: /* 131 */
989 case INSN_COP_WARNINGS: /* 132 */
993 cCOP->cop_warnings = arg;
996 case INSN_MAIN_START: /* 133 */
1000 PL_main_start = arg;
1003 case INSN_MAIN_ROOT: /* 134 */
1010 case INSN_MAIN_CV: /* 135 */
1014 *(SV**)&PL_main_cv = arg;
1017 case INSN_CURPAD: /* 136 */
1021 BSET_curpad(PL_curpad, arg);
1024 case INSN_PUSH_BEGIN: /* 137 */
1028 BSET_push_begin(PL_beginav, arg);
1031 case INSN_PUSH_INIT: /* 138 */
1035 BSET_push_init(PL_initav, arg);
1038 case INSN_PUSH_END: /* 139 */
1042 BSET_push_end(PL_endav, arg);
1045 case INSN_CURSTASH: /* 140 */
1049 *(SV**)&PL_curstash = arg;
1052 case INSN_DEFSTASH: /* 141 */
1056 *(SV**)&PL_defstash = arg;
1059 case INSN_DATA: /* 142 */
1063 BSET_data(none, arg);
1066 case INSN_INCAV: /* 143 */
1070 *(SV**)&GvAV(PL_incgv) = arg;
1073 case INSN_LOAD_GLOB: /* 144 */
1077 BSET_load_glob(none, arg);
1081 case INSN_REGEX_PADAV: /* 145 */
1085 *(SV**)&PL_regex_padav = arg;
1089 case INSN_DOWARN: /* 146 */
1096 case INSN_COMPPAD_NAME: /* 147 */
1100 *(SV**)&PL_comppad_name = arg;
1103 case INSN_XGV_STASH: /* 148 */
1107 *(SV**)&GvSTASH(bstate->bs_sv) = arg;
1110 case INSN_SIGNAL: /* 149 */
1114 BSET_signal(bstate->bs_sv, arg);
1117 case INSN_FORMFEED: /* 150 */
1125 Perl_croak(aTHX_ "Illegal bytecode instruction %d\n", insn);