⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 byterun.c

📁 UNIX下perl实现代码
💻 C
📖 第 1 页 / 共 2 页
字号:
/* *      Copyright (c) 1996-1999 Malcolm Beattie * *      You may distribute under the terms of either the GNU General Public *      License or the Artistic License, as specified in the README file. * *//* * This file is autogenerated from bytecode.pl. Changes made here will be lost. */#define PERL_NO_GET_CONTEXT#include "EXTERN.h"#include "perl.h"#define NO_XSLOCKS#include "XSUB.h"#ifdef PERL_OBJECT#undef CALL_FPTR#define CALL_FPTR(fptr) (pPerl->*fptr)#undef PL_ppaddr#define PL_ppaddr (*get_ppaddr())#endif#include "byterun.h"#include "bytecode.h"static const int optype_size[] = {    sizeof(OP),    sizeof(UNOP),    sizeof(BINOP),    sizeof(LOGOP),    sizeof(LISTOP),    sizeof(PMOP),    sizeof(SVOP),    sizeof(PADOP),    sizeof(PVOP),    sizeof(LOOP),    sizeof(COP)};void *bset_obj_store(pTHXo_ struct byteloader_state *bstate, void *obj, I32 ix){    if (ix > bstate->bs_obj_list_fill) {	Renew(bstate->bs_obj_list, ix + 32, void*);	bstate->bs_obj_list_fill = ix + 31;    }    bstate->bs_obj_list[ix] = obj;    return obj;}voidbyterun(pTHXo_ register struct byteloader_state *bstate){    register int insn;    U32 ix;    SV *specialsv_list[6];    BYTECODE_HEADER_CHECK;	/* croak if incorrect platform */    New(666, bstate->bs_obj_list, 32, void*); /* set op objlist */    bstate->bs_obj_list_fill = 31;    specialsv_list[0] = Nullsv;    specialsv_list[1] = &PL_sv_undef;    specialsv_list[2] = &PL_sv_yes;    specialsv_list[3] = &PL_sv_no;    specialsv_list[4] = pWARN_ALL;    specialsv_list[5] = pWARN_NONE;    while ((insn = BGET_FGETC()) != EOF) {	switch (insn) {	  case INSN_COMMENT:		/* 35 */	    {		comment_t arg;		BGET_comment_t(arg);		arg = arg;		break;	    }	  case INSN_NOP:		/* 10 */	    {		break;	    }	  case INSN_RET:		/* 0 */	    {		BSET_ret(none);		break;	    }	  case INSN_LDSV:		/* 1 */	    {		svindex arg;		BGET_svindex(arg);		bstate->bs_sv = arg;		break;	    }	  case INSN_LDOP:		/* 2 */	    {		opindex arg;		BGET_opindex(arg);		PL_op = arg;		break;	    }	  case INSN_STSV:		/* 3 */	    {		U32 arg;		BGET_U32(arg);		BSET_OBJ_STORE(bstate->bs_sv, arg);		break;	    }	  case INSN_STOP:		/* 4 */	    {		U32 arg;		BGET_U32(arg);		BSET_OBJ_STORE(PL_op, arg);		break;	    }	  case INSN_STPV:		/* 5 */	    {		U32 arg;		BGET_U32(arg);		BSET_stpv(bstate->bs_pv.xpv_pv, arg);		break;	    }	  case INSN_LDSPECSV:		/* 6 */	    {		U8 arg;		BGET_U8(arg);		BSET_ldspecsv(bstate->bs_sv, arg);		break;	    }	  case INSN_NEWSV:		/* 7 */	    {		U8 arg;		BGET_U8(arg);		BSET_newsv(bstate->bs_sv, arg);		break;	    }	  case INSN_NEWOP:		/* 8 */	    {		U8 arg;		BGET_U8(arg);		BSET_newop(PL_op, arg);		break;	    }	  case INSN_NEWOPN:		/* 9 */	    {		U8 arg;		BGET_U8(arg);		BSET_newopn(PL_op, arg);		break;	    }	  case INSN_NEWPV:		/* 11 */	    {		PV arg;		BGET_PV(arg);		break;	    }	  case INSN_PV_CUR:		/* 12 */	    {		STRLEN arg;		BGET_U32(arg);		bstate->bs_pv.xpv_cur = arg;		break;	    }	  case INSN_PV_FREE:		/* 13 */	    {		BSET_pv_free(bstate->bs_pv);		break;	    }	  case INSN_SV_UPGRADE:		/* 14 */	    {		char arg;		BGET_U8(arg);		BSET_sv_upgrade(bstate->bs_sv, arg);		break;	    }	  case INSN_SV_REFCNT:		/* 15 */	    {		U32 arg;		BGET_U32(arg);		SvREFCNT(bstate->bs_sv) = arg;		break;	    }	  case INSN_SV_REFCNT_ADD:		/* 16 */	    {		I32 arg;		BGET_I32(arg);		BSET_sv_refcnt_add(SvREFCNT(bstate->bs_sv), arg);		break;	    }	  case INSN_SV_FLAGS:		/* 17 */	    {		U32 arg;		BGET_U32(arg);		SvFLAGS(bstate->bs_sv) = arg;		break;	    }	  case INSN_XRV:		/* 18 */	    {		svindex arg;		BGET_svindex(arg);		SvRV(bstate->bs_sv) = arg;		break;	    }	  case INSN_XPV:		/* 19 */	    {		BSET_xpv(bstate->bs_sv);		break;	    }	  case INSN_XIV32:		/* 20 */	    {		I32 arg;		BGET_I32(arg);		SvIVX(bstate->bs_sv) = arg;		break;	    }	  case INSN_XIV64:		/* 21 */	    {		IV64 arg;		BGET_IV64(arg);		SvIVX(bstate->bs_sv) = arg;		break;	    }	  case INSN_XNV:		/* 22 */	    {		NV arg;		BGET_NV(arg);		SvNVX(bstate->bs_sv) = arg;		break;	    }	  case INSN_XLV_TARGOFF:		/* 23 */	    {		STRLEN arg;		BGET_U32(arg);		LvTARGOFF(bstate->bs_sv) = arg;		break;	    }	  case INSN_XLV_TARGLEN:		/* 24 */	    {		STRLEN arg;		BGET_U32(arg);		LvTARGLEN(bstate->bs_sv) = arg;		break;	    }	  case INSN_XLV_TARG:		/* 25 */	    {		svindex arg;		BGET_svindex(arg);		LvTARG(bstate->bs_sv) = arg;		break;	    }	  case INSN_XLV_TYPE:		/* 26 */	    {		char arg;		BGET_U8(arg);		LvTYPE(bstate->bs_sv) = arg;		break;	    }	  case INSN_XBM_USEFUL:		/* 27 */	    {		I32 arg;		BGET_I32(arg);		BmUSEFUL(bstate->bs_sv) = arg;		break;	    }	  case INSN_XBM_PREVIOUS:		/* 28 */	    {		U16 arg;		BGET_U16(arg);		BmPREVIOUS(bstate->bs_sv) = arg;		break;	    }	  case INSN_XBM_RARE:		/* 29 */	    {		U8 arg;		BGET_U8(arg);		BmRARE(bstate->bs_sv) = arg;		break;	    }	  case INSN_XFM_LINES:		/* 30 */	    {		I32 arg;		BGET_I32(arg);		FmLINES(bstate->bs_sv) = arg;		break;	    }	  case INSN_XIO_LINES:		/* 31 */	    {		long arg;		BGET_I32(arg);		IoLINES(bstate->bs_sv) = arg;		break;	    }	  case INSN_XIO_PAGE:		/* 32 */	    {		long arg;		BGET_I32(arg);		IoPAGE(bstate->bs_sv) = arg;		break;	    }	  case INSN_XIO_PAGE_LEN:		/* 33 */	    {		long arg;		BGET_I32(arg);		IoPAGE_LEN(bstate->bs_sv) = arg;		break;	    }	  case INSN_XIO_LINES_LEFT:		/* 34 */	    {		long arg;		BGET_I32(arg);		IoLINES_LEFT(bstate->bs_sv) = arg;		break;	    }	  case INSN_XIO_TOP_NAME:		/* 36 */	    {		pvcontents arg;		BGET_pvcontents(arg);		IoTOP_NAME(bstate->bs_sv) = arg;		break;	    }	  case INSN_XIO_TOP_GV:		/* 37 */	    {		svindex arg;		BGET_svindex(arg);		*(SV**)&IoTOP_GV(bstate->bs_sv) = arg;		break;	    }	  case INSN_XIO_FMT_NAME:		/* 38 */	    {		pvcontents arg;		BGET_pvcontents(arg);		IoFMT_NAME(bstate->bs_sv) = arg;		break;	    }	  case INSN_XIO_FMT_GV:		/* 39 */	    {		svindex arg;		BGET_svindex(arg);		*(SV**)&IoFMT_GV(bstate->bs_sv) = arg;		break;	    }	  case INSN_XIO_BOTTOM_NAME:		/* 40 */	    {		pvcontents arg;		BGET_pvcontents(arg);		IoBOTTOM_NAME(bstate->bs_sv) = arg;		break;	    }	  case INSN_XIO_BOTTOM_GV:		/* 41 */	    {		svindex arg;		BGET_svindex(arg);		*(SV**)&IoBOTTOM_GV(bstate->bs_sv) = arg;		break;	    }	  case INSN_XIO_SUBPROCESS:		/* 42 */	    {		short arg;		BGET_U16(arg);		IoSUBPROCESS(bstate->bs_sv) = arg;		break;	    }	  case INSN_XIO_TYPE:		/* 43 */	    {		char arg;		BGET_U8(arg);		IoTYPE(bstate->bs_sv) = arg;		break;	    }	  case INSN_XIO_FLAGS:		/* 44 */	    {		char arg;		BGET_U8(arg);		IoFLAGS(bstate->bs_sv) = arg;		break;	    }	  case INSN_XCV_STASH:		/* 45 */	    {		svindex arg;		BGET_svindex(arg);		*(SV**)&CvSTASH(bstate->bs_sv) = arg;		break;	    }	  case INSN_XCV_START:		/* 46 */	    {		opindex arg;		BGET_opindex(arg);		CvSTART(bstate->bs_sv) = arg;		break;	    }	  case INSN_XCV_ROOT:		/* 47 */	    {		opindex arg;		BGET_opindex(arg);		CvROOT(bstate->bs_sv) = arg;		break;	    }	  case INSN_XCV_GV:		/* 48 */	    {		svindex arg;		BGET_svindex(arg);		*(SV**)&CvGV(bstate->bs_sv) = arg;		break;	    }	  case INSN_XCV_FILE:		/* 49 */	    {		pvindex arg;		BGET_pvindex(arg);		CvFILE(bstate->bs_sv) = arg;		break;	    }	  case INSN_XCV_DEPTH:		/* 50 */	    {		long arg;		BGET_I32(arg);		CvDEPTH(bstate->bs_sv) = arg;		break;	    }	  case INSN_XCV_PADLIST:		/* 51 */	    {		svindex arg;		BGET_svindex(arg);		*(SV**)&CvPADLIST(bstate->bs_sv) = arg;		break;	    }	  case INSN_XCV_OUTSIDE:		/* 52 */	    {		svindex arg;		BGET_svindex(arg);		*(SV**)&CvOUTSIDE(bstate->bs_sv) = arg;		break;	    }	  case INSN_XCV_FLAGS:		/* 53 */	    {		U16 arg;		BGET_U16(arg);		CvFLAGS(bstate->bs_sv) = arg;		break;	    }	  case INSN_AV_EXTEND:		/* 54 */	    {		SSize_t arg;		BGET_I32(arg);		BSET_av_extend(bstate->bs_sv, arg);		break;	    }	  case INSN_AV_PUSH:		/* 55 */	    {		svindex arg;		BGET_svindex(arg);		BSET_av_push(bstate->bs_sv, arg);		break;	    }	  case INSN_XAV_FILL:		/* 56 */	    {		SSize_t arg;		BGET_I32(arg);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -