bytecode.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
typedef char *pvcontents;
typedef char *strconst;
typedef char *op_tr_array;
typedef int comment_t;
typedef char *pvindex;
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
/*
* In the following, sizeof(IV)*4 is just a way of encoding 32 on 64-bit-IV
* machines such that 32-bit machine compilers don't whine about the shift
* count being too high even though the code is never reached there.
*/
if (sizeof(IV) == 8) \
} \
else { \
bstate->bs_iv_overflows++; \
arg = 0; \
} \
} STMT_END
#define BGET_op_tr_array(arg) do { \
unsigned short *ary; \
int i; \
} while (0)
arg = PL_tokenbuf; \
} STMT_END
char *str; \
BGET_strconst(str); \
} STMT_END
} STMT_END
} STMT_END
SAVEFREEPV(pv); \
} STMT_END
} STMT_END
} while (0)
#define BSET_pregcomp(o, arg) \
STMT_START { \
NEWSV(666,0)); \
} STMT_END
BSET_newop(o, arg); \
} STMT_END
return; \
} 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
/* this works now that Sarathy's changed the CopFILE_set macro to do the SvREFCNT_inc()
-- BKS 6-2-2000 */
/* this is simply stolen from the code in newATTRSUB() */
STMT_START { \
ENTER; \
SAVECOPFILE(&PL_compiling); \
SAVECOPLINE(&PL_compiling); \
save_svref(&PL_rs); \
if (!PL_beginav) \
PL_beginav = newAV(); \
PL_curcop = &PL_compiling; \
LEAVE; \
} STMT_END
STMT_START { \
} STMT_END
STMT_START { \
} STMT_END
/* 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 'require 5.6.0' 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"); \
} \
HEADER_FAIL("different byteorder"); \
} \
} STMT_END