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.
17 static int optype_size[] = {
32 static SV *specialsv_list[4];
34 static int bytecode_iv_overflows = 0;
35 static SV *bytecode_sv;
36 static XPV bytecode_pv;
37 static void **bytecode_obj_list;
38 static I32 bytecode_obj_list_fill = -1;
41 bset_obj_store(void *obj, I32 ix)
43 if (ix > bytecode_obj_list_fill) {
44 if (bytecode_obj_list_fill == -1)
45 New(666, bytecode_obj_list, ix + 1, void*);
47 Renew(bytecode_obj_list, ix + 1, void*);
48 bytecode_obj_list_fill = ix;
50 bytecode_obj_list[ix] = obj;
54 void byterun(struct bytestream bs)
59 specialsv_list[0] = Nullsv;
60 specialsv_list[1] = &PL_sv_undef;
61 specialsv_list[2] = &PL_sv_yes;
62 specialsv_list[3] = &PL_sv_no;
64 while ((insn = BGET_FGETC()) != EOF) {
66 case INSN_COMMENT: /* 35 */
73 case INSN_NOP: /* 10 */
77 case INSN_RET: /* 0 */
82 case INSN_LDSV: /* 1 */
89 case INSN_LDOP: /* 2 */
96 case INSN_STSV: /* 3 */
100 BSET_OBJ_STORE(bytecode_sv, arg);
103 case INSN_STOP: /* 4 */
107 BSET_OBJ_STORE(PL_op, arg);
110 case INSN_LDSPECSV: /* 5 */
114 BSET_ldspecsv(bytecode_sv, arg);
117 case INSN_NEWSV: /* 6 */
121 BSET_newsv(bytecode_sv, arg);
124 case INSN_NEWOP: /* 7 */
128 BSET_newop(PL_op, arg);
131 case INSN_NEWOPN: /* 8 */
135 BSET_newopn(PL_op, arg);
138 case INSN_NEWPV: /* 9 */
144 case INSN_PV_CUR: /* 11 */
148 bytecode_pv.xpv_cur = arg;
151 case INSN_PV_FREE: /* 12 */
153 BSET_pv_free(bytecode_pv);
156 case INSN_SV_UPGRADE: /* 13 */
160 BSET_sv_upgrade(bytecode_sv, arg);
163 case INSN_SV_REFCNT: /* 14 */
167 SvREFCNT(bytecode_sv) = arg;
170 case INSN_SV_REFCNT_ADD: /* 15 */
174 BSET_sv_refcnt_add(SvREFCNT(bytecode_sv), arg);
177 case INSN_SV_FLAGS: /* 16 */
181 SvFLAGS(bytecode_sv) = arg;
184 case INSN_XRV: /* 17 */
188 SvRV(bytecode_sv) = arg;
191 case INSN_XPV: /* 18 */
193 BSET_xpv(bytecode_sv);
196 case INSN_XIV32: /* 19 */
200 SvIVX(bytecode_sv) = arg;
203 case INSN_XIV64: /* 20 */
207 SvIVX(bytecode_sv) = arg;
210 case INSN_XNV: /* 21 */
214 SvNVX(bytecode_sv) = arg;
217 case INSN_XLV_TARGOFF: /* 22 */
221 LvTARGOFF(bytecode_sv) = arg;
224 case INSN_XLV_TARGLEN: /* 23 */
228 LvTARGLEN(bytecode_sv) = arg;
231 case INSN_XLV_TARG: /* 24 */
235 LvTARG(bytecode_sv) = arg;
238 case INSN_XLV_TYPE: /* 25 */
242 LvTYPE(bytecode_sv) = arg;
245 case INSN_XBM_USEFUL: /* 26 */
249 BmUSEFUL(bytecode_sv) = arg;
252 case INSN_XBM_PREVIOUS: /* 27 */
256 BmPREVIOUS(bytecode_sv) = arg;
259 case INSN_XBM_RARE: /* 28 */
263 BmRARE(bytecode_sv) = arg;
266 case INSN_XFM_LINES: /* 29 */
270 FmLINES(bytecode_sv) = arg;
273 case INSN_XIO_LINES: /* 30 */
277 IoLINES(bytecode_sv) = arg;
280 case INSN_XIO_PAGE: /* 31 */
284 IoPAGE(bytecode_sv) = arg;
287 case INSN_XIO_PAGE_LEN: /* 32 */
291 IoPAGE_LEN(bytecode_sv) = arg;
294 case INSN_XIO_LINES_LEFT: /* 33 */
298 IoLINES_LEFT(bytecode_sv) = arg;
301 case INSN_XIO_TOP_NAME: /* 34 */
304 BGET_pvcontents(arg);
305 IoTOP_NAME(bytecode_sv) = arg;
308 case INSN_XIO_TOP_GV: /* 36 */
312 *(SV**)&IoTOP_GV(bytecode_sv) = arg;
315 case INSN_XIO_FMT_NAME: /* 37 */
318 BGET_pvcontents(arg);
319 IoFMT_NAME(bytecode_sv) = arg;
322 case INSN_XIO_FMT_GV: /* 38 */
326 *(SV**)&IoFMT_GV(bytecode_sv) = arg;
329 case INSN_XIO_BOTTOM_NAME: /* 39 */
332 BGET_pvcontents(arg);
333 IoBOTTOM_NAME(bytecode_sv) = arg;
336 case INSN_XIO_BOTTOM_GV: /* 40 */
340 *(SV**)&IoBOTTOM_GV(bytecode_sv) = arg;
343 case INSN_XIO_SUBPROCESS: /* 41 */
347 IoSUBPROCESS(bytecode_sv) = arg;
350 case INSN_XIO_TYPE: /* 42 */
354 IoTYPE(bytecode_sv) = arg;
357 case INSN_XIO_FLAGS: /* 43 */
361 IoFLAGS(bytecode_sv) = arg;
364 case INSN_XCV_STASH: /* 44 */
368 *(SV**)&CvSTASH(bytecode_sv) = arg;
371 case INSN_XCV_START: /* 45 */
375 CvSTART(bytecode_sv) = arg;
378 case INSN_XCV_ROOT: /* 46 */
382 CvROOT(bytecode_sv) = arg;
385 case INSN_XCV_GV: /* 47 */
389 *(SV**)&CvGV(bytecode_sv) = arg;
392 case INSN_XCV_FILEGV: /* 48 */
396 *(SV**)&CvFILEGV(bytecode_sv) = arg;
399 case INSN_XCV_DEPTH: /* 49 */
403 CvDEPTH(bytecode_sv) = arg;
406 case INSN_XCV_PADLIST: /* 50 */
410 *(SV**)&CvPADLIST(bytecode_sv) = arg;
413 case INSN_XCV_OUTSIDE: /* 51 */
417 *(SV**)&CvOUTSIDE(bytecode_sv) = arg;
420 case INSN_XCV_FLAGS: /* 52 */
424 CvFLAGS(bytecode_sv) = arg;
427 case INSN_AV_EXTEND: /* 53 */
431 BSET_av_extend(bytecode_sv, arg);
434 case INSN_AV_PUSH: /* 54 */
438 BSET_av_push(bytecode_sv, arg);
441 case INSN_XAV_FILL: /* 55 */
445 AvFILLp(bytecode_sv) = arg;
448 case INSN_XAV_MAX: /* 56 */
452 AvMAX(bytecode_sv) = arg;
455 case INSN_XAV_FLAGS: /* 57 */
459 AvFLAGS(bytecode_sv) = arg;
462 case INSN_XHV_RITER: /* 58 */
466 HvRITER(bytecode_sv) = arg;
469 case INSN_XHV_NAME: /* 59 */
472 BGET_pvcontents(arg);
473 HvNAME(bytecode_sv) = arg;
476 case INSN_HV_STORE: /* 60 */
480 BSET_hv_store(bytecode_sv, arg);
483 case INSN_SV_MAGIC: /* 61 */
487 BSET_sv_magic(bytecode_sv, arg);
490 case INSN_MG_OBJ: /* 62 */
494 SvMAGIC(bytecode_sv)->mg_obj = arg;
497 case INSN_MG_PRIVATE: /* 63 */
501 SvMAGIC(bytecode_sv)->mg_private = arg;
504 case INSN_MG_FLAGS: /* 64 */
508 SvMAGIC(bytecode_sv)->mg_flags = arg;
511 case INSN_MG_PV: /* 65 */
514 BGET_pvcontents(arg);
515 BSET_mg_pv(SvMAGIC(bytecode_sv), arg);
518 case INSN_XMG_STASH: /* 66 */
522 *(SV**)&SvSTASH(bytecode_sv) = arg;
525 case INSN_GV_FETCHPV: /* 67 */
529 BSET_gv_fetchpv(bytecode_sv, arg);
532 case INSN_GV_STASHPV: /* 68 */
536 BSET_gv_stashpv(bytecode_sv, arg);
539 case INSN_GP_SV: /* 69 */
543 GvSV(bytecode_sv) = arg;
546 case INSN_GP_REFCNT: /* 70 */
550 GvREFCNT(bytecode_sv) = arg;
553 case INSN_GP_REFCNT_ADD: /* 71 */
557 BSET_gp_refcnt_add(GvREFCNT(bytecode_sv), arg);
560 case INSN_GP_AV: /* 72 */
564 *(SV**)&GvAV(bytecode_sv) = arg;
567 case INSN_GP_HV: /* 73 */
571 *(SV**)&GvHV(bytecode_sv) = arg;
574 case INSN_GP_CV: /* 74 */
578 *(SV**)&GvCV(bytecode_sv) = arg;
581 case INSN_GP_FILEGV: /* 75 */
585 *(SV**)&GvFILEGV(bytecode_sv) = arg;
588 case INSN_GP_IO: /* 76 */
592 *(SV**)&GvIOp(bytecode_sv) = arg;
595 case INSN_GP_FORM: /* 77 */
599 *(SV**)&GvFORM(bytecode_sv) = arg;
602 case INSN_GP_CVGEN: /* 78 */
606 GvCVGEN(bytecode_sv) = arg;
609 case INSN_GP_LINE: /* 79 */
613 GvLINE(bytecode_sv) = arg;
616 case INSN_GP_SHARE: /* 80 */
620 BSET_gp_share(bytecode_sv, arg);
623 case INSN_XGV_FLAGS: /* 81 */
627 GvFLAGS(bytecode_sv) = arg;
630 case INSN_OP_NEXT: /* 82 */
634 PL_op->op_next = arg;
637 case INSN_OP_SIBLING: /* 83 */
641 PL_op->op_sibling = arg;
644 case INSN_OP_PPADDR: /* 84 */
648 BSET_op_ppaddr(PL_op->op_ppaddr, arg);
651 case INSN_OP_TARG: /* 85 */
655 PL_op->op_targ = arg;
658 case INSN_OP_TYPE: /* 86 */
662 BSET_op_type(PL_op, arg);
665 case INSN_OP_SEQ: /* 87 */
672 case INSN_OP_FLAGS: /* 88 */
676 PL_op->op_flags = arg;
679 case INSN_OP_PRIVATE: /* 89 */
683 PL_op->op_private = arg;
686 case INSN_OP_FIRST: /* 90 */
690 cUNOP->op_first = arg;
693 case INSN_OP_LAST: /* 91 */
697 cBINOP->op_last = arg;
700 case INSN_OP_OTHER: /* 92 */
704 cLOGOP->op_other = arg;
707 case INSN_OP_TRUE: /* 93 */
711 cCONDOP->op_true = arg;
714 case INSN_OP_FALSE: /* 94 */
718 cCONDOP->op_false = arg;
721 case INSN_OP_CHILDREN: /* 95 */
725 cLISTOP->op_children = arg;
728 case INSN_OP_PMREPLROOT: /* 96 */
732 cPMOP->op_pmreplroot = arg;
735 case INSN_OP_PMREPLROOTGV: /* 97 */
739 *(SV**)&cPMOP->op_pmreplroot = arg;
742 case INSN_OP_PMREPLSTART: /* 98 */
746 cPMOP->op_pmreplstart = arg;
749 case INSN_OP_PMNEXT: /* 99 */
753 *(OP**)&cPMOP->op_pmnext = arg;
756 case INSN_PREGCOMP: /* 100 */
759 BGET_pvcontents(arg);
760 BSET_pregcomp(PL_op, arg);
763 case INSN_OP_PMFLAGS: /* 101 */
767 cPMOP->op_pmflags = arg;
770 case INSN_OP_PMPERMFLAGS: /* 102 */
774 cPMOP->op_pmpermflags = arg;
777 case INSN_OP_SV: /* 103 */
784 case INSN_OP_GV: /* 104 */
788 *(SV**)&cGVOP->op_gv = arg;
791 case INSN_OP_PV: /* 105 */
794 BGET_pvcontents(arg);
798 case INSN_OP_PV_TR: /* 106 */
801 BGET_op_tr_array(arg);
805 case INSN_OP_REDOOP: /* 107 */
809 cLOOP->op_redoop = arg;
812 case INSN_OP_NEXTOP: /* 108 */
816 cLOOP->op_nextop = arg;
819 case INSN_OP_LASTOP: /* 109 */
823 cLOOP->op_lastop = arg;
826 case INSN_COP_LABEL: /* 110 */
829 BGET_pvcontents(arg);
830 cCOP->cop_label = arg;
833 case INSN_COP_STASH: /* 111 */
837 *(SV**)&cCOP->cop_stash = arg;
840 case INSN_COP_FILEGV: /* 112 */
844 *(SV**)&cCOP->cop_filegv = arg;
847 case INSN_COP_SEQ: /* 113 */
854 case INSN_COP_ARYBASE: /* 114 */
858 cCOP->cop_arybase = arg;
861 case INSN_COP_LINE: /* 115 */
865 cCOP->cop_line = arg;
868 case INSN_COP_WARNINGS: /* 116 */
872 cCOP->cop_warnings = arg;
875 case INSN_MAIN_START: /* 117 */
882 case INSN_MAIN_ROOT: /* 118 */
889 case INSN_CURPAD: /* 119 */
893 BSET_curpad(PL_curpad, arg);
897 croak("Illegal bytecode instruction %d\n", insn);