This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Merge perlext/Compiler/... into mainline. Some files move to
[perl5.git] / cc_runtime.h
CommitLineData
a8a597b2
MB
1#define DOOP(ppname) PUTBACK; op = ppname(ARGS); SPAGAIN
2
3#define PP_LIST(g) do { \
4 dMARK; \
5 if (g != G_ARRAY) { \
6 if (++MARK <= SP) \
7 *MARK = *SP; \
8 else \
9 *MARK = &sv_undef; \
10 SP = MARK; \
11 } \
12 } while (0)
13
14#define MAYBE_TAINT_SASSIGN_SRC(sv) \
15 if (tainting && tainted && (!SvGMAGICAL(left) || !SvSMAGICAL(left) || \
16 !((mg=mg_find(left, 't')) && mg->mg_len & 1)))\
17 TAINT_NOT
18
19#define PP_PREINC(sv) do { \
20 if (SvIOK(sv)) { \
21 ++SvIVX(sv); \
22 SvFLAGS(sv) &= ~(SVf_NOK|SVf_POK|SVp_NOK|SVp_POK); \
23 } \
24 else \
25 sv_inc(sv); \
26 SvSETMAGIC(sv); \
27 } while (0)
28
29#define PP_UNSTACK do { \
30 TAINT_NOT; \
31 stack_sp = stack_base + cxstack[cxstack_ix].blk_oldsp; \
32 FREETMPS; \
33 oldsave = scopestack[scopestack_ix - 1]; \
34 LEAVE_SCOPE(oldsave); \
35 SPAGAIN; \
36 } while(0)
37
38/* Anyone using eval "" deserves this mess */
39#define PP_EVAL(ppaddr, nxt) do { \
40 dJMPENV; \
41 int ret; \
42 PUTBACK; \
43 JMPENV_PUSH(ret); \
44 switch (ret) { \
45 case 0: \
46 op = ppaddr(ARGS); \
47 retstack[retstack_ix - 1] = Nullop; \
48 if (op != nxt) runops(); \
49 JMPENV_POP; \
50 break; \
51 case 1: JMPENV_POP; JMPENV_JUMP(1); \
52 case 2: JMPENV_POP; JMPENV_JUMP(2); \
53 case 3: \
54 JMPENV_POP; \
55 if (restartop != nxt) \
56 JMPENV_JUMP(3); \
57 } \
58 op = nxt; \
59 SPAGAIN; \
60 } while (0)
61
62#define PP_ENTERTRY(jmpbuf,label) do { \
63 dJMPENV; \
64 int ret; \
65 JMPENV_PUSH(ret); \
66 switch (ret) { \
67 case 1: JMPENV_POP; JMPENV_JUMP(1); \
68 case 2: JMPENV_POP; JMPENV_JUMP(2); \
69 case 3: JMPENV_POP; SPAGAIN; goto label;\
70 } \
71 } while (0)