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 const int optype_size[] = {
44 bset_obj_store(pTHXo_ struct byteloader_state *bstate, void *obj, I32 ix)
46 if (ix > bstate->bs_obj_list_fill) {
47 Renew(bstate->bs_obj_list, ix + 32, void*);
48 bstate->bs_obj_list_fill = ix + 31;
50 bstate->bs_obj_list[ix] = obj;
55 byterun(pTHXo_ register struct byteloader_state *bstate)
59 SV *specialsv_list[6];
61 BYTECODE_HEADER_CHECK; /* croak if incorrect platform */
62 New(666, bstate->bs_obj_list, 32, void*); /* set op objlist */
63 bstate->bs_obj_list_fill = 31;
65 specialsv_list[0] = Nullsv;
66 specialsv_list[1] = &PL_sv_undef;
67 specialsv_list[2] = &PL_sv_yes;
68 specialsv_list[3] = &PL_sv_no;
69 specialsv_list[4] = pWARN_ALL;
70 specialsv_list[5] = pWARN_NONE;
72 while ((insn = BGET_FGETC()) != EOF) {
74 case INSN_COMMENT: /* 35 */
81 case INSN_NOP: /* 10 */
85 case INSN_RET: /* 0 */
90 case INSN_LDSV: /* 1 */
97 case INSN_LDOP: /* 2 */
104 case INSN_STSV: /* 3 */
108 BSET_OBJ_STORE(bstate->bs_sv, arg);
111 case INSN_STOP: /* 4 */
115 BSET_OBJ_STORE(PL_op, arg);
118 case INSN_STPV: /* 5 */
122 BSET_stpv(bstate->bs_pv.xpv_pv, arg);
125 case INSN_LDSPECSV: /* 6 */
129 BSET_ldspecsv(bstate->bs_sv, arg);
132 case INSN_NEWSV: /* 7 */
136 BSET_newsv(bstate->bs_sv, arg);
139 case INSN_NEWOP: /* 8 */
143 BSET_newop(PL_op, arg);
146 case INSN_NEWOPN: /* 9 */
150 BSET_newopn(PL_op, arg);
153 case INSN_NEWPV: /* 11 */
159 case INSN_PV_CUR: /* 12 */
163 bstate->bs_pv.xpv_cur = arg;
166 case INSN_PV_FREE: /* 13 */
168 BSET_pv_free(bstate->bs_pv);
171 case INSN_SV_UPGRADE: /* 14 */
175 BSET_sv_upgrade(bstate->bs_sv, arg);
178 case INSN_SV_REFCNT: /* 15 */
182 SvREFCNT(bstate->bs_sv) = arg;
185 case INSN_SV_REFCNT_ADD: /* 16 */
189 BSET_sv_refcnt_add(SvREFCNT(bstate->bs_sv), arg);
192 case INSN_SV_FLAGS: /* 17 */
196 SvFLAGS(bstate->bs_sv) = arg;
199 case INSN_XRV: /* 18 */
203 SvRV(bstate->bs_sv) = arg;
206 case INSN_XPV: /* 19 */
208 BSET_xpv(bstate->bs_sv);
211 case INSN_XIV32: /* 20 */
215 SvIVX(bstate->bs_sv) = arg;
218 case INSN_XIV64: /* 21 */
222 SvIVX(bstate->bs_sv) = arg;
225 case INSN_XNV: /* 22 */
229 SvNVX(bstate->bs_sv) = arg;
232 case INSN_XLV_TARGOFF: /* 23 */
236 LvTARGOFF(bstate->bs_sv) = arg;
239 case INSN_XLV_TARGLEN: /* 24 */
243 LvTARGLEN(bstate->bs_sv) = arg;
246 case INSN_XLV_TARG: /* 25 */
250 LvTARG(bstate->bs_sv) = arg;
253 case INSN_XLV_TYPE: /* 26 */
257 LvTYPE(bstate->bs_sv) = arg;
260 case INSN_XBM_USEFUL: /* 27 */
264 BmUSEFUL(bstate->bs_sv) = arg;
267 case INSN_XBM_PREVIOUS: /* 28 */
271 BmPREVIOUS(bstate->bs_sv) = arg;
274 case INSN_XBM_RARE: /* 29 */
278 BmRARE(bstate->bs_sv) = arg;
281 case INSN_XFM_LINES: /* 30 */
285 FmLINES(bstate->bs_sv) = arg;
288 case INSN_XIO_LINES: /* 31 */
292 IoLINES(bstate->bs_sv) = arg;
295 case INSN_XIO_PAGE: /* 32 */
299 IoPAGE(bstate->bs_sv) = arg;
302 case INSN_XIO_PAGE_LEN: /* 33 */
306 IoPAGE_LEN(bstate->bs_sv) = arg;
309 case INSN_XIO_LINES_LEFT: /* 34 */
313 IoLINES_LEFT(bstate->bs_sv) = arg;
316 case INSN_XIO_TOP_NAME: /* 36 */
319 BGET_pvcontents(arg);
320 IoTOP_NAME(bstate->bs_sv) = arg;
323 case INSN_XIO_TOP_GV: /* 37 */
327 *(SV**)&IoTOP_GV(bstate->bs_sv) = arg;
330 case INSN_XIO_FMT_NAME: /* 38 */
333 BGET_pvcontents(arg);
334 IoFMT_NAME(bstate->bs_sv) = arg;
337 case INSN_XIO_FMT_GV: /* 39 */
341 *(SV**)&IoFMT_GV(bstate->bs_sv) = arg;
344 case INSN_XIO_BOTTOM_NAME: /* 40 */
347 BGET_pvcontents(arg);
348 IoBOTTOM_NAME(bstate->bs_sv) = arg;
351 case INSN_XIO_BOTTOM_GV: /* 41 */
355 *(SV**)&IoBOTTOM_GV(bstate->bs_sv) = arg;
358 case INSN_XIO_SUBPROCESS: /* 42 */
362 IoSUBPROCESS(bstate->bs_sv) = arg;
365 case INSN_XIO_TYPE: /* 43 */
369 IoTYPE(bstate->bs_sv) = arg;
372 case INSN_XIO_FLAGS: /* 44 */
376 IoFLAGS(bstate->bs_sv) = arg;
379 case INSN_XCV_STASH: /* 45 */
383 *(SV**)&CvSTASH(bstate->bs_sv) = arg;
386 case INSN_XCV_START: /* 46 */
390 CvSTART(bstate->bs_sv) = arg;
393 case INSN_XCV_ROOT: /* 47 */
397 CvROOT(bstate->bs_sv) = arg;
400 case INSN_XCV_GV: /* 48 */
404 *(SV**)&CvGV(bstate->bs_sv) = arg;
407 case INSN_XCV_FILE: /* 49 */
411 CvFILE(bstate->bs_sv) = arg;
414 case INSN_XCV_DEPTH: /* 50 */
418 CvDEPTH(bstate->bs_sv) = arg;
421 case INSN_XCV_PADLIST: /* 51 */
425 *(SV**)&CvPADLIST(bstate->bs_sv) = arg;
428 case INSN_XCV_OUTSIDE: /* 52 */
432 *(SV**)&CvOUTSIDE(bstate->bs_sv) = arg;
435 case INSN_XCV_FLAGS: /* 53 */
439 CvFLAGS(bstate->bs_sv) = arg;
442 case INSN_AV_EXTEND: /* 54 */
446 BSET_av_extend(bstate->bs_sv, arg);
449 case INSN_AV_PUSH: /* 55 */
453 BSET_av_push(bstate->bs_sv, arg);
456 case INSN_XAV_FILL: /* 56 */
460 AvFILLp(bstate->bs_sv) = arg;
463 case INSN_XAV_MAX: /* 57 */
467 AvMAX(bstate->bs_sv) = arg;
470 case INSN_XAV_FLAGS: /* 58 */
474 AvFLAGS(bstate->bs_sv) = arg;
477 case INSN_XHV_RITER: /* 59 */
481 HvRITER(bstate->bs_sv) = arg;
484 case INSN_XHV_NAME: /* 60 */
487 BGET_pvcontents(arg);
488 HvNAME(bstate->bs_sv) = arg;
491 case INSN_HV_STORE: /* 61 */
495 BSET_hv_store(bstate->bs_sv, arg);
498 case INSN_SV_MAGIC: /* 62 */
502 BSET_sv_magic(bstate->bs_sv, arg);
505 case INSN_MG_OBJ: /* 63 */
509 SvMAGIC(bstate->bs_sv)->mg_obj = arg;
512 case INSN_MG_PRIVATE: /* 64 */
516 SvMAGIC(bstate->bs_sv)->mg_private = arg;
519 case INSN_MG_FLAGS: /* 65 */
523 SvMAGIC(bstate->bs_sv)->mg_flags = arg;
526 case INSN_MG_PV: /* 66 */
529 BGET_pvcontents(arg);
530 BSET_mg_pv(SvMAGIC(bstate->bs_sv), arg);
533 case INSN_XMG_STASH: /* 67 */
537 *(SV**)&SvSTASH(bstate->bs_sv) = arg;
540 case INSN_GV_FETCHPV: /* 68 */
544 BSET_gv_fetchpv(bstate->bs_sv, arg);
547 case INSN_GV_STASHPV: /* 69 */
551 BSET_gv_stashpv(bstate->bs_sv, arg);
554 case INSN_GP_SV: /* 70 */
558 GvSV(bstate->bs_sv) = arg;
561 case INSN_GP_REFCNT: /* 71 */
565 GvREFCNT(bstate->bs_sv) = arg;
568 case INSN_GP_REFCNT_ADD: /* 72 */
572 BSET_gp_refcnt_add(GvREFCNT(bstate->bs_sv), arg);
575 case INSN_GP_AV: /* 73 */
579 *(SV**)&GvAV(bstate->bs_sv) = arg;
582 case INSN_GP_HV: /* 74 */
586 *(SV**)&GvHV(bstate->bs_sv) = arg;
589 case INSN_GP_CV: /* 75 */
593 *(SV**)&GvCV(bstate->bs_sv) = arg;
596 case INSN_GP_FILE: /* 76 */
600 GvFILE(bstate->bs_sv) = arg;
603 case INSN_GP_IO: /* 77 */
607 *(SV**)&GvIOp(bstate->bs_sv) = arg;
610 case INSN_GP_FORM: /* 78 */
614 *(SV**)&GvFORM(bstate->bs_sv) = arg;
617 case INSN_GP_CVGEN: /* 79 */
621 GvCVGEN(bstate->bs_sv) = arg;
624 case INSN_GP_LINE: /* 80 */
628 GvLINE(bstate->bs_sv) = arg;
631 case INSN_GP_SHARE: /* 81 */
635 BSET_gp_share(bstate->bs_sv, arg);
638 case INSN_XGV_FLAGS: /* 82 */
642 GvFLAGS(bstate->bs_sv) = arg;
645 case INSN_OP_NEXT: /* 83 */
649 PL_op->op_next = arg;
652 case INSN_OP_SIBLING: /* 84 */
656 PL_op->op_sibling = arg;
659 case INSN_OP_PPADDR: /* 85 */
663 BSET_op_ppaddr(PL_op->op_ppaddr, arg);
666 case INSN_OP_TARG: /* 86 */
670 PL_op->op_targ = arg;
673 case INSN_OP_TYPE: /* 87 */
677 BSET_op_type(PL_op, arg);
680 case INSN_OP_SEQ: /* 88 */
687 case INSN_OP_FLAGS: /* 89 */
691 PL_op->op_flags = arg;
694 case INSN_OP_PRIVATE: /* 90 */
698 PL_op->op_private = arg;
701 case INSN_OP_FIRST: /* 91 */
705 cUNOP->op_first = arg;
708 case INSN_OP_LAST: /* 92 */
712 cBINOP->op_last = arg;
715 case INSN_OP_OTHER: /* 93 */
719 cLOGOP->op_other = arg;
722 case INSN_OP_PMREPLROOT: /* 94 */
726 cPMOP->op_pmreplroot = arg;
729 case INSN_OP_PMREPLROOTGV: /* 95 */
733 *(SV**)&cPMOP->op_pmreplroot = arg;
736 case INSN_OP_PMREPLSTART: /* 96 */
740 cPMOP->op_pmreplstart = arg;
743 case INSN_OP_PMNEXT: /* 97 */
747 *(OP**)&cPMOP->op_pmnext = arg;
750 case INSN_PREGCOMP: /* 98 */
753 BGET_pvcontents(arg);
754 BSET_pregcomp(PL_op, arg);
757 case INSN_OP_PMFLAGS: /* 99 */
761 cPMOP->op_pmflags = arg;
764 case INSN_OP_PMPERMFLAGS: /* 100 */
768 cPMOP->op_pmpermflags = arg;
771 case INSN_OP_SV: /* 101 */
778 case INSN_OP_PADIX: /* 102 */
782 cPADOP->op_padix = arg;
785 case INSN_OP_PV: /* 103 */
788 BGET_pvcontents(arg);
792 case INSN_OP_PV_TR: /* 104 */
795 BGET_op_tr_array(arg);
799 case INSN_OP_REDOOP: /* 105 */
803 cLOOP->op_redoop = arg;
806 case INSN_OP_NEXTOP: /* 106 */
810 cLOOP->op_nextop = arg;
813 case INSN_OP_LASTOP: /* 107 */
817 cLOOP->op_lastop = arg;
820 case INSN_COP_LABEL: /* 108 */
824 cCOP->cop_label = arg;
827 case INSN_COP_STASHPV: /* 109 */
831 BSET_cop_stashpv(cCOP, arg);
834 case INSN_COP_FILE: /* 110 */
838 BSET_cop_file(cCOP, arg);
841 case INSN_COP_SEQ: /* 111 */
848 case INSN_COP_ARYBASE: /* 112 */
852 cCOP->cop_arybase = arg;
855 case INSN_COP_LINE: /* 113 */
859 BSET_cop_line(cCOP, arg);
862 case INSN_COP_WARNINGS: /* 114 */
866 cCOP->cop_warnings = arg;
869 case INSN_MAIN_START: /* 115 */
876 case INSN_MAIN_ROOT: /* 116 */
883 case INSN_CURPAD: /* 117 */
887 BSET_curpad(PL_curpad, arg);
890 case INSN_PUSH_BEGIN: /* 118 */
894 BSET_push_begin(PL_beginav, arg);
897 case INSN_PUSH_INIT: /* 119 */
901 BSET_push_init(PL_initav, arg);
904 case INSN_PUSH_END: /* 120 */
908 BSET_push_end(PL_endav, arg);
912 Perl_croak(aTHX_ "Illegal bytecode instruction %d\n", insn);