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
20 #define CALL_FPTR(fptr) (pPerl->*fptr)
22 #define PL_ppaddr (*get_ppaddr())
29 static int optype_size[] = {
43 static SV *specialsv_list[4];
45 static int bytecode_iv_overflows = 0;
46 static SV *bytecode_sv;
47 static XPV bytecode_pv;
48 static void **bytecode_obj_list;
49 static I32 bytecode_obj_list_fill = -1;
52 bset_obj_store(pTHXo_ void *obj, I32 ix)
54 if (ix > bytecode_obj_list_fill) {
55 if (bytecode_obj_list_fill == -1)
56 New(666, bytecode_obj_list, ix + 1, void*);
58 Renew(bytecode_obj_list, ix + 1, void*);
59 bytecode_obj_list_fill = ix;
61 bytecode_obj_list[ix] = obj;
66 byterun(pTHXo_ struct bytestream bs)
71 specialsv_list[0] = Nullsv;
72 specialsv_list[1] = &PL_sv_undef;
73 specialsv_list[2] = &PL_sv_yes;
74 specialsv_list[3] = &PL_sv_no;
76 while ((insn = BGET_FGETC()) != EOF) {
78 case INSN_COMMENT: /* 35 */
85 case INSN_NOP: /* 10 */
89 case INSN_RET: /* 0 */
94 case INSN_LDSV: /* 1 */
101 case INSN_LDOP: /* 2 */
108 case INSN_STSV: /* 3 */
112 BSET_OBJ_STORE(bytecode_sv, arg);
115 case INSN_STOP: /* 4 */
119 BSET_OBJ_STORE(PL_op, arg);
122 case INSN_LDSPECSV: /* 5 */
126 BSET_ldspecsv(bytecode_sv, arg);
129 case INSN_NEWSV: /* 6 */
133 BSET_newsv(bytecode_sv, arg);
136 case INSN_NEWOP: /* 7 */
140 BSET_newop(PL_op, arg);
143 case INSN_NEWOPN: /* 8 */
147 BSET_newopn(PL_op, arg);
150 case INSN_NEWPV: /* 9 */
156 case INSN_PV_CUR: /* 11 */
160 bytecode_pv.xpv_cur = arg;
163 case INSN_PV_FREE: /* 12 */
165 BSET_pv_free(bytecode_pv);
168 case INSN_SV_UPGRADE: /* 13 */
172 BSET_sv_upgrade(bytecode_sv, arg);
175 case INSN_SV_REFCNT: /* 14 */
179 SvREFCNT(bytecode_sv) = arg;
182 case INSN_SV_REFCNT_ADD: /* 15 */
186 BSET_sv_refcnt_add(SvREFCNT(bytecode_sv), arg);
189 case INSN_SV_FLAGS: /* 16 */
193 SvFLAGS(bytecode_sv) = arg;
196 case INSN_XRV: /* 17 */
200 SvRV(bytecode_sv) = arg;
203 case INSN_XPV: /* 18 */
205 BSET_xpv(bytecode_sv);
208 case INSN_XIV32: /* 19 */
212 SvIVX(bytecode_sv) = arg;
215 case INSN_XIV64: /* 20 */
219 SvIVX(bytecode_sv) = arg;
222 case INSN_XNV: /* 21 */
226 SvNVX(bytecode_sv) = arg;
229 case INSN_XLV_TARGOFF: /* 22 */
233 LvTARGOFF(bytecode_sv) = arg;
236 case INSN_XLV_TARGLEN: /* 23 */
240 LvTARGLEN(bytecode_sv) = arg;
243 case INSN_XLV_TARG: /* 24 */
247 LvTARG(bytecode_sv) = arg;
250 case INSN_XLV_TYPE: /* 25 */
254 LvTYPE(bytecode_sv) = arg;
257 case INSN_XBM_USEFUL: /* 26 */
261 BmUSEFUL(bytecode_sv) = arg;
264 case INSN_XBM_PREVIOUS: /* 27 */
268 BmPREVIOUS(bytecode_sv) = arg;
271 case INSN_XBM_RARE: /* 28 */
275 BmRARE(bytecode_sv) = arg;
278 case INSN_XFM_LINES: /* 29 */
282 FmLINES(bytecode_sv) = arg;
285 case INSN_XIO_LINES: /* 30 */
289 IoLINES(bytecode_sv) = arg;
292 case INSN_XIO_PAGE: /* 31 */
296 IoPAGE(bytecode_sv) = arg;
299 case INSN_XIO_PAGE_LEN: /* 32 */
303 IoPAGE_LEN(bytecode_sv) = arg;
306 case INSN_XIO_LINES_LEFT: /* 33 */
310 IoLINES_LEFT(bytecode_sv) = arg;
313 case INSN_XIO_TOP_NAME: /* 34 */
316 BGET_pvcontents(arg);
317 IoTOP_NAME(bytecode_sv) = arg;
320 case INSN_XIO_TOP_GV: /* 36 */
324 *(SV**)&IoTOP_GV(bytecode_sv) = arg;
327 case INSN_XIO_FMT_NAME: /* 37 */
330 BGET_pvcontents(arg);
331 IoFMT_NAME(bytecode_sv) = arg;
334 case INSN_XIO_FMT_GV: /* 38 */
338 *(SV**)&IoFMT_GV(bytecode_sv) = arg;
341 case INSN_XIO_BOTTOM_NAME: /* 39 */
344 BGET_pvcontents(arg);
345 IoBOTTOM_NAME(bytecode_sv) = arg;
348 case INSN_XIO_BOTTOM_GV: /* 40 */
352 *(SV**)&IoBOTTOM_GV(bytecode_sv) = arg;
355 case INSN_XIO_SUBPROCESS: /* 41 */
359 IoSUBPROCESS(bytecode_sv) = arg;
362 case INSN_XIO_TYPE: /* 42 */
366 IoTYPE(bytecode_sv) = arg;
369 case INSN_XIO_FLAGS: /* 43 */
373 IoFLAGS(bytecode_sv) = arg;
376 case INSN_XCV_STASH: /* 44 */
380 *(SV**)&CvSTASH(bytecode_sv) = arg;
383 case INSN_XCV_START: /* 45 */
387 CvSTART(bytecode_sv) = arg;
390 case INSN_XCV_ROOT: /* 46 */
394 CvROOT(bytecode_sv) = arg;
397 case INSN_XCV_GV: /* 47 */
401 *(SV**)&CvGV(bytecode_sv) = arg;
404 case INSN_XCV_FILEGV: /* 48 */
408 *(SV**)&CvFILEGV(bytecode_sv) = arg;
411 case INSN_XCV_DEPTH: /* 49 */
415 CvDEPTH(bytecode_sv) = arg;
418 case INSN_XCV_PADLIST: /* 50 */
422 *(SV**)&CvPADLIST(bytecode_sv) = arg;
425 case INSN_XCV_OUTSIDE: /* 51 */
429 *(SV**)&CvOUTSIDE(bytecode_sv) = arg;
432 case INSN_XCV_FLAGS: /* 52 */
436 CvFLAGS(bytecode_sv) = arg;
439 case INSN_AV_EXTEND: /* 53 */
443 BSET_av_extend(bytecode_sv, arg);
446 case INSN_AV_PUSH: /* 54 */
450 BSET_av_push(bytecode_sv, arg);
453 case INSN_XAV_FILL: /* 55 */
457 AvFILLp(bytecode_sv) = arg;
460 case INSN_XAV_MAX: /* 56 */
464 AvMAX(bytecode_sv) = arg;
467 case INSN_XAV_FLAGS: /* 57 */
471 AvFLAGS(bytecode_sv) = arg;
474 case INSN_XHV_RITER: /* 58 */
478 HvRITER(bytecode_sv) = arg;
481 case INSN_XHV_NAME: /* 59 */
484 BGET_pvcontents(arg);
485 HvNAME(bytecode_sv) = arg;
488 case INSN_HV_STORE: /* 60 */
492 BSET_hv_store(bytecode_sv, arg);
495 case INSN_SV_MAGIC: /* 61 */
499 BSET_sv_magic(bytecode_sv, arg);
502 case INSN_MG_OBJ: /* 62 */
506 SvMAGIC(bytecode_sv)->mg_obj = arg;
509 case INSN_MG_PRIVATE: /* 63 */
513 SvMAGIC(bytecode_sv)->mg_private = arg;
516 case INSN_MG_FLAGS: /* 64 */
520 SvMAGIC(bytecode_sv)->mg_flags = arg;
523 case INSN_MG_PV: /* 65 */
526 BGET_pvcontents(arg);
527 BSET_mg_pv(SvMAGIC(bytecode_sv), arg);
530 case INSN_XMG_STASH: /* 66 */
534 *(SV**)&SvSTASH(bytecode_sv) = arg;
537 case INSN_GV_FETCHPV: /* 67 */
541 BSET_gv_fetchpv(bytecode_sv, arg);
544 case INSN_GV_STASHPV: /* 68 */
548 BSET_gv_stashpv(bytecode_sv, arg);
551 case INSN_GP_SV: /* 69 */
555 GvSV(bytecode_sv) = arg;
558 case INSN_GP_REFCNT: /* 70 */
562 GvREFCNT(bytecode_sv) = arg;
565 case INSN_GP_REFCNT_ADD: /* 71 */
569 BSET_gp_refcnt_add(GvREFCNT(bytecode_sv), arg);
572 case INSN_GP_AV: /* 72 */
576 *(SV**)&GvAV(bytecode_sv) = arg;
579 case INSN_GP_HV: /* 73 */
583 *(SV**)&GvHV(bytecode_sv) = arg;
586 case INSN_GP_CV: /* 74 */
590 *(SV**)&GvCV(bytecode_sv) = arg;
593 case INSN_GP_FILEGV: /* 75 */
597 *(SV**)&GvFILEGV(bytecode_sv) = arg;
600 case INSN_GP_IO: /* 76 */
604 *(SV**)&GvIOp(bytecode_sv) = arg;
607 case INSN_GP_FORM: /* 77 */
611 *(SV**)&GvFORM(bytecode_sv) = arg;
614 case INSN_GP_CVGEN: /* 78 */
618 GvCVGEN(bytecode_sv) = arg;
621 case INSN_GP_LINE: /* 79 */
625 GvLINE(bytecode_sv) = arg;
628 case INSN_GP_SHARE: /* 80 */
632 BSET_gp_share(bytecode_sv, arg);
635 case INSN_XGV_FLAGS: /* 81 */
639 GvFLAGS(bytecode_sv) = arg;
642 case INSN_OP_NEXT: /* 82 */
646 PL_op->op_next = arg;
649 case INSN_OP_SIBLING: /* 83 */
653 PL_op->op_sibling = arg;
656 case INSN_OP_PPADDR: /* 84 */
660 BSET_op_ppaddr(PL_op->op_ppaddr, arg);
663 case INSN_OP_TARG: /* 85 */
667 PL_op->op_targ = arg;
670 case INSN_OP_TYPE: /* 86 */
674 BSET_op_type(PL_op, arg);
677 case INSN_OP_SEQ: /* 87 */
684 case INSN_OP_FLAGS: /* 88 */
688 PL_op->op_flags = arg;
691 case INSN_OP_PRIVATE: /* 89 */
695 PL_op->op_private = arg;
698 case INSN_OP_FIRST: /* 90 */
702 cUNOP->op_first = arg;
705 case INSN_OP_LAST: /* 91 */
709 cBINOP->op_last = arg;
712 case INSN_OP_OTHER: /* 92 */
716 cLOGOP->op_other = arg;
719 case INSN_OP_CHILDREN: /* 93 */
723 cLISTOP->op_children = arg;
726 case INSN_OP_PMREPLROOT: /* 94 */
730 cPMOP->op_pmreplroot = arg;
733 case INSN_OP_PMREPLROOTGV: /* 95 */
737 *(SV**)&cPMOP->op_pmreplroot = arg;
740 case INSN_OP_PMREPLSTART: /* 96 */
744 cPMOP->op_pmreplstart = arg;
747 case INSN_OP_PMNEXT: /* 97 */
751 *(OP**)&cPMOP->op_pmnext = arg;
754 case INSN_PREGCOMP: /* 98 */
757 BGET_pvcontents(arg);
758 BSET_pregcomp(PL_op, arg);
761 case INSN_OP_PMFLAGS: /* 99 */
765 cPMOP->op_pmflags = arg;
768 case INSN_OP_PMPERMFLAGS: /* 100 */
772 cPMOP->op_pmpermflags = arg;
775 case INSN_OP_SV: /* 101 */
782 case INSN_OP_GV: /* 102 */
786 *(SV**)&cGVOP->op_gv = arg;
789 case INSN_OP_PV: /* 103 */
792 BGET_pvcontents(arg);
796 case INSN_OP_PV_TR: /* 104 */
799 BGET_op_tr_array(arg);
803 case INSN_OP_REDOOP: /* 105 */
807 cLOOP->op_redoop = arg;
810 case INSN_OP_NEXTOP: /* 106 */
814 cLOOP->op_nextop = arg;
817 case INSN_OP_LASTOP: /* 107 */
821 cLOOP->op_lastop = arg;
824 case INSN_COP_LABEL: /* 108 */
827 BGET_pvcontents(arg);
828 cCOP->cop_label = arg;
831 case INSN_COP_STASH: /* 109 */
835 *(SV**)&cCOP->cop_stash = arg;
838 case INSN_COP_FILEGV: /* 110 */
842 *(SV**)&cCOP->cop_filegv = arg;
845 case INSN_COP_SEQ: /* 111 */
852 case INSN_COP_ARYBASE: /* 112 */
856 cCOP->cop_arybase = arg;
859 case INSN_COP_LINE: /* 113 */
863 cCOP->cop_line = arg;
866 case INSN_COP_WARNINGS: /* 114 */
870 cCOP->cop_warnings = arg;
873 case INSN_MAIN_START: /* 115 */
880 case INSN_MAIN_ROOT: /* 116 */
887 case INSN_CURPAD: /* 117 */
891 BSET_curpad(PL_curpad, arg);
895 Perl_croak(aTHX_ "Illegal bytecode instruction %d\n", insn);