File Coverage

Opcodes.xs
Criterion Covered Total %
statement 12 12 100.0
branch 8 10 80.0
condition n/a
subroutine n/a
pod n/a
total 20 22 90.9


line stmt bran cond sub pod time code
1             #define PERL_NO_GET_CONTEXT
2             #include "EXTERN.h"
3             #include "perl.h"
4             #include "XSUB.h"
5              
6             #include "ppport.h"
7             #include "const-c.inc"
8              
9             /* Private flags added by me for the optimizer, not in CORE */
10             #define OA_NOSTACK 512
11             #define OA_MAYSCALAR 1024
12             #define OA_MAYARRAY 2048
13             #define OA_MAYVOID 4096
14             #define OA_RETFIXED 8192
15             #define OA_MAYBRANCH 16384
16              
17             MODULE = Opcodes PACKAGE = Opcodes
18              
19             PROTOTYPES: DISABLE
20              
21             INCLUDE: const-xs.inc
22              
23             void
24             opcodes()
25             PPCODE:
26 4 100         if (GIMME_V == G_ARRAY) {
27             int i;
28 3 100         EXTEND(sp, MAXO);
29             /* ([ opcode opname ppaddr check opargs ]) from opnames.h/opcode.h */
30 1281 100         for (i=0; i < MAXO; i++) {
31             AV* ref;
32 1278           ref = newAV();
33 1278           av_extend(ref, 5);
34 1278           av_store(ref, 0, newSViv( i ));
35 1278           av_store(ref, 1, newSVpvn(PL_op_name[i], strlen(PL_op_name[i]) ));
36 1278           av_store(ref, 2, newSVuv( PTR2UV(PL_ppaddr[i]) ));
37 1278           av_store(ref, 3, newSVuv( PTR2UV(PL_check[i]) ));
38 1278           av_store(ref, 4, newSViv( PL_opargs[i] ));
39 1278 50         XPUSHs( sv_2mortal(newRV((SV*)ref)) );
40             }
41             }
42             else {
43 1 50         XPUSHs(sv_2mortal(newSViv(PL_maxo)));
44             }
45