diff options
author | Malcolm Beattie <mbeattie@sable.ox.ac.uk> | 1998-02-20 16:42:13 +0000 |
---|---|---|
committer | Malcolm Beattie <mbeattie@sable.ox.ac.uk> | 1998-02-20 16:42:13 +0000 |
commit | a8a597b252f6dd39ef24cf476a20f8618821e02f (patch) | |
tree | 9174bca691850d453d3313367a31f17d28fc39e6 /cc_runtime.h | |
parent | 78857c3c631dc8d94f4168aa465a27b5efceb36e (diff) | |
download | perl-a8a597b252f6dd39ef24cf476a20f8618821e02f.tar.gz |
Merge perlext/Compiler/... into mainline. Some files move to
ext/B/..., some to lib/B/..., O.pm and B.pm go in lib and some
move to the base perl directory (e.g. headers). Will need some
cleaning up before it builds properly, I would guess.
p4raw-id: //depot/perl@562
Diffstat (limited to 'cc_runtime.h')
-rw-r--r-- | cc_runtime.h | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/cc_runtime.h b/cc_runtime.h new file mode 100644 index 0000000000..fe830c0bde --- /dev/null +++ b/cc_runtime.h @@ -0,0 +1,71 @@ +#define DOOP(ppname) PUTBACK; op = ppname(ARGS); SPAGAIN + +#define PP_LIST(g) do { \ + dMARK; \ + if (g != G_ARRAY) { \ + if (++MARK <= SP) \ + *MARK = *SP; \ + else \ + *MARK = &sv_undef; \ + SP = MARK; \ + } \ + } while (0) + +#define MAYBE_TAINT_SASSIGN_SRC(sv) \ + if (tainting && tainted && (!SvGMAGICAL(left) || !SvSMAGICAL(left) || \ + !((mg=mg_find(left, 't')) && mg->mg_len & 1)))\ + TAINT_NOT + +#define PP_PREINC(sv) do { \ + if (SvIOK(sv)) { \ + ++SvIVX(sv); \ + SvFLAGS(sv) &= ~(SVf_NOK|SVf_POK|SVp_NOK|SVp_POK); \ + } \ + else \ + sv_inc(sv); \ + SvSETMAGIC(sv); \ + } while (0) + +#define PP_UNSTACK do { \ + TAINT_NOT; \ + stack_sp = stack_base + cxstack[cxstack_ix].blk_oldsp; \ + FREETMPS; \ + oldsave = scopestack[scopestack_ix - 1]; \ + LEAVE_SCOPE(oldsave); \ + SPAGAIN; \ + } while(0) + +/* Anyone using eval "" deserves this mess */ +#define PP_EVAL(ppaddr, nxt) do { \ + dJMPENV; \ + int ret; \ + PUTBACK; \ + JMPENV_PUSH(ret); \ + switch (ret) { \ + case 0: \ + op = ppaddr(ARGS); \ + retstack[retstack_ix - 1] = Nullop; \ + if (op != nxt) runops(); \ + JMPENV_POP; \ + break; \ + case 1: JMPENV_POP; JMPENV_JUMP(1); \ + case 2: JMPENV_POP; JMPENV_JUMP(2); \ + case 3: \ + JMPENV_POP; \ + if (restartop != nxt) \ + JMPENV_JUMP(3); \ + } \ + op = nxt; \ + SPAGAIN; \ + } while (0) + +#define PP_ENTERTRY(jmpbuf,label) do { \ + dJMPENV; \ + int ret; \ + JMPENV_PUSH(ret); \ + switch (ret) { \ + case 1: JMPENV_POP; JMPENV_JUMP(1); \ + case 2: JMPENV_POP; JMPENV_JUMP(2); \ + case 3: JMPENV_POP; SPAGAIN; goto label;\ + } \ + } while (0) |