X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=cc_runtime.h;h=90826dfb0e0b7c6528290eb9ead8f714918bdc11;hb=20d572319ce8b690b7b68fec6b58f8ac07b1d362;hp=b7658a936f7ed8620dee279e309372a962afe0f1;hpb=79ee829736f0059fc3a1c40f89ec42de04dad28e;p=p5sagit%2Fp5-mst-13.2.git diff --git a/cc_runtime.h b/cc_runtime.h index b7658a9..90826df 100644 --- a/cc_runtime.h +++ b/cc_runtime.h @@ -1,4 +1,14 @@ -#define DOOP(ppname) PUTBACK; op = ppname(); SPAGAIN +/* cc_runtime.h + * + * Copyright (C) 1999, 2000, 2001, 2004, 2006, 2008 by Larry Wall and others + * + * You may distribute under the terms of either the GNU General Public + * License or the Artistic License, as specified in the README file. + * + */ + +#define DOOP(ppname) PUTBACK; PL_op = ppname(aTHX); SPAGAIN +#define CCPP(s) OP * s(pTHX) #define PP_LIST(g) do { \ dMARK; \ @@ -6,14 +16,14 @@ if (++MARK <= SP) \ *MARK = *SP; \ else \ - *MARK = &sv_undef; \ + *MARK = &PL_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)))\ + if (PL_tainting && PL_tainted && (!SvGMAGICAL(left) || !SvSMAGICAL(left) || \ + !((mg=mg_find(left, PERL_MAGIC_taint)) && mg->mg_len & 1)))\ TAINT_NOT #define PP_PREINC(sv) do { \ @@ -28,48 +38,48 @@ #define PP_UNSTACK do { \ TAINT_NOT; \ - stack_sp = stack_base + cxstack[cxstack_ix].blk_oldsp; \ + PL_stack_sp = PL_stack_base + cxstack[cxstack_ix].blk_oldsp; \ FREETMPS; \ - oldsave = scopestack[scopestack_ix - 1]; \ + oldsave = PL_scopestack[PL_scopestack_ix - 1]; \ LEAVE_SCOPE(oldsave); \ SPAGAIN; \ } while(0) -#include "patchlevel.h" -#if PATCHLEVEL < 3 -#define RUN() run() -#else -#define RUN() runops() -#endif - /* Anyone using eval "" deserves this mess */ #define PP_EVAL(ppaddr, nxt) do { \ - Sigjmp_buf oldtop; \ - Copy(top_env,oldtop,1,Sigjmp_buf); \ + dJMPENV; \ + int ret; \ PUTBACK; \ - switch (Sigsetjmp(top_env,1)) { \ + JMPENV_PUSH(ret); \ + switch (ret) { \ case 0: \ - op = ppaddr(); \ - retstack[retstack_ix - 1] = Nullop; \ - Copy(oldtop,top_env,1,Sigjmp_buf); \ - if (op != nxt) RUN(); \ + PL_op = ppaddr(aTHX); \ + cxstack[cxstack_ix].blk_eval.retop = Nullop; \ + if (PL_op != nxt) CALLRUNOPS(aTHX); \ + JMPENV_POP; \ break; \ - case 1: Copy(oldtop,top_env,1,Sigjmp_buf); Siglongjmp(top_env,1); \ - case 2: Copy(oldtop,top_env,1,Sigjmp_buf); Siglongjmp(top_env,2); \ + case 1: JMPENV_POP; JMPENV_JUMP(1); \ + case 2: JMPENV_POP; JMPENV_JUMP(2); \ case 3: \ - Copy(oldtop,top_env,1,Sigjmp_buf); \ - if (restartop != nxt) \ - Siglongjmp(top_env, 3); \ + JMPENV_POP; \ + if (PL_restartop && PL_restartop != nxt) \ + JMPENV_JUMP(3); \ } \ - op = nxt; \ + PL_op = nxt; \ SPAGAIN; \ } while (0) -#define PP_ENTERTRY(jmpbuf,label) do { \ - Copy(top_env,jmpbuf,1,Sigjmp_buf); \ - switch (Sigsetjmp(top_env,1)) { \ - case 1: Copy(jmpbuf,top_env,1,Sigjmp_buf); Siglongjmp(top_env,1); \ - case 2: Copy(jmpbuf,top_env,1,Sigjmp_buf); Siglongjmp(top_env,2); \ - case 3: Copy(jmpbuf,top_env,1,Sigjmp_buf); SPAGAIN; goto label; \ - } \ - } while (0) +#define PP_ENTERTRY(label) \ + STMT_START { \ + 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;\ + } \ + } STMT_END + +#define PP_LEAVETRY \ + STMT_START{ PL_top_env=PL_top_env->je_prev; }STMT_END