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
|
1227
|
|
|
|
|
|
OP* intercepted_entersub(pTHX) { |
11
|
1227
|
|
|
|
|
|
auto ret = PL_ppaddr[OP_ENTERSUB](aTHX); |
12
|
1224
|
|
|
|
|
|
++post; |
13
|
1224
|
|
|
|
|
|
return ret; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
3038
|
|
|
|
|
|
static void my_rpeep(pTHX_ OP *first) |
17
|
|
|
|
|
|
|
{ |
18
|
84704
|
|
|
|
|
|
auto mark = [] (OP* it) { |
19
|
84704
|
100
|
|
|
|
|
if (it->op_type == OP_ENTERSUB) { |
20
|
2582
|
|
|
|
|
|
it->op_ppaddr = &intercepted_entersub; |
21
|
|
|
|
|
|
|
} |
22
|
84704
|
|
|
|
|
|
}; |
23
|
|
|
|
|
|
|
OP *o, *t; |
24
|
44704
|
100
|
|
|
|
|
for(t = o = first; o; o = o->op_next, t = t->op_next) { |
25
|
43038
|
|
|
|
|
|
mark(o); |
26
|
43038
|
|
|
|
|
|
o = o->op_next; |
27
|
43038
|
100
|
|
|
|
|
if(!o || o == t) break; |
|
|
50
|
|
|
|
|
|
28
|
41666
|
|
|
|
|
|
mark(o); |
29
|
|
|
|
|
|
|
} |
30
|
3038
|
50
|
|
|
|
|
prev_rpeepp(aTHX_ first); |
31
|
3038
|
|
|
|
|
|
} |
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
|
|
|
|
|
|
|
} |