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[6];
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] = pWARN_ALL;
67 specialsv_list[5] = pWARN_NONE;
69 while ((insn = BGET_FGETC()) != EOF) {
71 case INSN_COMMENT: /* 35 */
78 case INSN_NOP: /* 10 */
82 case INSN_RET: /* 0 */
87 case INSN_LDSV: /* 1 */
94 case INSN_LDOP: /* 2 */
101 case INSN_STSV: /* 3 */
105 BSET_OBJ_STORE(bstate->bs_sv, arg);
108 case INSN_STOP: /* 4 */
112 BSET_OBJ_STORE(PL_op, arg);
115 case INSN_STPV: /* 5 */
119 BSET_stpv(bstate->bs_pv.pvx, arg);
122 case INSN_LDSPECSV: /* 6 */
126 BSET_ldspecsv(bstate->bs_sv, arg);
129 case INSN_LDSPECSVX: /* 7 */
133 BSET_ldspecsvx(bstate->bs_sv, arg);
136 case INSN_NEWSV: /* 8 */
140 BSET_newsv(bstate->bs_sv, arg);
143 case INSN_NEWSVX: /* 9 */
147 BSET_newsvx(bstate->bs_sv, arg);
150 case INSN_NEWOP: /* 11 */
154 BSET_newop(PL_op, arg);
157 case INSN_NEWOPX: /* 12 */
161 BSET_newopx(PL_op, arg);
164 case INSN_NEWOPN: /* 13 */
168 BSET_newopn(PL_op, arg);
171 case INSN_NEWPV: /* 14 */
177 case INSN_PV_CUR: /* 15 */
181 bstate->bs_pv.xpv.xpv_cur = arg;
184 case INSN_PV_FREE: /* 16 */
186 BSET_pv_free(bstate->bs_pv.pvx);
189 case INSN_SV_UPGRADE: /* 17 */
193 BSET_sv_upgrade(bstate->bs_sv, arg);
196 case INSN_SV_REFCNT: /* 18 */
200 SvREFCNT(bstate->bs_sv) = arg;
203 case INSN_SV_REFCNT_ADD: /* 19 */
207 BSET_sv_refcnt_add(SvREFCNT(bstate->bs_sv), arg);
210 case INSN_SV_FLAGS: /* 20 */
214 SvFLAGS(bstate->bs_sv) = arg;
217 case INSN_XRV: /* 21 */
221 BSET_xrv(bstate->bs_sv, arg);
224 case INSN_XPV: /* 22 */
226 BSET_xpv(bstate->bs_sv);
229 case INSN_XPV_CUR: /* 23 */
233 BSET_xpv_cur(bstate->bs_sv, arg);
236 case INSN_XPV_LEN: /* 24 */
240 BSET_xpv_len(bstate->bs_sv, arg);
243 case INSN_XIV: /* 25 */
247 BSET_xiv(bstate->bs_sv, arg);
250 case INSN_XNV: /* 26 */
254 BSET_xnv(bstate->bs_sv, arg);
257 case INSN_XLV_TARGOFF: /* 27 */
261 LvTARGOFF(bstate->bs_sv) = arg;
264 case INSN_XLV_TARGLEN: /* 28 */
268 LvTARGLEN(bstate->bs_sv) = arg;
271 case INSN_XLV_TARG: /* 29 */
275 LvTARG(bstate->bs_sv) = arg;
278 case INSN_XLV_TYPE: /* 30 */
282 LvTYPE(bstate->bs_sv) = arg;
285 case INSN_XBM_USEFUL: /* 31 */
289 BmUSEFUL(bstate->bs_sv) = arg;
292 case INSN_XBM_PREVIOUS: /* 32 */
296 BmPREVIOUS(bstate->bs_sv) = arg;
299 case INSN_XBM_RARE: /* 33 */
303 BmRARE(bstate->bs_sv) = arg;
306 case INSN_XFM_LINES: /* 34 */
310 FmLINES(bstate->bs_sv) = arg;
313 case INSN_XIO_LINES: /* 36 */
317 IoLINES(bstate->bs_sv) = arg;
320 case INSN_XIO_PAGE: /* 37 */
324 IoPAGE(bstate->bs_sv) = arg;
327 case INSN_XIO_PAGE_LEN: /* 38 */
331 IoPAGE_LEN(bstate->bs_sv) = arg;
334 case INSN_XIO_LINES_LEFT: /* 39 */
338 IoLINES_LEFT(bstate->bs_sv) = arg;
341 case INSN_XIO_TOP_NAME: /* 40 */
345 IoTOP_NAME(bstate->bs_sv) = arg;
348 case INSN_XIO_TOP_GV: /* 41 */
352 *(SV**)&IoTOP_GV(bstate->bs_sv) = arg;
355 case INSN_XIO_FMT_NAME: /* 42 */
359 IoFMT_NAME(bstate->bs_sv) = arg;
362 case INSN_XIO_FMT_GV: /* 43 */
366 *(SV**)&IoFMT_GV(bstate->bs_sv) = arg;
369 case INSN_XIO_BOTTOM_NAME: /* 44 */
373 IoBOTTOM_NAME(bstate->bs_sv) = arg;
376 case INSN_XIO_BOTTOM_GV: /* 45 */
380 *(SV**)&IoBOTTOM_GV(bstate->bs_sv) = arg;
383 case INSN_XIO_SUBPROCESS: /* 46 */
387 IoSUBPROCESS(bstate->bs_sv) = arg;
390 case INSN_XIO_TYPE: /* 47 */
394 IoTYPE(bstate->bs_sv) = arg;
397 case INSN_XIO_FLAGS: /* 48 */
401 IoFLAGS(bstate->bs_sv) = arg;
404 case INSN_XCV_XSUBANY: /* 49 */
408 *(SV**)&CvXSUBANY(bstate->bs_sv).any_ptr = arg;
411 case INSN_XCV_STASH: /* 50 */
415 *(SV**)&CvSTASH(bstate->bs_sv) = arg;
418 case INSN_XCV_START: /* 51 */
422 CvSTART(bstate->bs_sv) = arg;
425 case INSN_XCV_ROOT: /* 52 */
429 CvROOT(bstate->bs_sv) = arg;
432 case INSN_XCV_GV: /* 53 */
436 *(SV**)&CvGV(bstate->bs_sv) = arg;
439 case INSN_XCV_FILE: /* 54 */
443 CvFILE(bstate->bs_sv) = arg;
446 case INSN_XCV_DEPTH: /* 55 */
450 CvDEPTH(bstate->bs_sv) = arg;
453 case INSN_XCV_PADLIST: /* 56 */
457 *(SV**)&CvPADLIST(bstate->bs_sv) = arg;
460 case INSN_XCV_OUTSIDE: /* 57 */
464 *(SV**)&CvOUTSIDE(bstate->bs_sv) = arg;
467 case INSN_XCV_OUTSIDE_SEQ: /* 58 */
471 CvOUTSIDE_SEQ(bstate->bs_sv) = arg;
474 case INSN_XCV_FLAGS: /* 59 */
478 CvFLAGS(bstate->bs_sv) = arg;
481 case INSN_AV_EXTEND: /* 60 */
485 BSET_av_extend(bstate->bs_sv, arg);
488 case INSN_AV_PUSHX: /* 61 */
492 BSET_av_pushx(bstate->bs_sv, arg);
495 case INSN_AV_PUSH: /* 62 */
499 BSET_av_push(bstate->bs_sv, arg);
502 case INSN_XAV_FILL: /* 63 */
506 AvFILLp(bstate->bs_sv) = arg;
509 case INSN_XAV_MAX: /* 64 */
513 AvMAX(bstate->bs_sv) = arg;
516 case INSN_XHV_RITER: /* 65 */
520 HvRITER(bstate->bs_sv) = arg;
523 case INSN_XHV_NAME: /* 66 */
527 BSET_xhv_name(bstate->bs_sv, arg);
530 case INSN_HV_STORE: /* 67 */
534 BSET_hv_store(bstate->bs_sv, arg);
537 case INSN_SV_MAGIC: /* 68 */
541 BSET_sv_magic(bstate->bs_sv, arg);
544 case INSN_MG_OBJ: /* 69 */
548 SvMAGIC(bstate->bs_sv)->mg_obj = arg;
551 case INSN_MG_PRIVATE: /* 70 */
555 SvMAGIC(bstate->bs_sv)->mg_private = arg;
558 case INSN_MG_FLAGS: /* 71 */
562 SvMAGIC(bstate->bs_sv)->mg_flags = arg;
565 case INSN_MG_NAME: /* 72 */
568 BGET_pvcontents(arg);
569 BSET_mg_name(SvMAGIC(bstate->bs_sv), arg);
572 case INSN_MG_NAMEX: /* 73 */
576 BSET_mg_namex(SvMAGIC(bstate->bs_sv), arg);
579 case INSN_XMG_STASH: /* 74 */
583 BSET_xmg_stash(bstate->bs_sv, arg);
586 case INSN_GV_FETCHPV: /* 75 */
590 BSET_gv_fetchpv(bstate->bs_sv, arg);
593 case INSN_GV_FETCHPVX: /* 76 */
597 BSET_gv_fetchpvx(bstate->bs_sv, arg);
600 case INSN_GV_STASHPV: /* 77 */
604 BSET_gv_stashpv(bstate->bs_sv, arg);
607 case INSN_GV_STASHPVX: /* 78 */
611 BSET_gv_stashpvx(bstate->bs_sv, arg);
614 case INSN_GP_SV: /* 79 */
618 GvSV(bstate->bs_sv) = arg;
621 case INSN_GP_REFCNT: /* 80 */
625 GvREFCNT(bstate->bs_sv) = arg;
628 case INSN_GP_REFCNT_ADD: /* 81 */
632 BSET_gp_refcnt_add(GvREFCNT(bstate->bs_sv), arg);
635 case INSN_GP_AV: /* 82 */
639 *(SV**)&GvAV(bstate->bs_sv) = arg;
642 case INSN_GP_HV: /* 83 */
646 *(SV**)&GvHV(bstate->bs_sv) = arg;
649 case INSN_GP_CV: /* 84 */
653 *(SV**)&GvCV(bstate->bs_sv) = arg;
656 case INSN_GP_FILE: /* 85 */
660 GvFILE(bstate->bs_sv) = arg;
663 case INSN_GP_IO: /* 86 */
667 *(SV**)&GvIOp(bstate->bs_sv) = arg;
670 case INSN_GP_FORM: /* 87 */
674 *(SV**)&GvFORM(bstate->bs_sv) = arg;
677 case INSN_GP_CVGEN: /* 88 */
681 GvCVGEN(bstate->bs_sv) = arg;
684 case INSN_GP_LINE: /* 89 */
688 GvLINE(bstate->bs_sv) = arg;
691 case INSN_GP_SHARE: /* 90 */
695 BSET_gp_share(bstate->bs_sv, arg);
698 case INSN_XGV_FLAGS: /* 91 */
702 GvFLAGS(bstate->bs_sv) = arg;
705 case INSN_OP_NEXT: /* 92 */
709 PL_op->op_next = arg;
712 case INSN_OP_SIBLING: /* 93 */
716 PL_op->op_sibling = arg;
719 case INSN_OP_PPADDR: /* 94 */
723 BSET_op_ppaddr(PL_op->op_ppaddr, arg);
726 case INSN_OP_TARG: /* 95 */
730 PL_op->op_targ = arg;
733 case INSN_OP_TYPE: /* 96 */
737 BSET_op_type(PL_op, arg);
740 case INSN_OP_OPT: /* 97 */
747 case INSN_OP_STATIC: /* 98 */
751 PL_op->op_static = arg;
754 case INSN_OP_FLAGS: /* 99 */
758 PL_op->op_flags = arg;
761 case INSN_OP_PRIVATE: /* 100 */
765 PL_op->op_private = arg;
768 case INSN_OP_FIRST: /* 101 */
772 cUNOP->op_first = arg;
775 case INSN_OP_LAST: /* 102 */
779 cBINOP->op_last = arg;
782 case INSN_OP_OTHER: /* 103 */
786 cLOGOP->op_other = arg;
789 case INSN_OP_PMREPLROOT: /* 104 */
793 cPMOP->op_pmreplroot = arg;
796 case INSN_OP_PMREPLSTART: /* 105 */
800 cPMOP->op_pmreplstart = arg;
803 case INSN_OP_PMNEXT: /* 106 */
807 *(OP**)&cPMOP->op_pmnext = arg;
811 case INSN_OP_PMSTASHPV: /* 107 */
815 BSET_op_pmstashpv(cPMOP, arg);
818 case INSN_OP_PMREPLROOTPO: /* 108 */
822 cPMOP->op_pmreplroot = (OP*)arg;
826 case INSN_OP_PMSTASH: /* 109 */
830 *(SV**)&cPMOP->op_pmstash = arg;
833 case INSN_OP_PMREPLROOTGV: /* 110 */
837 *(SV**)&cPMOP->op_pmreplroot = arg;
841 case INSN_PREGCOMP: /* 111 */
844 BGET_pvcontents(arg);
845 BSET_pregcomp(PL_op, arg);
848 case INSN_OP_PMFLAGS: /* 112 */
852 cPMOP->op_pmflags = arg;
855 case INSN_OP_PMPERMFLAGS: /* 113 */
859 cPMOP->op_pmpermflags = arg;
862 case INSN_OP_PMDYNFLAGS: /* 114 */
866 cPMOP->op_pmdynflags = arg;
869 case INSN_OP_SV: /* 115 */
876 case INSN_OP_PADIX: /* 116 */
880 cPADOP->op_padix = arg;
883 case INSN_OP_PV: /* 117 */
886 BGET_pvcontents(arg);
890 case INSN_OP_PV_TR: /* 118 */
893 BGET_op_tr_array(arg);
897 case INSN_OP_REDOOP: /* 119 */
901 cLOOP->op_redoop = arg;
904 case INSN_OP_NEXTOP: /* 120 */
908 cLOOP->op_nextop = arg;
911 case INSN_OP_LASTOP: /* 121 */
915 cLOOP->op_lastop = arg;
918 case INSN_COP_LABEL: /* 122 */
922 cCOP->cop_label = arg;
926 case INSN_COP_STASHPV: /* 123 */
930 BSET_cop_stashpv(cCOP, arg);
933 case INSN_COP_FILE: /* 124 */
937 BSET_cop_file(cCOP, arg);
941 case INSN_COP_STASH: /* 125 */
945 BSET_cop_stash(cCOP, arg);
948 case INSN_COP_FILEGV: /* 126 */
952 BSET_cop_filegv(cCOP, arg);
956 case INSN_COP_SEQ: /* 127 */
963 case INSN_COP_ARYBASE: /* 128 */
967 cCOP->cop_arybase = arg;
970 case INSN_COP_LINE: /* 129 */
974 cCOP->cop_line = arg;
977 case INSN_COP_IO: /* 130 */
984 case INSN_COP_WARNINGS: /* 131 */
988 cCOP->cop_warnings = arg;
991 case INSN_MAIN_START: /* 132 */
998 case INSN_MAIN_ROOT: /* 133 */
1005 case INSN_MAIN_CV: /* 134 */
1009 *(SV**)&PL_main_cv = arg;
1012 case INSN_CURPAD: /* 135 */
1016 BSET_curpad(PL_curpad, arg);
1019 case INSN_PUSH_BEGIN: /* 136 */
1023 BSET_push_begin(PL_beginav, arg);
1026 case INSN_PUSH_INIT: /* 137 */
1030 BSET_push_init(PL_initav, arg);
1033 case INSN_PUSH_END: /* 138 */
1037 BSET_push_end(PL_endav, arg);
1040 case INSN_CURSTASH: /* 139 */
1044 *(SV**)&PL_curstash = arg;
1047 case INSN_DEFSTASH: /* 140 */
1051 *(SV**)&PL_defstash = arg;
1054 case INSN_DATA: /* 141 */
1058 BSET_data(none, arg);
1061 case INSN_INCAV: /* 142 */
1065 *(SV**)&GvAV(PL_incgv) = arg;
1068 case INSN_LOAD_GLOB: /* 143 */
1072 BSET_load_glob(none, arg);
1076 case INSN_REGEX_PADAV: /* 144 */
1080 *(SV**)&PL_regex_padav = arg;
1084 case INSN_DOWARN: /* 145 */
1091 case INSN_COMPPAD_NAME: /* 146 */
1095 *(SV**)&PL_comppad_name = arg;
1098 case INSN_XGV_STASH: /* 147 */
1102 *(SV**)&GvSTASH(bstate->bs_sv) = arg;
1105 case INSN_SIGNAL: /* 148 */
1109 BSET_signal(bstate->bs_sv, arg);
1112 case INSN_FORMFEED: /* 149 */
1120 Perl_croak(aTHX_ "Illegal bytecode instruction %d\n", insn);