bytecode.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
typedef char *pvcontents;
typedef char *strconst;
typedef char *op_tr_array;
typedef int comment_t;
typedef char *pvindex;
/* all this should be made endianness-agnostic */
#define BGET_PADOFFSET(arg) \
if (arg) { \
} else { \
} \
} STMT_END
#ifdef BYTELOADER_LOG_COMMENTS
# define BGET_comment_t(arg) \
STMT_START { \
char buf[1024]; \
int i = 0; \
do { \
arg = BGET_FGETC(); \
buf[i] = '\0'; \
} STMT_END
#else
# define BGET_comment_t(arg) \
#endif
#define BGET_op_tr_array(arg) do { \
} while (0)
arg = PL_tokenbuf; \
} STMT_END
char *str; \
BGET_strconst(str); \
} STMT_END
} STMT_END
} STMT_END
BSET_OBJ_STOREX(sv); \
} STMT_END
SAVEFREEPV(pv); \
} STMT_END
} STMT_END
BSET_OBJ_STOREX(sv); \
} STMT_END
BSET_OBJ_STOREX(sv); \
} STMT_END
} while (0)
#ifdef USE_ITHREADS
/* copied after the code in newPMOP() */
#define BSET_pregcomp(o, arg) \
STMT_START { \
} else { \
} \
} STMT_END
#else
#define BSET_pregcomp(o, arg) \
STMT_START { \
} STMT_END
#endif /* USE_THREADS */
switch(arg) { \
case SVt_PVAV: \
break; \
case SVt_PVHV: \
break; \
default: \
}
BSET_OBJ_STOREX(sv); \
} STMT_END
/* newop->op_next = o; XXX */ \
o = newop; \
arg >>=7; \
BSET_op_type(o, arg); \
BSET_OBJ_STOREX(o); \
} STMT_END
BSET_newop(o, arg); \
} STMT_END
return 0; \
} STMT_END
/*
* stolen from toke.c: better if that was a function.
* in toke.c there are also #ifdefs for dosish systems and i/o layers
*/
#define set_clonex(fp) \
STMT_START { \
} STMT_END
#else
#define set_clonex(fp)
#endif
STMT_START { \
char *pname = "main"; \
if (arg == 'D') \
GvMULTI_on(gv); \
set_clonex(PL_rsfp); \
/* Mark this internal pseudo-handle as clean */ \
if (PL_preprocess) \
else \
return 1; \
} STMT_END
/* stolen from op.c */
STMT_START { \
ENTER; \
GvIMPORTED_CV_on(gv); \
LEAVE; \
} STMT_END
/*
* Kludge special-case workaround for OP_MAPSTART
* which needs the ppaddr for OP_GREPSTART. Blech.
*/
if (arg == OP_MAPSTART) \
arg = OP_GREPSTART; \
} STMT_END
} STMT_END
#ifdef USE_ITHREADS
#else
/* this works now that Sarathy's changed the CopFILE_set macro to do the SvREFCNT_inc()
-- BKS 6-2-2000 */
/* that really meant the actual CopFILEGV_set */
#endif
/* this is simply stolen from the code in newATTRSUB() */
STMT_START { \
ENTER; \
SAVECOPFILE(&PL_compiling); \
SAVECOPLINE(&PL_compiling); \
if (!PL_beginav) \
PL_beginav = newAV(); \
PL_curcop = &PL_compiling; \
LEAVE; \
} STMT_END
STMT_START { \
} STMT_END
STMT_START { \
} STMT_END
#define BSET_OBJ_STOREX(obj) \
/* NOTE: the bytecode header only sanity-checks the bytecode. If a script cares about
* what version of Perl it's being called under, it should do a 'use 5.006_001' or
* equivalent. However, since the header includes checks requiring an exact match in
* ByteLoader versions (we can't guarantee forward compatibility), you don't
* need to specify one:
* use ByteLoader;
* is all you need.
* -- BKS, June 2000
*/
#define HEADER_FAIL(f) \
#define HEADER_FAIL1(f, arg1) \
#define BYTECODE_HEADER_CHECK \
STMT_START { \
\
if (sz != 0x43424c50) { \
} \
} \
HEADER_FAIL2("mismatched ByteLoader versions (want %s, you have %s)", \
} \
HEADER_FAIL("different IVSIZE"); \
} \
HEADER_FAIL("different PTRSIZE"); \
} \
} STMT_END