--- Faster/Faster.xs 2006/03/10 22:18:39 1.7 +++ Faster/Faster.xs 2006/03/12 17:03:39 1.8 @@ -10,35 +10,38 @@ static OP * faster_entersub (pTHX) { - dSP; - dTOPss; - - if (SvTYPE (sv) == SVt_PVGV) - sv = (SV *)GvCV (sv); - - if (sv) + if (!PL_compcv) // only when not compiling, reduces recompiling due to op-address-shift { - // only once for now - PL_op->op_ppaddr = old_entersub; + dSP; + dTOPss; - // only simple cv calls for now - if (!PL_perldb && !PL_tainting - && SvTYPE (sv) == SVt_PVCV && !CvXSUB (sv) - && CvSTART (sv) // must exist - && CvSTART (sv)->op_type != OP_NULL) // shield against compiling an already-compiled op + if (SvTYPE (sv) == SVt_PVGV) + sv = (SV *)GvCV (sv); + + if (sv) { - SV *bsv = newSViv (PTR2IV (sv)); + // only once for now + PL_op->op_ppaddr = old_entersub; + + // only simple cv calls for now + if (!PL_perldb && !PL_tainting + && SvTYPE (sv) == SVt_PVCV && !CvXSUB (sv) + && CvSTART (sv) // must exist + && CvSTART (sv)->op_type != OP_NULL) // shield against compiling an already-compiled op + { + SV *bsv = newSViv (PTR2IV (sv)); - ENTER; - SAVETMPS; - PUSHMARK (SP); - // emulate B::CV typemap entry we don't have - XPUSHs (sv_2mortal (sv_bless (newRV_noinc (bsv), gv_stashpv ("B::CV", 1)))); - PUTBACK; - call_pv ("Faster::entersub", G_VOID|G_DISCARD|G_EVAL); - SPAGAIN; - FREETMPS; - LEAVE; + ENTER; + SAVETMPS; + PUSHMARK (SP); + // emulate B::CV typemap entry we don't have + XPUSHs (sv_2mortal (sv_bless (newRV_noinc (bsv), gv_stashpv ("B::CV", 1)))); + PUTBACK; + call_pv ("Faster::entersub", G_VOID|G_DISCARD|G_EVAL); + SPAGAIN; + FREETMPS; + LEAVE; + } } }