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.
19 #define CALL_FPTR(fptr) (pPerl->*fptr)
21 #define PL_ppaddr (*get_ppaddr())
28 static int optype_size[] = {
42 static SV *specialsv_list[4];
44 static int bytecode_iv_overflows = 0;
45 static SV *bytecode_sv;
46 static XPV bytecode_pv;
47 static void **bytecode_obj_list;
48 static I32 bytecode_obj_list_fill = -1;
51 bset_obj_store(pTHXo_ void *obj, I32 ix)
53 if (ix > bytecode_obj_list_fill) {
54 if (bytecode_obj_list_fill == -1)
55 New(666, bytecode_obj_list, ix + 1, void*);
57 Renew(bytecode_obj_list, ix + 1, void*);
58 bytecode_obj_list_fill = ix;
60 bytecode_obj_list[ix] = obj;
65 byterun(pTHXo_ struct bytestream bs)
70 specialsv_list[0] = Nullsv;
71 specialsv_list[1] = &PL_sv_undef;
72 specialsv_list[2] = &PL_sv_yes;
73 specialsv_list[3] = &PL_sv_no;
75 while ((insn = BGET_FGETC()) != EOF) {
77 case INSN_COMMENT: /* 35 */
84 case INSN_NOP: /* 10 */
88 case INSN_RET: /* 0 */
93 case INSN_LDSV: /* 1 */
100 case INSN_LDOP: /* 2 */
107 case INSN_STSV: /* 3 */
111 BSET_OBJ_STORE(bytecode_sv, arg);
114 case INSN_STOP: /* 4 */
118 BSET_OBJ_STORE(PL_op, arg);
121 case INSN_LDSPECSV: /* 5 */
125 BSET_ldspecsv(bytecode_sv, arg);
128 case INSN_NEWSV: /* 6 */
132 BSET_newsv(bytecode_sv, arg);
135 case INSN_NEWOP: /* 7 */
139 BSET_newop(PL_op, arg);
142 case INSN_NEWOPN: /* 8 */
146 BSET_newopn(PL_op, arg);
149 case INSN_NEWPV: /* 9 */
155 case INSN_PV_CUR: /* 11 */
159 bytecode_pv.xpv_cur = arg;
162 case INSN_PV_FREE: /* 12 */
164 BSET_pv_free(bytecode_pv);
167 case INSN_SV_UPGRADE: /* 13 */
171 BSET_sv_upgrade(bytecode_sv, arg);
174 case INSN_SV_REFCNT: /* 14 */
178 SvREFCNT(bytecode_sv) = arg;
181 case INSN_SV_REFCNT_ADD: /* 15 */
185 BSET_sv_refcnt_add(SvREFCNT(bytecode_sv), arg);
188 case INSN_SV_FLAGS: /* 16 */
192 SvFLAGS(bytecode_sv) = arg;
195 case INSN_XRV: /* 17 */
199 SvRV(bytecode_sv) = arg;
202 case INSN_XPV: /* 18 */
204 BSET_xpv(bytecode_sv);
207 case INSN_XIV32: /* 19 */
211 SvIVX(bytecode_sv) = arg;
214 case INSN_XIV64: /* 20 */
218 SvIVX(bytecode_sv) = arg;
221 case INSN_XNV: /* 21 */
225 SvNVX(bytecode_sv) = arg;
228 case INSN_XLV_TARGOFF: /* 22 */
232 LvTARGOFF(bytecode_sv) = arg;
235 case INSN_XLV_TARGLEN: /* 23 */
239 LvTARGLEN(bytecode_sv) = arg;
242 case INSN_XLV_TARG: /* 24 */
246 LvTARG(bytecode_sv) = arg;
249 case INSN_XLV_TYPE: /* 25 */
253 LvTYPE(bytecode_sv) = arg;
256 case INSN_XBM_USEFUL: /* 26 */
260 BmUSEFUL(bytecode_sv) = arg;
263 case INSN_XBM_PREVIOUS: /* 27 */
267 BmPREVIOUS(bytecode_sv) = arg;
270 case INSN_XBM_RARE: /* 28 */
274 BmRARE(bytecode_sv) = arg;
277 case INSN_XFM_LINES: /* 29 */
281 FmLINES(bytecode_sv) = arg;
284 case INSN_XIO_LINES: /* 30 */
288 IoLINES(bytecode_sv) = arg;
291 case INSN_XIO_PAGE: /* 31 */
295 IoPAGE(bytecode_sv) = arg;
298 case INSN_XIO_PAGE_LEN: /* 32 */
302 IoPAGE_LEN(bytecode_sv) = arg;
305 case INSN_XIO_LINES_LEFT: /* 33 */
309 IoLINES_LEFT(bytecode_sv) = arg;
312 case INSN_XIO_TOP_NAME: /* 34 */
315 BGET_pvcontents(arg);
316 IoTOP_NAME(bytecode_sv) = arg;
319 case INSN_XIO_TOP_GV: /* 36 */
323 *(SV**)&IoTOP_GV(bytecode_sv) = arg;
326 case INSN_XIO_FMT_NAME: /* 37 */
329 BGET_pvcontents(arg);
330 IoFMT_NAME(bytecode_sv) = arg;
333 case INSN_XIO_FMT_GV: /* 38 */
337 *(SV**)&IoFMT_GV(bytecode_sv) = arg;
340 case INSN_XIO_BOTTOM_NAME: /* 39 */
343 BGET_pvcontents(arg);
344 IoBOTTOM_NAME(bytecode_sv) = arg;
347 case INSN_XIO_BOTTOM_GV: /* 40 */
351 *(SV**)&IoBOTTOM_GV(bytecode_sv) = arg;
354 case INSN_XIO_SUBPROCESS: /* 41 */
358 IoSUBPROCESS(bytecode_sv) = arg;
361 case INSN_XIO_TYPE: /* 42 */
365 IoTYPE(bytecode_sv) = arg;
368 case INSN_XIO_FLAGS: /* 43 */
372 IoFLAGS(bytecode_sv) = arg;
375 case INSN_XCV_STASH: /* 44 */
379 *(SV**)&CvSTASH(bytecode_sv) = arg;
382 case INSN_XCV_START: /* 45 */
386 CvSTART(bytecode_sv) = arg;
389 case INSN_XCV_ROOT: /* 46 */
393 CvROOT(bytecode_sv) = arg;
396 case INSN_XCV_GV: /* 47 */
400 *(SV**)&CvGV(bytecode_sv) = arg;
403 case INSN_XCV_FILEGV: /* 48 */
407 *(SV**)&CvFILEGV(bytecode_sv) = arg;
410 case INSN_XCV_DEPTH: /* 49 */
414 CvDEPTH(bytecode_sv) = arg;
417 case INSN_XCV_PADLIST: /* 50 */
421 *(SV**)&CvPADLIST(bytecode_sv) = arg;
424 case INSN_XCV_OUTSIDE: /* 51 */
428 *(SV**)&CvOUTSIDE(bytecode_sv) = arg;
431 case INSN_XCV_FLAGS: /* 52 */
435 CvFLAGS(bytecode_sv) = arg;
438 case INSN_AV_EXTEND: /* 53 */
442 BSET_av_extend(bytecode_sv, arg);
445 case INSN_AV_PUSH: /* 54 */
449 BSET_av_push(bytecode_sv, arg);
452 case INSN_XAV_FILL: /* 55 */
456 AvFILLp(bytecode_sv) = arg;
459 case INSN_XAV_MAX: /* 56 */
463 AvMAX(bytecode_sv) = arg;
466 case INSN_XAV_FLAGS: /* 57 */
470 AvFLAGS(bytecode_sv) = arg;
473 case INSN_XHV_RITER: /* 58 */
477 HvRITER(bytecode_sv) = arg;
480 case INSN_XHV_NAME: /* 59 */
483 BGET_pvcontents(arg);
484 HvNAME(bytecode_sv) = arg;
487 case INSN_HV_STORE: /* 60 */
491 BSET_hv_store(bytecode_sv, arg);
494 case INSN_SV_MAGIC: /* 61 */
498 BSET_sv_magic(bytecode_sv, arg);
501 case INSN_MG_OBJ: /* 62 */
505 SvMAGIC(bytecode_sv)->mg_obj = arg;
508 case INSN_MG_PRIVATE: /* 63 */
512 SvMAGIC(bytecode_sv)->mg_private = arg;
515 case INSN_MG_FLAGS: /* 64 */
519 SvMAGIC(bytecode_sv)->mg_flags = arg;
522 case INSN_MG_PV: /* 65 */
525 BGET_pvcontents(arg);
526 BSET_mg_pv(SvMAGIC(bytecode_sv), arg);
529 case INSN_XMG_STASH: /* 66 */
533 *(SV**)&SvSTASH(bytecode_sv) = arg;
536 case INSN_GV_FETCHPV: /* 67 */
540 BSET_gv_fetchpv(bytecode_sv, arg);
543 case INSN_GV_STASHPV: /* 68 */
547 BSET_gv_stashpv(bytecode_sv, arg);
550 case INSN_GP_SV: /* 69 */
554 GvSV(bytecode_sv) = arg;
557 case INSN_GP_REFCNT: /* 70 */
561 GvREFCNT(bytecode_sv) = arg;
564 case INSN_GP_REFCNT_ADD: /* 71 */
568 BSET_gp_refcnt_add(GvREFCNT(bytecode_sv), arg);
571 case INSN_GP_AV: /* 72 */
575 *(SV**)&GvAV(bytecode_sv) = arg;
578 case INSN_GP_HV: /* 73 */
582 *(SV**)&GvHV(bytecode_sv) = arg;
585 case INSN_GP_CV: /* 74 */
589 *(SV**)&GvCV(bytecode_sv) = arg;
592 case INSN_GP_FILEGV: /* 75 */
596 *(SV**)&GvFILEGV(bytecode_sv) = arg;
599 case INSN_GP_IO: /* 76 */
603 *(SV**)&GvIOp(bytecode_sv) = arg;
606 case INSN_GP_FORM: /* 77 */
610 *(SV**)&GvFORM(bytecode_sv) = arg;
613 case INSN_GP_CVGEN: /* 78 */
617 GvCVGEN(bytecode_sv) = arg;
620 case INSN_GP_LINE: /* 79 */
624 GvLINE(bytecode_sv) = arg;
627 case INSN_GP_SHARE: /* 80 */
631 BSET_gp_share(bytecode_sv, arg);
634 case INSN_XGV_FLAGS: /* 81 */
638 GvFLAGS(bytecode_sv) = arg;
641 case INSN_OP_NEXT: /* 82 */
645 PL_op->op_next = arg;
648 case INSN_OP_SIBLING: /* 83 */
652 PL_op->op_sibling = arg;
655 case INSN_OP_PPADDR: /* 84 */
659 BSET_op_ppaddr(PL_op->op_ppaddr, arg);
662 case INSN_OP_TARG: /* 85 */
666 PL_op->op_targ = arg;
669 case INSN_OP_TYPE: /* 86 */
673 BSET_op_type(PL_op, arg);
676 case INSN_OP_SEQ: /* 87 */
683 case INSN_OP_FLAGS: /* 88 */
687 PL_op->op_flags = arg;
690 case INSN_OP_PRIVATE: /* 89 */
694 PL_op->op_private = arg;
697 case INSN_OP_FIRST: /* 90 */
701 cUNOP->op_first = arg;
704 case INSN_OP_LAST: /* 91 */
708 cBINOP->op_last = arg;
711 case INSN_OP_OTHER: /* 92 */
715 cLOGOP->op_other = arg;
718 case INSN_OP_CHILDREN: /* 93 */
722 cLISTOP->op_children = arg;
725 case INSN_OP_PMREPLROOT: /* 94 */
729 cPMOP->op_pmreplroot = arg;
732 case INSN_OP_PMREPLROOTGV: /* 95 */
736 *(SV**)&cPMOP->op_pmreplroot = arg;
739 case INSN_OP_PMREPLSTART: /* 96 */
743 cPMOP->op_pmreplstart = arg;
746 case INSN_OP_PMNEXT: /* 97 */
750 *(OP**)&cPMOP->op_pmnext = arg;
753 case INSN_PREGCOMP: /* 98 */
756 BGET_pvcontents(arg);
757 BSET_pregcomp(PL_op, arg);
760 case INSN_OP_PMFLAGS: /* 99 */
764 cPMOP->op_pmflags = arg;
767 case INSN_OP_PMPERMFLAGS: /* 100 */
771 cPMOP->op_pmpermflags = arg;
774 case INSN_OP_SV: /* 101 */
781 case INSN_OP_GV: /* 102 */
785 *(SV**)&cGVOP->op_gv = arg;
788 case INSN_OP_PV: /* 103 */
791 BGET_pvcontents(arg);
795 case INSN_OP_PV_TR: /* 104 */
798 BGET_op_tr_array(arg);
802 case INSN_OP_REDOOP: /* 105 */
806 cLOOP->op_redoop = arg;
809 case INSN_OP_NEXTOP: /* 106 */
813 cLOOP->op_nextop = arg;
816 case INSN_OP_LASTOP: /* 107 */
820 cLOOP->op_lastop = arg;
823 case INSN_COP_LABEL: /* 108 */
826 BGET_pvcontents(arg);
827 cCOP->cop_label = arg;
830 case INSN_COP_STASH: /* 109 */
834 *(SV**)&cCOP->cop_stash = arg;
837 case INSN_COP_FILEGV: /* 110 */
841 *(SV**)&cCOP->cop_filegv = arg;
844 case INSN_COP_SEQ: /* 111 */
851 case INSN_COP_ARYBASE: /* 112 */
855 cCOP->cop_arybase = arg;
858 case INSN_COP_LINE: /* 113 */
862 cCOP->cop_line = arg;
865 case INSN_COP_WARNINGS: /* 114 */
869 cCOP->cop_warnings = arg;
872 case INSN_MAIN_START: /* 115 */
879 case INSN_MAIN_ROOT: /* 116 */
886 case INSN_CURPAD: /* 117 */
890 BSET_curpad(PL_curpad, arg);
894 Perl_croak(aTHX_ "Illegal bytecode instruction %d\n", insn);