Filename | /usr/local/lib/perl5/5.24/warnings.pm |
Statements | Executed 1714 statements in 9.12ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
116 | 116 | 113 | 3.47ms | 3.47ms | import | warnings::
9 | 2 | 2 | 3.32ms | 3.59ms | register_categories | warnings::
17 | 17 | 12 | 1.01ms | 1.01ms | unimport | warnings::
16 | 2 | 1 | 264µs | 264µs | _mkMask | warnings::
1 | 1 | 1 | 11µs | 11µs | CORE:match (opcode) | warnings::
0 | 0 | 0 | 0s | 0s | Croaker | warnings::
0 | 0 | 0 | 0s | 0s | __chk | warnings::
0 | 0 | 0 | 0s | 0s | _bits | warnings::
0 | 0 | 0 | 0s | 0s | _error_loc | warnings::
0 | 0 | 0 | 0s | 0s | bits | warnings::
0 | 0 | 0 | 0s | 0s | enabled | warnings::
0 | 0 | 0 | 0s | 0s | fatal_enabled | warnings::
0 | 0 | 0 | 0s | 0s | warn | warnings::
0 | 0 | 0 | 0s | 0s | warnif | warnings::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | # -*- buffer-read-only: t -*- | ||||
2 | # !!!!!!! DO NOT EDIT THIS FILE !!!!!!! | ||||
3 | # This file is built by regen/warnings.pl. | ||||
4 | # Any changes made here will be lost! | ||||
5 | |||||
6 | package warnings; | ||||
7 | |||||
8 | 1 | 2µs | our $VERSION = "1.36"; | ||
9 | |||||
10 | # Verify that we're called correctly so that warnings will work. | ||||
11 | # Can't use Carp, since Carp uses us! | ||||
12 | # String regexps because constant folding = smaller optree = less memory vs regexp literal | ||||
13 | # see also strict.pm. | ||||
14 | 1 | 26µs | 1 | 11µs | die sprintf "Incorrect use of pragma '%s' at %s line %d.\n", __PACKAGE__, +(caller)[1,2] # spent 11µs making 1 call to warnings::CORE:match |
15 | if __FILE__ !~ ( '(?x) \b '.__PACKAGE__.' \.pmc? \z' ) | ||||
16 | && __FILE__ =~ ( '(?x) \b (?i:'.__PACKAGE__.') \.pmc? \z' ); | ||||
17 | |||||
18 | 1 | 44µs | our %Offsets = ( | ||
19 | # Warnings Categories added in Perl 5.008 | ||||
20 | 'all' => 0, | ||||
21 | 'closure' => 2, | ||||
22 | 'deprecated' => 4, | ||||
23 | 'exiting' => 6, | ||||
24 | 'glob' => 8, | ||||
25 | 'io' => 10, | ||||
26 | 'closed' => 12, | ||||
27 | 'exec' => 14, | ||||
28 | 'layer' => 16, | ||||
29 | 'newline' => 18, | ||||
30 | 'pipe' => 20, | ||||
31 | 'unopened' => 22, | ||||
32 | 'misc' => 24, | ||||
33 | 'numeric' => 26, | ||||
34 | 'once' => 28, | ||||
35 | 'overflow' => 30, | ||||
36 | 'pack' => 32, | ||||
37 | 'portable' => 34, | ||||
38 | 'recursion' => 36, | ||||
39 | 'redefine' => 38, | ||||
40 | 'regexp' => 40, | ||||
41 | 'severe' => 42, | ||||
42 | 'debugging' => 44, | ||||
43 | 'inplace' => 46, | ||||
44 | 'internal' => 48, | ||||
45 | 'malloc' => 50, | ||||
46 | 'signal' => 52, | ||||
47 | 'substr' => 54, | ||||
48 | 'syntax' => 56, | ||||
49 | 'ambiguous' => 58, | ||||
50 | 'bareword' => 60, | ||||
51 | 'digit' => 62, | ||||
52 | 'parenthesis' => 64, | ||||
53 | 'precedence' => 66, | ||||
54 | 'printf' => 68, | ||||
55 | 'prototype' => 70, | ||||
56 | 'qw' => 72, | ||||
57 | 'reserved' => 74, | ||||
58 | 'semicolon' => 76, | ||||
59 | 'taint' => 78, | ||||
60 | 'threads' => 80, | ||||
61 | 'uninitialized' => 82, | ||||
62 | 'unpack' => 84, | ||||
63 | 'untie' => 86, | ||||
64 | 'utf8' => 88, | ||||
65 | 'void' => 90, | ||||
66 | |||||
67 | # Warnings Categories added in Perl 5.011 | ||||
68 | 'imprecision' => 92, | ||||
69 | 'illegalproto' => 94, | ||||
70 | |||||
71 | # Warnings Categories added in Perl 5.013 | ||||
72 | 'non_unicode' => 96, | ||||
73 | 'nonchar' => 98, | ||||
74 | 'surrogate' => 100, | ||||
75 | |||||
76 | # Warnings Categories added in Perl 5.017 | ||||
77 | 'experimental' => 102, | ||||
78 | 'experimental::lexical_subs' => 104, | ||||
79 | 'experimental::regex_sets' => 106, | ||||
80 | 'experimental::smartmatch' => 108, | ||||
81 | |||||
82 | # Warnings Categories added in Perl 5.019 | ||||
83 | 'experimental::postderef' => 110, | ||||
84 | 'experimental::signatures' => 112, | ||||
85 | 'syscalls' => 114, | ||||
86 | |||||
87 | # Warnings Categories added in Perl 5.021 | ||||
88 | 'experimental::bitwise' => 116, | ||||
89 | 'experimental::const_attr' => 118, | ||||
90 | 'experimental::re_strict' => 120, | ||||
91 | 'experimental::refaliasing' => 122, | ||||
92 | 'experimental::win32_perlio' => 124, | ||||
93 | 'locale' => 126, | ||||
94 | 'missing' => 128, | ||||
95 | 'redundant' => 130, | ||||
96 | ); | ||||
97 | |||||
98 | 1 | 30µs | our %Bits = ( | ||
99 | 'all' => "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x05", # [0..65] | ||||
100 | 'ambiguous' => "\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [29] | ||||
101 | 'bareword' => "\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [30] | ||||
102 | 'closed' => "\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [6] | ||||
103 | 'closure' => "\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [1] | ||||
104 | 'debugging' => "\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [22] | ||||
105 | 'deprecated' => "\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [2] | ||||
106 | 'digit' => "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [31] | ||||
107 | 'exec' => "\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [7] | ||||
108 | 'exiting' => "\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [3] | ||||
109 | 'experimental' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x55\x51\x15\x00", # [51..56,58..62] | ||||
110 | 'experimental::bitwise' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00", # [58] | ||||
111 | 'experimental::const_attr' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00", # [59] | ||||
112 | 'experimental::lexical_subs' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00", # [52] | ||||
113 | 'experimental::postderef' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00", # [55] | ||||
114 | 'experimental::re_strict' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00", # [60] | ||||
115 | 'experimental::refaliasing' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00", # [61] | ||||
116 | 'experimental::regex_sets' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00", # [53] | ||||
117 | 'experimental::signatures' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00", # [56] | ||||
118 | 'experimental::smartmatch' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00", # [54] | ||||
119 | 'experimental::win32_perlio' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00", # [62] | ||||
120 | 'glob' => "\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [4] | ||||
121 | 'illegalproto' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00", # [47] | ||||
122 | 'imprecision' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00", # [46] | ||||
123 | 'inplace' => "\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [23] | ||||
124 | 'internal' => "\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [24] | ||||
125 | 'io' => "\x00\x54\x55\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00", # [5..11,57] | ||||
126 | 'layer' => "\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [8] | ||||
127 | 'locale' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00", # [63] | ||||
128 | 'malloc' => "\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [25] | ||||
129 | 'misc' => "\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [12] | ||||
130 | 'missing' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01", # [64] | ||||
131 | 'newline' => "\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [9] | ||||
132 | 'non_unicode' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00", # [48] | ||||
133 | 'nonchar' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00", # [49] | ||||
134 | 'numeric' => "\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [13] | ||||
135 | 'once' => "\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [14] | ||||
136 | 'overflow' => "\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [15] | ||||
137 | 'pack' => "\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [16] | ||||
138 | 'parenthesis' => "\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00", # [32] | ||||
139 | 'pipe' => "\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [10] | ||||
140 | 'portable' => "\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [17] | ||||
141 | 'precedence' => "\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00", # [33] | ||||
142 | 'printf' => "\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00", # [34] | ||||
143 | 'prototype' => "\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00", # [35] | ||||
144 | 'qw' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00", # [36] | ||||
145 | 'recursion' => "\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [18] | ||||
146 | 'redefine' => "\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [19] | ||||
147 | 'redundant' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04", # [65] | ||||
148 | 'regexp' => "\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [20] | ||||
149 | 'reserved' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00", # [37] | ||||
150 | 'semicolon' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00", # [38] | ||||
151 | 'severe' => "\x00\x00\x00\x00\x00\x54\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [21..25] | ||||
152 | 'signal' => "\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [26] | ||||
153 | 'substr' => "\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [27] | ||||
154 | 'surrogate' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00", # [50] | ||||
155 | 'syntax' => "\x00\x00\x00\x00\x00\x00\x00\x55\x55\x15\x00\x40\x00\x00\x00\x00\x00", # [28..38,47] | ||||
156 | 'syscalls' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00", # [57] | ||||
157 | 'taint' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00", # [39] | ||||
158 | 'threads' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00", # [40] | ||||
159 | 'uninitialized' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00", # [41] | ||||
160 | 'unopened' => "\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [11] | ||||
161 | 'unpack' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00", # [42] | ||||
162 | 'untie' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00", # [43] | ||||
163 | 'utf8' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x15\x00\x00\x00\x00", # [44,48..50] | ||||
164 | 'void' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00", # [45] | ||||
165 | ); | ||||
166 | |||||
167 | 1 | 30µs | our %DeadBits = ( | ||
168 | 'all' => "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\x0a", # [0..65] | ||||
169 | 'ambiguous' => "\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [29] | ||||
170 | 'bareword' => "\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [30] | ||||
171 | 'closed' => "\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [6] | ||||
172 | 'closure' => "\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [1] | ||||
173 | 'debugging' => "\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [22] | ||||
174 | 'deprecated' => "\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [2] | ||||
175 | 'digit' => "\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [31] | ||||
176 | 'exec' => "\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [7] | ||||
177 | 'exiting' => "\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [3] | ||||
178 | 'experimental' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\xaa\xa2\x2a\x00", # [51..56,58..62] | ||||
179 | 'experimental::bitwise' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00", # [58] | ||||
180 | 'experimental::const_attr' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00", # [59] | ||||
181 | 'experimental::lexical_subs' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00", # [52] | ||||
182 | 'experimental::postderef' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00", # [55] | ||||
183 | 'experimental::re_strict' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00", # [60] | ||||
184 | 'experimental::refaliasing' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00", # [61] | ||||
185 | 'experimental::regex_sets' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00", # [53] | ||||
186 | 'experimental::signatures' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00", # [56] | ||||
187 | 'experimental::smartmatch' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00", # [54] | ||||
188 | 'experimental::win32_perlio' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00", # [62] | ||||
189 | 'glob' => "\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [4] | ||||
190 | 'illegalproto' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00", # [47] | ||||
191 | 'imprecision' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00", # [46] | ||||
192 | 'inplace' => "\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [23] | ||||
193 | 'internal' => "\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [24] | ||||
194 | 'io' => "\x00\xa8\xaa\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00", # [5..11,57] | ||||
195 | 'layer' => "\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [8] | ||||
196 | 'locale' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00", # [63] | ||||
197 | 'malloc' => "\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [25] | ||||
198 | 'misc' => "\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [12] | ||||
199 | 'missing' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02", # [64] | ||||
200 | 'newline' => "\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [9] | ||||
201 | 'non_unicode' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00", # [48] | ||||
202 | 'nonchar' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00", # [49] | ||||
203 | 'numeric' => "\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [13] | ||||
204 | 'once' => "\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [14] | ||||
205 | 'overflow' => "\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [15] | ||||
206 | 'pack' => "\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [16] | ||||
207 | 'parenthesis' => "\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00", # [32] | ||||
208 | 'pipe' => "\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [10] | ||||
209 | 'portable' => "\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [17] | ||||
210 | 'precedence' => "\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00", # [33] | ||||
211 | 'printf' => "\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00", # [34] | ||||
212 | 'prototype' => "\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00", # [35] | ||||
213 | 'qw' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00", # [36] | ||||
214 | 'recursion' => "\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [18] | ||||
215 | 'redefine' => "\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [19] | ||||
216 | 'redundant' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08", # [65] | ||||
217 | 'regexp' => "\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [20] | ||||
218 | 'reserved' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00", # [37] | ||||
219 | 'semicolon' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00", # [38] | ||||
220 | 'severe' => "\x00\x00\x00\x00\x00\xa8\x0a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [21..25] | ||||
221 | 'signal' => "\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [26] | ||||
222 | 'substr' => "\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [27] | ||||
223 | 'surrogate' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00", # [50] | ||||
224 | 'syntax' => "\x00\x00\x00\x00\x00\x00\x00\xaa\xaa\x2a\x00\x80\x00\x00\x00\x00\x00", # [28..38,47] | ||||
225 | 'syscalls' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00", # [57] | ||||
226 | 'taint' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00", # [39] | ||||
227 | 'threads' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00", # [40] | ||||
228 | 'uninitialized' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00", # [41] | ||||
229 | 'unopened' => "\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [11] | ||||
230 | 'unpack' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00", # [42] | ||||
231 | 'untie' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00", # [43] | ||||
232 | 'utf8' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x2a\x00\x00\x00\x00", # [44,48..50] | ||||
233 | 'void' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00", # [45] | ||||
234 | ); | ||||
235 | |||||
236 | # These are used by various things, including our own tests | ||||
237 | 1 | 2µs | our $NONE = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; | ||
238 | 1 | 2µs | our $DEFAULT = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x00\x55\x51\x55\x00", # [2,58,59,52,55,60,61,53,56,54,62,4,63,22,23,25] | ||
239 | our $LAST_BIT = 132 ; | ||||
240 | 1 | 2µs | our $BYTES = 17 ; | ||
241 | |||||
242 | 2 | 17µs | our $All = "" ; vec($All, $Offsets{'all'}, 2) = 3 ; | ||
243 | |||||
244 | sub Croaker | ||||
245 | { | ||||
246 | require Carp; # this initializes %CarpInternal | ||||
247 | local $Carp::CarpInternal{'warnings'}; | ||||
248 | delete $Carp::CarpInternal{'warnings'}; | ||||
249 | Carp::croak(@_); | ||||
250 | } | ||||
251 | |||||
252 | sub _bits { | ||||
253 | my $mask = shift ; | ||||
254 | my $catmask ; | ||||
255 | my $fatal = 0 ; | ||||
256 | my $no_fatal = 0 ; | ||||
257 | |||||
258 | foreach my $word ( @_ ) { | ||||
259 | if ($word eq 'FATAL') { | ||||
260 | $fatal = 1; | ||||
261 | $no_fatal = 0; | ||||
262 | } | ||||
263 | elsif ($word eq 'NONFATAL') { | ||||
264 | $fatal = 0; | ||||
265 | $no_fatal = 1; | ||||
266 | } | ||||
267 | elsif ($catmask = $Bits{$word}) { | ||||
268 | $mask |= $catmask ; | ||||
269 | $mask |= $DeadBits{$word} if $fatal ; | ||||
270 | $mask &= ~($DeadBits{$word}|$All) if $no_fatal ; | ||||
271 | } | ||||
272 | else | ||||
273 | { Croaker("Unknown warnings category '$word'")} | ||||
274 | } | ||||
275 | |||||
276 | return $mask ; | ||||
277 | } | ||||
278 | |||||
279 | sub bits | ||||
280 | { | ||||
281 | # called from B::Deparse.pm | ||||
282 | push @_, 'all' unless @_ ; | ||||
283 | return _bits(undef, @_) ; | ||||
284 | } | ||||
285 | |||||
286 | sub import | ||||
287 | # spent 3.47ms within warnings::import which was called 116 times, avg 30µs/call:
# once (44µs+0s) by Mail::SpamAssassin::PerMsgLearner::BEGIN@50 at line 50 of Mail/SpamAssassin/PerMsgLearner.pm
# once (44µs+0s) by Mail::SpamAssassin::Plugin::SpamCop::BEGIN@48 at line 48 of Mail/SpamAssassin/Plugin/SpamCop.pm
# once (43µs+0s) by Net::Cmd::BEGIN@16 at line 16 of Net/Cmd.pm
# once (43µs+0s) by Mail::SpamAssassin::Message::Metadata::BEGIN@52 at line 52 of Mail/SpamAssassin/Message/Metadata.pm
# once (43µs+0s) by Mail::SpamAssassin::Message::BEGIN@46 at line 46 of Mail/SpamAssassin/Message.pm
# once (42µs+0s) by Mail::SpamAssassin::BayesStore::DBM::BEGIN@21 at line 21 of Mail/SpamAssassin/BayesStore/DBM.pm
# once (42µs+0s) by overloading::BEGIN@2 at line 2 of overloading.pm
# once (42µs+0s) by IO::Socket::SSL::BEGIN@3 at line 3 of IO/Socket/SSL/PublicSuffix.pm
# once (41µs+0s) by Mail::SpamAssassin::Plugin::TxRep::BEGIN@203 at line 203 of Mail/SpamAssassin/Plugin/TxRep.pm
# once (40µs+0s) by Net::DNS::RR::A::BEGIN@10 at line 10 of Net/DNS/RR/A.pm
# once (40µs+0s) by Mail::SpamAssassin::Plugin::AskDNS::BEGIN@188 at line 188 of Mail/SpamAssassin/Plugin/AskDNS.pm
# once (40µs+0s) by Mail::SpamAssassin::Plugin::HTTPSMismatch::BEGIN@23 at line 23 of Mail/SpamAssassin/Plugin/HTTPSMismatch.pm
# once (40µs+0s) by Mail::SpamAssassin::Plugin::Hashcash::BEGIN@87 at line 87 of Mail/SpamAssassin/Plugin/Hashcash.pm
# once (40µs+0s) by Net::DNS::RR::OPT::BEGIN@10 at line 10 of Net/DNS/RR/OPT.pm
# once (40µs+0s) by Mail::SpamAssassin::Plugin::MIMEEval::BEGIN@21 at line 21 of Mail/SpamAssassin/Plugin/MIMEEval.pm
# once (40µs+0s) by Mail::SpamAssassin::Conf::Parser::BEGIN@144 at line 144 of Mail/SpamAssassin/Conf/Parser.pm
# once (40µs+0s) by Mail::SpamAssassin::Plugin::SPF::BEGIN@40 at line 40 of Mail/SpamAssassin/Plugin/SPF.pm
# once (39µs+0s) by File::Copy::BEGIN@12 at line 12 of File/Copy.pm
# once (39µs+0s) by Mail::SpamAssassin::Plugin::Check::BEGIN@18 at line 18 of Mail/SpamAssassin/Plugin/Check.pm
# once (39µs+0s) by Mail::SpamAssassin::Conf::SQL::BEGIN@47 at line 47 of Mail/SpamAssassin/Conf/SQL.pm
# once (39µs+0s) by Encode::Detect::Detector::BEGIN@40 at line 40 of Encode/Detect/Detector.pm
# once (39µs+0s) by Encode::Config::BEGIN@8 at line 8 of Encode/Config.pm
# once (38µs+0s) by Mail::SpamAssassin::Constants::BEGIN@25 at line 25 of Mail/SpamAssassin/Constants.pm
# once (38µs+0s) by Mail::SpamAssassin::ArchiveIterator::BEGIN@23 at line 23 of Mail/SpamAssassin/ArchiveIterator.pm
# once (38µs+0s) by Mail::SpamAssassin::Plugin::AutoLearnThreshold::BEGIN@57 at line 57 of Mail/SpamAssassin/Plugin/AutoLearnThreshold.pm
# once (38µs+0s) by File::Basename::BEGIN@52 at line 52 of File/Basename.pm
# once (38µs+0s) by Mail::SpamAssassin::BEGIN@63 at line 63 of Mail/SpamAssassin.pm
# once (38µs+0s) by Mail::SpamAssassin::DBBasedAddrList::BEGIN@21 at line 21 of Mail/SpamAssassin/DBBasedAddrList.pm
# once (37µs+0s) by Mail::SpamAssassin::Plugin::Razor2::BEGIN@47 at line 47 of Mail/SpamAssassin/Plugin/Razor2.pm
# once (37µs+0s) by Mail::SpamAssassin::Plugin::RelayEval::BEGIN@25 at line 25 of Mail/SpamAssassin/Plugin/RelayEval.pm
# once (37µs+0s) by Net::DNS::Update::BEGIN@33 at line 33 of Net/DNS/Update.pm
# once (37µs+0s) by Mail::SpamAssassin::Plugin::URIDNSBL::BEGIN@300 at line 300 of Mail/SpamAssassin/Plugin/URIDNSBL.pm
# once (37µs+0s) by Mail::SpamAssassin::Plugin::BEGIN@101 at line 101 of Mail/SpamAssassin/Plugin.pm
# once (37µs+0s) by Mail::SpamAssassin::PersistentAddrList::BEGIN@50 at line 50 of Mail/SpamAssassin/PersistentAddrList.pm
# once (36µs+0s) by Pod::Text::BEGIN@28 at line 28 of Pod/Text.pm
# once (36µs+0s) by Sys::Syslog::BEGIN@3 at line 3 of Sys/Syslog.pm
# once (36µs+0s) by Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@21 at line 21 of Mail/SpamAssassin/Locker/UnixNFSSafe.pm
# once (34µs+0s) by Net::Config::BEGIN@16 at line 16 of Net/Config.pm
# once (34µs+0s) by Mail::SpamAssassin::Message::Node::BEGIN@38 at line 38 of Mail/SpamAssassin/Message/Node.pm
# once (34µs+0s) by Pod::Escapes::BEGIN@3 at line 3 of Pod/Escapes.pm
# once (33µs+0s) by main::BEGIN@20 at line 20 of /usr/local/bin/sa-learn
# once (33µs+0s) by URI::Escape::BEGIN@4 at line 4 of URI/Escape.pm
# once (32µs+0s) by IO::Socket::INET6::BEGIN@13 at line 13 of IO/Socket/INET6.pm
# once (32µs+0s) by Mail::SpamAssassin::NetSet::BEGIN@22 at line 22 of Mail/SpamAssassin/NetSet.pm
# once (32µs+0s) by Mail::SpamAssassin::Util::TieOneStringHash::BEGIN@23 at line 23 of Mail/SpamAssassin/Util/TieOneStringHash.pm
# once (30µs+0s) by Mail::SpamAssassin::Plugin::VBounce::BEGIN@33 at line 33 of Mail/SpamAssassin/Plugin/VBounce.pm
# once (30µs+0s) by Mail::SpamAssassin::Plugin::ReplaceTags::BEGIN@57 at line 57 of Mail/SpamAssassin/Plugin/ReplaceTags.pm
# once (30µs+0s) by Net::DNS::DomainName::BEGIN@42 at line 42 of Net/DNS/DomainName.pm
# once (30µs+0s) by Mail::SpamAssassin::RegistryBoundaries::BEGIN@29 at line 29 of Mail/SpamAssassin/RegistryBoundaries.pm
# once (30µs+0s) by Encode::Encoding::BEGIN@5 at line 5 of Encode/Encoding.pm
# once (30µs+0s) by Net::DNS::Domain::BEGIN@39 at line 39 of Net/DNS/Domain.pm
# once (30µs+0s) by Net::DNS::BEGIN@35 at line 35 of Net/DNS.pm
# once (30µs+0s) by Mail::SpamAssassin::Plugin::FreeMail::BEGIN@3 at line 3 of Mail/SpamAssassin/Plugin/FreeMail.pm
# once (29µs+0s) by Carp::BEGIN@5 at line 5 of Carp.pm
# once (29µs+0s) by Net::DNS::Resolver::Base::BEGIN@50 at line 50 of Net/DNS/Resolver/Base.pm
# once (28µs+0s) by Mail::SpamAssassin::Plugin::URIEval::BEGIN@24 at line 24 of Mail/SpamAssassin/Plugin/URIEval.pm
# once (28µs+0s) by Mail::SpamAssassin::BayesStore::BEGIN@32 at line 32 of Mail/SpamAssassin/BayesStore.pm
# once (28µs+0s) by Mail::SpamAssassin::Util::Progress::BEGIN@46 at line 46 of Mail/SpamAssassin/Util/Progress.pm
# once (28µs+0s) by Mail::SpamAssassin::Plugin::DNSEval::BEGIN@33 at line 33 of Mail/SpamAssassin/Plugin/DNSEval.pm
# once (28µs+0s) by Mail::SpamAssassin::Plugin::BodyEval::BEGIN@25 at line 25 of Mail/SpamAssassin/Plugin/BodyEval.pm
# once (27µs+0s) by DB_File::HASHINFO::BEGIN@14 at line 14 of DB_File.pm
# once (27µs+0s) by Mail::SpamAssassin::Plugin::DKIM::BEGIN@127 at line 127 of Mail/SpamAssassin/Plugin/DKIM.pm
# once (27µs+0s) by Net::DNS::Packet::BEGIN@30 at line 30 of Net/DNS/Packet.pm
# once (27µs+0s) by Mail::SpamAssassin::DnsResolver::BEGIN@39 at line 39 of Mail/SpamAssassin/DnsResolver.pm
# once (27µs+0s) by Mail::SpamAssassin::Plugin::HeaderEval::BEGIN@21 at line 21 of Mail/SpamAssassin/Plugin/HeaderEval.pm
# once (27µs+0s) by Mail::SpamAssassin::Plugin::HTMLEval::BEGIN@21 at line 21 of Mail/SpamAssassin/Plugin/HTMLEval.pm
# once (26µs+0s) by Net::LibIDN2::BEGIN@7 at line 7 of Net/LibIDN2.pm
# once (26µs+0s) by Net::DNS::RR::BEGIN@35 at line 35 of Net/DNS/RR.pm
# once (25µs+0s) by Net::DNS::RR::AAAA::BEGIN@10 at line 10 of Net/DNS/RR/AAAA.pm
# once (25µs+0s) by Mail::SpamAssassin::Timeout::BEGIN@57 at line 57 of Mail/SpamAssassin/Timeout.pm
# once (25µs+0s) by Config::BEGIN@6 at line 6 of Config_heavy.pl
# once (25µs+0s) by Mail::SpamAssassin::Util::ScopedTimer::BEGIN@23 at line 23 of Mail/SpamAssassin/Util/ScopedTimer.pm
# once (25µs+0s) by Mail::SpamAssassin::Plugin::MIMEHeader::BEGIN@61 at line 61 of Mail/SpamAssassin/Plugin/MIMEHeader.pm
# once (25µs+0s) by Mail::SpamAssassin::Conf::BEGIN@81 at line 81 of Mail/SpamAssassin/Conf.pm
# once (25µs+0s) by Mail::SpamAssassin::Plugin::URIDetail::BEGIN@74 at line 74 of Mail/SpamAssassin/Plugin/URIDetail.pm
# once (25µs+0s) by Mail::SpamAssassin::Plugin::WhiteListSubject::BEGIN@48 at line 48 of Mail/SpamAssassin/Plugin/WhiteListSubject.pm
# once (25µs+0s) by Mail::SpamAssassin::Plugin::ImageInfo::BEGIN@86 at line 86 of Mail/SpamAssassin/Plugin/ImageInfo.pm
# once (24µs+0s) by Mail::SpamAssassin::Plugin::Bayes::BEGIN@47 at line 47 of Mail/SpamAssassin/Plugin/Bayes.pm
# once (24µs+0s) by URI::_idna::BEGIN@7 at line 7 of URI/_idna.pm
# once (24µs+0s) by Net::DNS::Resolver::BEGIN@16 at line 16 of Net/DNS/Resolver.pm
# once (24µs+0s) by Mail::SpamAssassin::Plugin::WLBLEval::BEGIN@24 at line 24 of Mail/SpamAssassin/Plugin/WLBLEval.pm
# once (24µs+0s) by DB_File::RECNOINFO::BEGIN@115 at line 115 of DB_File.pm
# once (24µs+0s) by IO::BEGIN@8 at line 8 of IO.pm
# once (24µs+0s) by Net::SMTP::BEGIN@16 at line 16 of Net/SMTP.pm
# once (24µs+0s) by Net::DNS::Question::BEGIN@28 at line 28 of Net/DNS/Question.pm
# once (24µs+0s) by IO::Socket::IP::BEGIN@14 at line 14 of IO/Socket/IP.pm
# once (24µs+0s) by Mail::SpamAssassin::Logger::Stderr::BEGIN@33 at line 33 of Mail/SpamAssassin/Logger/Stderr.pm
# once (23µs+0s) by Net::DNS::Header::BEGIN@29 at line 29 of Net/DNS/Header.pm
# once (23µs+0s) by Config::BEGIN@10 at line 10 of Config.pm
# once (23µs+0s) by Mail::SpamAssassin::Logger::BEGIN@39 at line 39 of Mail/SpamAssassin/Logger.pm
# once (23µs+0s) by Mail::SpamAssassin::PluginHandler::BEGIN@32 at line 32 of Mail/SpamAssassin/PluginHandler.pm
# once (23µs+0s) by Mail::SpamAssassin::Conf::LDAP::BEGIN@47 at line 47 of Mail/SpamAssassin/Conf/LDAP.pm
# once (23µs+0s) by Mail::SpamAssassin::PerMsgStatus::BEGIN@53 at line 53 of Mail/SpamAssassin/PerMsgStatus.pm
# once (23µs+0s) by Net::LibIDN::BEGIN@5 at line 5 of Net/LibIDN.pm
# once (23µs+0s) by Mail::SpamAssassin::AsyncLoop::BEGIN@37 at line 37 of Mail/SpamAssassin/AsyncLoop.pm
# once (23µs+0s) by Encode::Alias::BEGIN@3 at line 3 of Encode/Alias.pm
# once (23µs+0s) by Mail::SpamAssassin::AICache::BEGIN@44 at line 44 of Mail/SpamAssassin/AICache.pm
# once (23µs+0s) by Digest::SHA::BEGIN@6 at line 6 of Digest/SHA.pm
# once (23µs+0s) by Mail::SpamAssassin::HTML::BEGIN@24 at line 24 of Mail/SpamAssassin/HTML.pm
# once (23µs+0s) by Net::DNS::Parameters::BEGIN@18 at line 18 of Net/DNS/Parameters.pm
# once (22µs+0s) by Net::Patricia::BEGIN@27 at line 27 of Net/Patricia.pm
# once (22µs+0s) by Mail::SpamAssassin::Bayes::Combine::BEGIN@32 at line 32 of Mail/SpamAssassin/Bayes/CombineChi.pm
# once (22µs+0s) by Net::DNS::Resolver::UNIX::BEGIN@17 at line 17 of Net/DNS/Resolver/UNIX.pm
# once (22µs+0s) by Mail::SpamAssassin::Message::Metadata::BEGIN@45 at line 45 of Mail/SpamAssassin/Message/Metadata/Received.pm
# once (22µs+0s) by Term::ReadKey::BEGIN@8 at line 8 of Term/ReadKey.pm
# once (22µs+0s) by URI::_punycode::BEGIN@4 at line 4 of URI/_punycode.pm
# once (21µs+0s) by DB_File::BTREEINFO::BEGIN@133 at line 133 of DB_File.pm
# once (21µs+0s) by Mail::SpamAssassin::Util::BEGIN@44 at line 44 of Mail/SpamAssassin/Util.pm
# once (21µs+0s) by Encode::BEGIN@6 at line 6 of Encode.pm
# once (21µs+0s) by POSIX::BEGIN@3 at line 3 of POSIX.pm
# once (21µs+0s) by Mail::SpamAssassin::Locales::BEGIN@21 at line 21 of Mail/SpamAssassin/Locales.pm
# once (21µs+0s) by Mail::SpamAssassin::Locker::BEGIN@21 at line 21 of Mail/SpamAssassin/Locker.pm
# once (21µs+0s) by Mail::SpamAssassin::Bayes::BEGIN@36 at line 36 of Mail/SpamAssassin/Bayes.pm
# once (20µs+0s) by Mail::SpamAssassin::PerMsgStatus::BEGIN@24 at line 24 of Mail/SpamAssassin/Dns.pm
# once (20µs+0s) by DB_File::BEGIN@159 at line 159 of DB_File.pm
# once (20µs+0s) by re::BEGIN@5 at line 5 of re.pm | ||||
288 | 116 | 195µs | shift; | ||
289 | |||||
290 | 116 | 707µs | my $mask = ${^WARNING_BITS} // ($^W ? $Bits{all} : $DEFAULT) ; | ||
291 | |||||
292 | 116 | 681µs | if (vec($mask, $Offsets{'all'}, 1)) { | ||
293 | 116 | 419µs | $mask |= $Bits{'all'} ; | ||
294 | 116 | 342µs | $mask |= $DeadBits{'all'} if vec($mask, $Offsets{'all'}+1, 1); | ||
295 | } | ||||
296 | |||||
297 | # append 'all' when implied (after a lone "FATAL" or "NONFATAL") | ||||
298 | 116 | 254µs | push @_, 'all' if @_==1 && ( $_[0] eq 'FATAL' || $_[0] eq 'NONFATAL' ); | ||
299 | |||||
300 | # Empty @_ is equivalent to @_ = 'all' ; | ||||
301 | 116 | 1.52ms | ${^WARNING_BITS} = @_ ? _bits($mask, @_) : $mask | $Bits{all} ; | ||
302 | } | ||||
303 | |||||
304 | sub unimport | ||||
305 | # spent 1.01ms within warnings::unimport which was called 17 times, avg 59µs/call:
# once (82µs+0s) by Net::SMTP::BEGIN@30 at line 30 of Net/SMTP.pm
# once (76µs+0s) by IO::Socket::SSL::BEGIN@1891 at line 1891 of IO/Socket/SSL.pm
# once (75µs+0s) by Net::SMTP::BEGIN@41 at line 41 of Net/SMTP.pm
# once (71µs+0s) by Mail::SpamAssassin::Plugin::Bayes::BEGIN@1509 at line 1509 of Mail/SpamAssassin/Plugin/Bayes.pm
# once (68µs+0s) by IO::Socket::SSL::BEGIN@231 at line 231 of IO/Socket/SSL.pm
# once (65µs+0s) by File::Glob::BEGIN@54 at line 54 of File/Glob.pm
# once (64µs+0s) by Encode::BEGIN@268 at line 268 of Encode.pm
# once (62µs+0s) by Exporter::Heavy::BEGIN@202 at line 202 of Exporter/Heavy.pm
# once (62µs+0s) by NetAddr::IP::InetBase::BEGIN@71 at line 71 of NetAddr/IP/InetBase.pm
# once (60µs+0s) by Mail::SpamAssassin::Util::BEGIN@1 at line 1 of (eval 31)[Mail/SpamAssassin/Util.pm:194]
# once (57µs+0s) by Mail::SpamAssassin::PerMsgStatus::BEGIN@86 at line 86 of Mail/SpamAssassin/Dns.pm
# once (53µs+0s) by File::Copy::BEGIN@12.3 at line 12 of File/Copy.pm
# once (53µs+0s) by Encode::Alias::BEGIN@4 at line 4 of Encode/Alias.pm
# once (43µs+0s) by Carp::BEGIN@605 at line 605 of Carp.pm
# once (42µs+0s) by IO::Socket::SSL::BEGIN@2051 at line 2051 of IO/Socket/SSL.pm
# once (40µs+0s) by Carp::BEGIN@6 at line 24 of Carp.pm
# once (34µs+0s) by Net::SMTP::BEGIN@46 at line 46 of Net/SMTP.pm | ||||
306 | 17 | 38µs | shift; | ||
307 | |||||
308 | 17 | 34µs | my $catmask ; | ||
309 | 17 | 139µs | my $mask = ${^WARNING_BITS} // ($^W ? $Bits{all} : $DEFAULT) ; | ||
310 | |||||
311 | 17 | 116µs | if (vec($mask, $Offsets{'all'}, 1)) { | ||
312 | 16 | 70µs | $mask |= $Bits{'all'} ; | ||
313 | 16 | 57µs | $mask |= $DeadBits{'all'} if vec($mask, $Offsets{'all'}+1, 1); | ||
314 | } | ||||
315 | |||||
316 | # append 'all' when implied (empty import list or after a lone "FATAL") | ||||
317 | 17 | 78µs | push @_, 'all' if !@_ || @_==1 && $_[0] eq 'FATAL'; | ||
318 | |||||
319 | 17 | 76µs | foreach my $word ( @_ ) { | ||
320 | 17 | 129µs | if ($word eq 'FATAL') { | ||
321 | next; | ||||
322 | } | ||||
323 | elsif ($catmask = $Bits{$word}) { | ||||
324 | 17 | 127µs | $mask &= ~($catmask | $DeadBits{$word} | $All); | ||
325 | } | ||||
326 | else | ||||
327 | { Croaker("Unknown warnings category '$word'")} | ||||
328 | } | ||||
329 | |||||
330 | 17 | 270µs | ${^WARNING_BITS} = $mask ; | ||
331 | } | ||||
332 | |||||
333 | 2 | 7µs | my %builtin_type; @builtin_type{qw(SCALAR ARRAY HASH CODE REF GLOB LVALUE Regexp)} = (); | ||
334 | |||||
335 | sub MESSAGE () { 4 }; | ||||
336 | sub FATAL () { 2 }; | ||||
337 | sub NORMAL () { 1 }; | ||||
338 | |||||
339 | sub __chk | ||||
340 | { | ||||
341 | my $category ; | ||||
342 | my $offset ; | ||||
343 | my $isobj = 0 ; | ||||
344 | my $wanted = shift; | ||||
345 | my $has_message = $wanted & MESSAGE; | ||||
346 | |||||
347 | unless (@_ == 1 || @_ == ($has_message ? 2 : 0)) { | ||||
348 | my $sub = (caller 1)[3]; | ||||
349 | my $syntax = $has_message ? "[category,] 'message'" : '[category]'; | ||||
350 | Croaker("Usage: $sub($syntax)"); | ||||
351 | } | ||||
352 | |||||
353 | my $message = pop if $has_message; | ||||
354 | |||||
355 | if (@_) { | ||||
356 | # check the category supplied. | ||||
357 | $category = shift ; | ||||
358 | if (my $type = ref $category) { | ||||
359 | Croaker("not an object") | ||||
360 | if exists $builtin_type{$type}; | ||||
361 | $category = $type; | ||||
362 | $isobj = 1 ; | ||||
363 | } | ||||
364 | $offset = $Offsets{$category}; | ||||
365 | Croaker("Unknown warnings category '$category'") | ||||
366 | unless defined $offset; | ||||
367 | } | ||||
368 | else { | ||||
369 | $category = (caller(1))[0] ; | ||||
370 | $offset = $Offsets{$category}; | ||||
371 | Croaker("package '$category' not registered for warnings") | ||||
372 | unless defined $offset ; | ||||
373 | } | ||||
374 | |||||
375 | my $i; | ||||
376 | |||||
377 | if ($isobj) { | ||||
378 | my $pkg; | ||||
379 | $i = 2; | ||||
380 | while (do { { package DB; $pkg = (caller($i++))[0] } } ) { | ||||
381 | last unless @DB::args && $DB::args[0] =~ /^$category=/ ; | ||||
382 | } | ||||
383 | $i -= 2 ; | ||||
384 | } | ||||
385 | else { | ||||
386 | $i = _error_loc(); # see where Carp will allocate the error | ||||
387 | } | ||||
388 | |||||
389 | # Default to 0 if caller returns nothing. Default to $DEFAULT if it | ||||
390 | # explicitly returns undef. | ||||
391 | my(@callers_bitmask) = (caller($i))[9] ; | ||||
392 | my $callers_bitmask = | ||||
393 | @callers_bitmask ? $callers_bitmask[0] // $DEFAULT : 0 ; | ||||
394 | |||||
395 | my @results; | ||||
396 | foreach my $type (FATAL, NORMAL) { | ||||
397 | next unless $wanted & $type; | ||||
398 | |||||
399 | push @results, (vec($callers_bitmask, $offset + $type - 1, 1) || | ||||
400 | vec($callers_bitmask, $Offsets{'all'} + $type - 1, 1)); | ||||
401 | } | ||||
402 | |||||
403 | # &enabled and &fatal_enabled | ||||
404 | return $results[0] unless $has_message; | ||||
405 | |||||
406 | # &warnif, and the category is neither enabled as warning nor as fatal | ||||
407 | return if $wanted == (NORMAL | FATAL | MESSAGE) | ||||
408 | && !($results[0] || $results[1]); | ||||
409 | |||||
410 | require Carp; | ||||
411 | Carp::croak($message) if $results[0]; | ||||
412 | # will always get here for &warn. will only get here for &warnif if the | ||||
413 | # category is enabled | ||||
414 | Carp::carp($message); | ||||
415 | } | ||||
416 | |||||
417 | sub _mkMask | ||||
418 | { | ||||
419 | 16 | 32µs | my ($bit) = @_; | ||
420 | 16 | 39µs | my $mask = ""; | ||
421 | |||||
422 | 16 | 97µs | vec($mask, $bit, 1) = 1; | ||
423 | 16 | 147µs | return $mask; | ||
424 | } | ||||
425 | |||||
426 | sub register_categories | ||||
427 | # spent 3.59ms (3.32+264µs) within warnings::register_categories which was called 9 times, avg 399µs/call:
# 8 times (3.31ms+264µs) by warnings::register::import at line 23 of warnings/register.pm, avg 447µs/call
# once (14µs+0s) by Net::Patricia::BEGIN@31 at line 8 of version.pm | ||||
428 | 9 | 32µs | my @names = @_; | ||
429 | |||||
430 | 9 | 101µs | for my $name (@names) { | ||
431 | 9 | 58µs | if (! defined $Bits{$name}) { | ||
432 | 8 | 67µs | 8 | 149µs | $Bits{$name} = _mkMask($LAST_BIT); # spent 149µs making 8 calls to warnings::_mkMask, avg 19µs/call |
433 | 8 | 35µs | vec($Bits{'all'}, $LAST_BIT, 1) = 1; | ||
434 | 8 | 26µs | $Offsets{$name} = $LAST_BIT ++; | ||
435 | 8 | 251µs | foreach my $k (keys %Bits) { | ||
436 | 564 | 2.61ms | vec($Bits{$k}, $LAST_BIT, 1) = 0; | ||
437 | } | ||||
438 | 8 | 68µs | 8 | 116µs | $DeadBits{$name} = _mkMask($LAST_BIT); # spent 116µs making 8 calls to warnings::_mkMask, avg 14µs/call |
439 | 8 | 37µs | vec($DeadBits{'all'}, $LAST_BIT++, 1) = 1; | ||
440 | } | ||||
441 | } | ||||
442 | } | ||||
443 | |||||
444 | sub _error_loc { | ||||
445 | require Carp; | ||||
446 | goto &Carp::short_error_loc; # don't introduce another stack frame | ||||
447 | } | ||||
448 | |||||
449 | sub enabled | ||||
450 | { | ||||
451 | return __chk(NORMAL, @_); | ||||
452 | } | ||||
453 | |||||
454 | sub fatal_enabled | ||||
455 | { | ||||
456 | return __chk(FATAL, @_); | ||||
457 | } | ||||
458 | |||||
459 | sub warn | ||||
460 | { | ||||
461 | return __chk(FATAL | MESSAGE, @_); | ||||
462 | } | ||||
463 | |||||
464 | sub warnif | ||||
465 | { | ||||
466 | return __chk(NORMAL | FATAL | MESSAGE, @_); | ||||
467 | } | ||||
468 | |||||
469 | # These are not part of any public interface, so we can delete them to save | ||||
470 | # space. | ||||
471 | 1 | 11µs | delete @warnings::{qw(NORMAL FATAL MESSAGE)}; | ||
472 | |||||
473 | 1 | 92µs | 1; | ||
474 | __END__ | ||||
# spent 11µs within warnings::CORE:match which was called:
# once (11µs+0s) by main::BEGIN@20 at line 14 |