diff options
author | Nicholas Clark <nick@ccl4.org> | 2010-04-15 11:37:53 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2010-04-15 11:37:53 +0100 |
commit | f410a2119920dd04690025a349e79575cfb9c972 (patch) | |
tree | ff2c2f6480e96613f0609b4b959385c90f78bcec /pp_hot.c | |
parent | d1515be42a17e7bb3fa584aea980f54524603f34 (diff) | |
download | perl-f410a2119920dd04690025a349e79575cfb9c972.tar.gz |
Move PERL_ASYNC_CHECK() from the runloop to control flow OPs.
For the typical code this gives a 5% speedup, and removes the cost of "safe
signals". Tight looping code will show less gains, but should never be slower.
Subtle bugs might remain - there might be constructions that enter the runloop
(where signals used to be dispatched) but don't contain any PERL_ASYNC_CHECK()
calls themselves.
Diffstat (limited to 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -52,6 +52,7 @@ PP(pp_nextstate) TAINT_NOT; /* Each statement is presumed innocent */ PL_stack_sp = PL_stack_base + cxstack[cxstack_ix].blk_oldsp; FREETMPS; + PERL_ASYNC_CHECK(); return NORMAL; } @@ -98,6 +99,7 @@ PP(pp_gv) PP(pp_and) { dVAR; dSP; + PERL_ASYNC_CHECK(); if (!SvTRUE(TOPs)) RETURN; else { @@ -203,6 +205,7 @@ PP(pp_sassign) PP(pp_cond_expr) { dVAR; dSP; + PERL_ASYNC_CHECK(); if (SvTRUEx(POPs)) RETURNOP(cLOGOP->op_other); else @@ -416,6 +419,7 @@ PP(pp_preinc) PP(pp_or) { dVAR; dSP; + PERL_ASYNC_CHECK(); if (SvTRUE(TOPs)) RETURN; else { @@ -434,6 +438,7 @@ PP(pp_defined) const bool is_dor = (op_type == OP_DOR || op_type == OP_DORASSIGN); if (is_dor) { + PERL_ASYNC_CHECK(); sv = TOPs; if (!sv || !SvANY(sv)) { if (op_type == OP_DOR) @@ -2077,6 +2082,8 @@ PP(pp_subst) #endif SV *nsv = NULL; + PERL_ASYNC_CHECK(); + /* known replacement string? */ register SV *dstr = (pm->op_pmflags & PMf_CONST) ? POPs : NULL; if (PL_op->op_flags & OPf_STACKED) |