This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Copyright++. (Not all the toplevel *.h have one, it seems.)
[perl5.git] / cc_runtime.h
CommitLineData
66918de8 1#define DOOP(ppname) PUTBACK; PL_op = ppname(aTHX); SPAGAIN
0a574d6e 2#define CCPP(s) OP * s(pTHX)
a8a597b2
MB
3
4#define PP_LIST(g) do { \
5 dMARK; \
6 if (g != G_ARRAY) { \
7 if (++MARK <= SP) \
8 *MARK = *SP; \
9 else \
6b88bc9c 10 *MARK = &PL_sv_undef; \
a8a597b2
MB
11 SP = MARK; \
12 } \
13 } while (0)
14
15#define MAYBE_TAINT_SASSIGN_SRC(sv) \
6b88bc9c 16 if (PL_tainting && PL_tainted && (!SvGMAGICAL(left) || !SvSMAGICAL(left) || \
14befaf4 17 !((mg=mg_find(left, PERL_MAGIC_taint)) && mg->mg_len & 1)))\
a8a597b2
MB
18 TAINT_NOT
19
20#define PP_PREINC(sv) do { \
21 if (SvIOK(sv)) { \
22 ++SvIVX(sv); \
23 SvFLAGS(sv) &= ~(SVf_NOK|SVf_POK|SVp_NOK|SVp_POK); \
24 } \
25 else \
26 sv_inc(sv); \
27 SvSETMAGIC(sv); \
28 } while (0)
29
30#define PP_UNSTACK do { \
31 TAINT_NOT; \
6b88bc9c 32 PL_stack_sp = PL_stack_base + cxstack[cxstack_ix].blk_oldsp; \
a8a597b2 33 FREETMPS; \
6b88bc9c 34 oldsave = PL_scopestack[PL_scopestack_ix - 1]; \
a8a597b2
MB
35 LEAVE_SCOPE(oldsave); \
36 SPAGAIN; \
37 } while(0)
38
39/* Anyone using eval "" deserves this mess */
40#define PP_EVAL(ppaddr, nxt) do { \
41 dJMPENV; \
6224f72b 42 int ret; \
a8a597b2 43 PUTBACK; \
6224f72b
GS
44 JMPENV_PUSH(ret); \
45 switch (ret) { \
46 case 0: \
66918de8 47 PL_op = ppaddr(aTHX); \
6b88bc9c 48 PL_retstack[PL_retstack_ix - 1] = Nullop; \
8af582d5 49 if (PL_op != nxt) CALLRUNOPS(); \
a8a597b2
MB
50 JMPENV_POP; \
51 break; \
6224f72b
GS
52 case 1: JMPENV_POP; JMPENV_JUMP(1); \
53 case 2: JMPENV_POP; JMPENV_JUMP(2); \
54 case 3: \
a8a597b2 55 JMPENV_POP; \
0ca04487 56 if (PL_restartop && PL_restartop != nxt) \
6224f72b 57 JMPENV_JUMP(3); \
a8a597b2 58 } \
6b88bc9c 59 PL_op = nxt; \
a8a597b2
MB
60 SPAGAIN; \
61 } while (0)
62
a6f4eb0a 63
1d651c14
VB
64#define PP_ENTERTRY(jmpbuf,label) \
65 STMT_START { \
66 int ret; \
67 JMPENV_PUSH_ENV(jmpbuf,ret); \
68 switch (ret) { \
69 case 1: JMPENV_POP_ENV(jmpbuf); JMPENV_JUMP(1);\
70 case 2: JMPENV_POP_ENV(jmpbuf); JMPENV_JUMP(2);\
71 case 3: JMPENV_POP_ENV(jmpbuf); SPAGAIN; goto label;\
72 } \
73 } STMT_END
74#define PP_LEAVETRY \
75 STMT_START{ PL_top_env=PL_top_env->je_prev; }STMT_END