… | |
… | |
3 | #include "XSUB.h" |
3 | #include "XSUB.h" |
4 | |
4 | |
5 | typedef CV *B__CV; |
5 | typedef CV *B__CV; |
6 | |
6 | |
7 | static OP *(*old_entersub)(pTHX); |
7 | static OP *(*old_entersub)(pTHX); |
8 | |
|
|
9 | int count = 1; |
|
|
10 | |
8 | |
11 | // this is, of course, a slower entersub |
9 | // this is, of course, a slower entersub |
12 | static OP * |
10 | static OP * |
13 | faster_entersub (pTHX) |
11 | faster_entersub (pTHX) |
14 | { |
12 | { |
… | |
… | |
24 | PL_op->op_ppaddr = old_entersub; |
22 | PL_op->op_ppaddr = old_entersub; |
25 | |
23 | |
26 | // only simple cv calls for now |
24 | // only simple cv calls for now |
27 | if (!PL_perldb && !PL_tainting |
25 | if (!PL_perldb && !PL_tainting |
28 | && SvTYPE (sv) == SVt_PVCV && !CvXSUB (sv) |
26 | && SvTYPE (sv) == SVt_PVCV && !CvXSUB (sv) |
|
|
27 | && CvSTART (sv) // must exist |
29 | && CvSTART (sv)->op_type != OP_NULL) // shield against compiling an already-compiled op |
28 | && CvSTART (sv)->op_type != OP_NULL) // shield against compiling an already-compiled op |
30 | { |
29 | { |
31 | SV *bsv = newSViv (PTR2IV (sv)); |
30 | SV *bsv = newSViv (PTR2IV (sv)); |
32 | |
31 | |
33 | ENTER; |
32 | ENTER; |