1 /* -*- buffer-read-only: t -*-
3 * Copyright (c) 1996-1999 Malcolm Beattie
5 * You may distribute under the terms of either the GNU General Public
6 * License or the Artistic License, as specified in the README file.
10 * This file is autogenerated from bytecode.pl. Changes made here will be lost.
13 #define PERL_NO_GET_CONTEXT
23 static const int optype_size[] = {
38 bset_obj_store(pTHX_ struct byteloader_state *bstate, void *obj, I32 ix)
40 if (ix > bstate->bs_obj_list_fill) {
41 Renew(bstate->bs_obj_list, ix + 32, void*);
42 bstate->bs_obj_list_fill = ix + 31;
44 bstate->bs_obj_list[ix] = obj;
49 byterun(pTHX_ register struct byteloader_state *bstate)
54 SV *specialsv_list[7];
56 BYTECODE_HEADER_CHECK; /* croak if incorrect platform */
57 Newx(bstate->bs_obj_list, 32, void*); /* set op objlist */
58 bstate->bs_obj_list_fill = 31;
59 bstate->bs_obj_list[0] = NULL; /* first is always Null */
62 specialsv_list[0] = Nullsv;
63 specialsv_list[1] = &PL_sv_undef;
64 specialsv_list[2] = &PL_sv_yes;
65 specialsv_list[3] = &PL_sv_no;
66 specialsv_list[4] = (SV*)pWARN_ALL;
67 specialsv_list[5] = (SV*)pWARN_NONE;
68 specialsv_list[6] = (SV*)pWARN_STD;
70 while ((insn = BGET_FGETC()) != EOF) {
72 case INSN_COMMENT: /* 35 */
79 case INSN_NOP: /* 10 */
83 case INSN_RET: /* 0 */
88 case INSN_LDSV: /* 1 */
95 case INSN_LDOP: /* 2 */
102 case INSN_STSV: /* 3 */
106 BSET_OBJ_STORE(bstate->bs_sv, arg);
109 case INSN_STOP: /* 4 */
113 BSET_OBJ_STORE(PL_op, arg);
116 case INSN_STPV: /* 5 */
120 BSET_stpv(bstate->bs_pv.pvx, arg);
123 case INSN_LDSPECSV: /* 6 */
127 BSET_ldspecsv(bstate->bs_sv, arg);
130 case INSN_LDSPECSVX: /* 7 */
134 BSET_ldspecsvx(bstate->bs_sv, arg);
137 case INSN_NEWSV: /* 8 */
141 BSET_newsv(bstate->bs_sv, arg);
144 case INSN_NEWSVX: /* 9 */
148 BSET_newsvx(bstate->bs_sv, arg);
151 case INSN_NEWOP: /* 11 */
155 BSET_newop(PL_op, arg);
158 case INSN_NEWOPX: /* 12 */
162 BSET_newopx(PL_op, arg);
165 case INSN_NEWOPN: /* 13 */
169 BSET_newopn(PL_op, arg);
172 case INSN_NEWPV: /* 14 */
178 case INSN_PV_CUR: /* 15 */
182 bstate->bs_pv.xpv.xpv_cur = arg;
185 case INSN_PV_FREE: /* 16 */
187 BSET_pv_free(bstate->bs_pv.pvx);
190 case INSN_SV_UPGRADE: /* 17 */
194 BSET_sv_upgrade(bstate->bs_sv, arg);
197 case INSN_SV_REFCNT: /* 18 */
201 SvREFCNT(bstate->bs_sv) = arg;
204 case INSN_SV_REFCNT_ADD: /* 19 */
208 BSET_sv_refcnt_add(SvREFCNT(bstate->bs_sv), arg);
211 case INSN_SV_FLAGS: /* 20 */
215 SvFLAGS(bstate->bs_sv) = arg;
218 case INSN_XRV: /* 21 */
222 BSET_xrv(bstate->bs_sv, arg);
225 case INSN_XPV: /* 22 */
227 BSET_xpv(bstate->bs_sv);
230 case INSN_XPV_CUR: /* 23 */
234 BSET_xpv_cur(bstate->bs_sv, arg);
237 case INSN_XPV_LEN: /* 24 */
241 BSET_xpv_len(bstate->bs_sv, arg);
244 case INSN_XIV: /* 25 */
248 BSET_xiv(bstate->bs_sv, arg);
251 case INSN_XNV: /* 26 */
255 BSET_xnv(bstate->bs_sv, arg);
258 case INSN_XLV_TARGOFF: /* 27 */
262 LvTARGOFF(bstate->bs_sv) = arg;
265 case INSN_XLV_TARGLEN: /* 28 */
269 LvTARGLEN(bstate->bs_sv) = arg;
272 case INSN_XLV_TARG: /* 29 */
276 LvTARG(bstate->bs_sv) = arg;
279 case INSN_XLV_TYPE: /* 30 */
283 LvTYPE(bstate->bs_sv) = arg;
286 case INSN_XBM_USEFUL: /* 31 */
290 BmUSEFUL(bstate->bs_sv) = arg;
293 case INSN_XBM_PREVIOUS: /* 32 */
297 BmPREVIOUS(bstate->bs_sv) = arg;
300 case INSN_XBM_RARE: /* 33 */
304 BmRARE(bstate->bs_sv) = arg;
307 case INSN_XFM_LINES: /* 34 */
311 FmLINES(bstate->bs_sv) = arg;
314 case INSN_XIO_LINES: /* 36 */
318 IoLINES(bstate->bs_sv) = arg;
321 case INSN_XIO_PAGE: /* 37 */
325 IoPAGE(bstate->bs_sv) = arg;
328 case INSN_XIO_PAGE_LEN: /* 38 */
332 IoPAGE_LEN(bstate->bs_sv) = arg;
335 case INSN_XIO_LINES_LEFT: /* 39 */
339 IoLINES_LEFT(bstate->bs_sv) = arg;
342 case INSN_XIO_TOP_NAME: /* 40 */
346 IoTOP_NAME(bstate->bs_sv) = arg;
349 case INSN_XIO_TOP_GV: /* 41 */
353 *(SV**)&IoTOP_GV(bstate->bs_sv) = arg;
356 case INSN_XIO_FMT_NAME: /* 42 */
360 IoFMT_NAME(bstate->bs_sv) = arg;
363 case INSN_XIO_FMT_GV: /* 43 */
367 *(SV**)&IoFMT_GV(bstate->bs_sv) = arg;
370 case INSN_XIO_BOTTOM_NAME: /* 44 */
374 IoBOTTOM_NAME(bstate->bs_sv) = arg;
377 case INSN_XIO_BOTTOM_GV: /* 45 */
381 *(SV**)&IoBOTTOM_GV(bstate->bs_sv) = arg;
384 case INSN_XIO_SUBPROCESS: /* 46 */
388 IoSUBPROCESS(bstate->bs_sv) = arg;
391 case INSN_XIO_TYPE: /* 47 */
395 IoTYPE(bstate->bs_sv) = arg;
398 case INSN_XIO_FLAGS: /* 48 */
402 IoFLAGS(bstate->bs_sv) = arg;
405 case INSN_XCV_XSUBANY: /* 49 */
409 *(SV**)&CvXSUBANY(bstate->bs_sv).any_ptr = arg;
412 case INSN_XCV_STASH: /* 50 */
416 *(SV**)&CvSTASH(bstate->bs_sv) = arg;
419 case INSN_XCV_START: /* 51 */
423 CvSTART(bstate->bs_sv) = arg;
426 case INSN_XCV_ROOT: /* 52 */
430 CvROOT(bstate->bs_sv) = arg;
433 case INSN_XCV_GV: /* 53 */
437 *(SV**)&CvGV(bstate->bs_sv) = arg;
440 case INSN_XCV_FILE: /* 54 */
444 CvFILE(bstate->bs_sv) = arg;
447 case INSN_XCV_DEPTH: /* 55 */
451 CvDEPTH(bstate->bs_sv) = arg;
454 case INSN_XCV_PADLIST: /* 56 */
458 *(SV**)&CvPADLIST(bstate->bs_sv) = arg;
461 case INSN_XCV_OUTSIDE: /* 57 */
465 *(SV**)&CvOUTSIDE(bstate->bs_sv) = arg;
468 case INSN_XCV_OUTSIDE_SEQ: /* 58 */
472 CvOUTSIDE_SEQ(bstate->bs_sv) = arg;
475 case INSN_XCV_FLAGS: /* 59 */
479 CvFLAGS(bstate->bs_sv) = arg;
482 case INSN_AV_EXTEND: /* 60 */
486 BSET_av_extend(bstate->bs_sv, arg);
489 case INSN_AV_PUSHX: /* 61 */
493 BSET_av_pushx(bstate->bs_sv, arg);
496 case INSN_AV_PUSH: /* 62 */
500 BSET_av_push(bstate->bs_sv, arg);
503 case INSN_XAV_FILL: /* 63 */
507 AvFILLp(bstate->bs_sv) = arg;
510 case INSN_XAV_MAX: /* 64 */
514 AvMAX(bstate->bs_sv) = arg;
517 case INSN_XHV_RITER: /* 65 */
521 HvRITER(bstate->bs_sv) = arg;
524 case INSN_XHV_NAME: /* 66 */
528 BSET_xhv_name(bstate->bs_sv, arg);
531 case INSN_HV_STORE: /* 67 */
535 BSET_hv_store(bstate->bs_sv, arg);
538 case INSN_SV_MAGIC: /* 68 */
542 BSET_sv_magic(bstate->bs_sv, arg);
545 case INSN_MG_OBJ: /* 69 */
549 SvMAGIC(bstate->bs_sv)->mg_obj = arg;
552 case INSN_MG_PRIVATE: /* 70 */
556 SvMAGIC(bstate->bs_sv)->mg_private = arg;
559 case INSN_MG_FLAGS: /* 71 */
563 SvMAGIC(bstate->bs_sv)->mg_flags = arg;
566 case INSN_MG_NAME: /* 72 */
569 BGET_pvcontents(arg);
570 BSET_mg_name(SvMAGIC(bstate->bs_sv), arg);
573 case INSN_MG_NAMEX: /* 73 */
577 BSET_mg_namex(SvMAGIC(bstate->bs_sv), arg);
580 case INSN_XMG_STASH: /* 74 */
584 BSET_xmg_stash(bstate->bs_sv, arg);
587 case INSN_GV_FETCHPV: /* 75 */
591 BSET_gv_fetchpv(bstate->bs_sv, arg);
594 case INSN_GV_FETCHPVX: /* 76 */
598 BSET_gv_fetchpvx(bstate->bs_sv, arg);
601 case INSN_GV_STASHPV: /* 77 */
605 BSET_gv_stashpv(bstate->bs_sv, arg);
608 case INSN_GV_STASHPVX: /* 78 */
612 BSET_gv_stashpvx(bstate->bs_sv, arg);
615 case INSN_GP_SV: /* 79 */
619 GvSV(bstate->bs_sv) = arg;
622 case INSN_GP_REFCNT: /* 80 */
626 GvREFCNT(bstate->bs_sv) = arg;
629 case INSN_GP_REFCNT_ADD: /* 81 */
633 BSET_gp_refcnt_add(GvREFCNT(bstate->bs_sv), arg);
636 case INSN_GP_AV: /* 82 */
640 *(SV**)&GvAV(bstate->bs_sv) = arg;
643 case INSN_GP_HV: /* 83 */
647 *(SV**)&GvHV(bstate->bs_sv) = arg;
650 case INSN_GP_CV: /* 84 */
654 *(SV**)&GvCV(bstate->bs_sv) = arg;
657 case INSN_GP_FILE: /* 85 */
661 GvFILE(bstate->bs_sv) = arg;
664 case INSN_GP_IO: /* 86 */
668 *(SV**)&GvIOp(bstate->bs_sv) = arg;
671 case INSN_GP_FORM: /* 87 */
675 *(SV**)&GvFORM(bstate->bs_sv) = arg;
678 case INSN_GP_CVGEN: /* 88 */
682 GvCVGEN(bstate->bs_sv) = arg;
685 case INSN_GP_LINE: /* 89 */
689 GvLINE(bstate->bs_sv) = arg;
692 case INSN_GP_SHARE: /* 90 */
696 BSET_gp_share(bstate->bs_sv, arg);
699 case INSN_XGV_FLAGS: /* 91 */
703 GvFLAGS(bstate->bs_sv) = arg;
706 case INSN_OP_NEXT: /* 92 */
710 PL_op->op_next = arg;
713 case INSN_OP_SIBLING: /* 93 */
717 PL_op->op_sibling = arg;
720 case INSN_OP_PPADDR: /* 94 */
724 BSET_op_ppaddr(PL_op->op_ppaddr, arg);
727 case INSN_OP_TARG: /* 95 */
731 PL_op->op_targ = arg;
734 case INSN_OP_TYPE: /* 96 */
738 BSET_op_type(PL_op, arg);
741 case INSN_OP_OPT: /* 97 */
748 case INSN_OP_STATIC: /* 98 */
752 PL_op->op_static = arg;
755 case INSN_OP_FLAGS: /* 99 */
759 PL_op->op_flags = arg;
762 case INSN_OP_PRIVATE: /* 100 */
766 PL_op->op_private = arg;
769 case INSN_OP_FIRST: /* 101 */
773 cUNOP->op_first = arg;
776 case INSN_OP_LAST: /* 102 */
780 cBINOP->op_last = arg;
783 case INSN_OP_OTHER: /* 103 */
787 cLOGOP->op_other = arg;
790 case INSN_OP_PMREPLROOT: /* 104 */
794 cPMOP->op_pmreplroot = arg;
797 case INSN_OP_PMREPLSTART: /* 105 */
801 cPMOP->op_pmreplstart = arg;
804 case INSN_OP_PMNEXT: /* 106 */
808 *(OP**)&cPMOP->op_pmnext = arg;
812 case INSN_OP_PMSTASHPV: /* 107 */
816 BSET_op_pmstashpv(cPMOP, arg);
819 case INSN_OP_PMREPLROOTPO: /* 108 */
823 cPMOP->op_pmreplroot = (OP*)arg;
827 case INSN_OP_PMSTASH: /* 109 */
831 *(SV**)&cPMOP->op_pmstash = arg;
834 case INSN_OP_PMREPLROOTGV: /* 110 */
838 *(SV**)&cPMOP->op_pmreplroot = arg;
842 case INSN_PREGCOMP: /* 111 */
845 BGET_pvcontents(arg);
846 BSET_pregcomp(PL_op, arg);
849 case INSN_OP_PMFLAGS: /* 112 */
853 cPMOP->op_pmflags = arg;
856 case INSN_OP_PMPERMFLAGS: /* 113 */
860 cPMOP->op_pmpermflags = arg;
863 case INSN_OP_PMDYNFLAGS: /* 114 */
867 cPMOP->op_pmdynflags = arg;
870 case INSN_OP_SV: /* 115 */
877 case INSN_OP_PADIX: /* 116 */
881 cPADOP->op_padix = arg;
884 case INSN_OP_PV: /* 117 */
887 BGET_pvcontents(arg);
891 case INSN_OP_PV_TR: /* 118 */
894 BGET_op_tr_array(arg);
898 case INSN_OP_REDOOP: /* 119 */
902 cLOOP->op_redoop = arg;
905 case INSN_OP_NEXTOP: /* 120 */
909 cLOOP->op_nextop = arg;
912 case INSN_OP_LASTOP: /* 121 */
916 cLOOP->op_lastop = arg;
919 case INSN_COP_LABEL: /* 122 */
923 cCOP->cop_label = arg;
927 case INSN_COP_STASHPV: /* 123 */
931 BSET_cop_stashpv(cCOP, arg);
934 case INSN_COP_FILE: /* 124 */
938 BSET_cop_file(cCOP, arg);
942 case INSN_COP_STASH: /* 125 */
946 BSET_cop_stash(cCOP, arg);
949 case INSN_COP_FILEGV: /* 126 */
953 BSET_cop_filegv(cCOP, arg);
957 case INSN_COP_SEQ: /* 127 */
964 case INSN_COP_ARYBASE: /* 128 */
968 BSET_cop_arybase(cCOP, arg);
971 case INSN_COP_LINE: /* 129 */
975 cCOP->cop_line = arg;
978 case INSN_COP_IO: /* 130 */
985 case INSN_COP_WARNINGS: /* 131 */
989 BSET_cop_warnings(cCOP, arg);
992 case INSN_MAIN_START: /* 132 */
999 case INSN_MAIN_ROOT: /* 133 */
1006 case INSN_MAIN_CV: /* 134 */
1010 *(SV**)&PL_main_cv = arg;
1013 case INSN_CURPAD: /* 135 */
1017 BSET_curpad(PL_curpad, arg);
1020 case INSN_PUSH_BEGIN: /* 136 */
1024 BSET_push_begin(PL_beginav, arg);
1027 case INSN_PUSH_INIT: /* 137 */
1031 BSET_push_init(PL_initav, arg);
1034 case INSN_PUSH_END: /* 138 */
1038 BSET_push_end(PL_endav, arg);
1041 case INSN_CURSTASH: /* 139 */
1045 *(SV**)&PL_curstash = arg;
1048 case INSN_DEFSTASH: /* 140 */
1052 *(SV**)&PL_defstash = arg;
1055 case INSN_DATA: /* 141 */
1059 BSET_data(none, arg);
1062 case INSN_INCAV: /* 142 */
1066 *(SV**)&GvAV(PL_incgv) = arg;
1069 case INSN_LOAD_GLOB: /* 143 */
1073 BSET_load_glob(none, arg);
1077 case INSN_REGEX_PADAV: /* 144 */
1081 *(SV**)&PL_regex_padav = arg;
1085 case INSN_DOWARN: /* 145 */
1092 case INSN_COMPPAD_NAME: /* 146 */
1096 *(SV**)&PL_comppad_name = arg;
1099 case INSN_XGV_STASH: /* 147 */
1103 *(SV**)&GvSTASH(bstate->bs_sv) = arg;
1106 case INSN_SIGNAL: /* 148 */
1110 BSET_signal(bstate->bs_sv, arg);
1113 case INSN_FORMFEED: /* 149 */
1121 Perl_croak(aTHX_ "Illegal bytecode instruction %d\n", insn);