line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#include |
2
|
|
|
|
|
|
|
#include |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
using namespace xs; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
static peep_t prev_rpeepp; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
static int post = 0; |
9
|
|
|
|
|
|
|
|
10
|
1242
|
|
|
|
|
|
OP* intercepted_entersub(pTHX) { |
11
|
1242
|
|
|
|
|
|
auto ret = PL_ppaddr[OP_ENTERSUB](aTHX); |
12
|
1237
|
|
|
|
|
|
++post; |
13
|
1237
|
|
|
|
|
|
return ret; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
3050
|
|
|
|
|
|
static void my_rpeep(pTHX_ OP *first) |
17
|
|
|
|
|
|
|
{ |
18
|
84994
|
|
|
|
|
|
auto mark = [] (OP* it) { |
19
|
84994
|
100
|
|
|
|
|
if (it->op_type == OP_ENTERSUB) { |
20
|
2612
|
|
|
|
|
|
it->op_ppaddr = &intercepted_entersub; |
21
|
|
|
|
|
|
|
} |
22
|
84994
|
|
|
|
|
|
}; |
23
|
|
|
|
|
|
|
OP *o, *t; |
24
|
44859
|
100
|
|
|
|
|
for(t = o = first; o; o = o->op_next, t = t->op_next) { |
25
|
43185
|
|
|
|
|
|
mark(o); |
26
|
43185
|
|
|
|
|
|
o = o->op_next; |
27
|
43185
|
100
|
|
|
|
|
if(!o || o == t) break; |
|
|
50
|
|
|
|
|
|
28
|
41809
|
|
|
|
|
|
mark(o); |
29
|
|
|
|
|
|
|
} |
30
|
3050
|
50
|
|
|
|
|
prev_rpeepp(aTHX_ first); |
31
|
3050
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
MODULE = MyTest PACKAGE = MyTest |
34
|
|
|
|
|
|
|
PROTOTYPES: DISABLE |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
BOOT { |
38
|
8
|
|
|
|
|
|
prev_rpeepp = PL_rpeepp; |
39
|
8
|
|
|
|
|
|
PL_rpeepp = my_rpeep; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
int marker() { |
43
|
60
|
|
|
|
|
|
RETVAL = post; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
void test() { |
47
|
|
|
|
|
|
|
// no-op |
48
|
|
|
|
|
|
|
} |