← Index
NYTProf Performance Profile   « line view »
For /usr/local/bin/sa-learn
  Run on Tue Nov 7 05:38:10 2017
Reported on Tue Nov 7 06:15:59 2017

Filename/usr/local/lib/perl5/5.24/warnings.pm
StatementsExecuted 1714 statements in 11.4ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
9224.98ms5.28mswarnings::::register_categorieswarnings::register_categories
1161161133.90ms3.90mswarnings::::importwarnings::import
1717121.01ms1.01mswarnings::::unimportwarnings::unimport
1621295µs295µswarnings::::_mkMaskwarnings::_mkMask
11111µs11µswarnings::::CORE:matchwarnings::CORE:match (opcode)
0000s0swarnings::::Croakerwarnings::Croaker
0000s0swarnings::::__chkwarnings::__chk
0000s0swarnings::::_bitswarnings::_bits
0000s0swarnings::::_error_locwarnings::_error_loc
0000s0swarnings::::bitswarnings::bits
0000s0swarnings::::enabledwarnings::enabled
0000s0swarnings::::fatal_enabledwarnings::fatal_enabled
0000s0swarnings::::warnwarnings::warn
0000s0swarnings::::warnifwarnings::warnif
Call graph for these subroutines as a Graphviz dot language file.
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
6package warnings;
7
812µsour $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.
14126µs111µsdie 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
18146µsour %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
98148µsour %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
167146µsour %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
23712µsour $NONE = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
23812µsour $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]
239our $LAST_BIT = 132 ;
24012µsour $BYTES = 17 ;
241
242226µsour $All = "" ; vec($All, $Offsets{'all'}, 2) = 3 ;
243
244sub Croaker
245{
246 require Carp; # this initializes %CarpInternal
247 local $Carp::CarpInternal{'warnings'};
248 delete $Carp::CarpInternal{'warnings'};
249 Carp::croak(@_);
250}
251
252sub _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
279sub bits
280{
281 # called from B::Deparse.pm
282 push @_, 'all' unless @_ ;
283 return _bits(undef, @_) ;
284}
285
286sub import
287
# spent 3.90ms within warnings::import which was called 116 times, avg 34µs/call: # once (51µs+0s) by main::BEGIN@20 at line 20 of /usr/local/bin/sa-learn # once (49µs+0s) by Mail::SpamAssassin::Plugin::MIMEEval::BEGIN@21 at line 21 of Mail/SpamAssassin/Plugin/MIMEEval.pm # once (47µs+0s) by Config::BEGIN@6 at line 6 of Config_heavy.pl # once (45µs+0s) by Mail::SpamAssassin::Plugin::DKIM::BEGIN@127 at line 127 of Mail/SpamAssassin/Plugin/DKIM.pm # once (44µs+0s) by Net::DNS::Resolver::BEGIN@16 at line 16 of Net/DNS/Resolver.pm # once (44µs+0s) by File::Basename::BEGIN@52 at line 52 of File/Basename.pm # once (44µs+0s) by Mail::SpamAssassin::AICache::BEGIN@44 at line 44 of Mail/SpamAssassin/AICache.pm # once (43µs+0s) by Mail::SpamAssassin::Message::BEGIN@46 at line 46 of Mail/SpamAssassin/Message.pm # once (43µs+0s) by overloading::BEGIN@2 at line 2 of overloading.pm # once (42µs+0s) by Net::DNS::Parameters::BEGIN@18 at line 18 of Net/DNS/Parameters.pm # once (42µs+0s) by IO::BEGIN@8 at line 8 of IO.pm # once (42µs+0s) by Encode::Detect::Detector::BEGIN@40 at line 40 of Encode/Detect/Detector.pm # once (42µs+0s) by Mail::SpamAssassin::Plugin::HeaderEval::BEGIN@21 at line 21 of Mail/SpamAssassin/Plugin/HeaderEval.pm # once (42µs+0s) by Mail::SpamAssassin::BayesStore::DBM::BEGIN@21 at line 21 of Mail/SpamAssassin/BayesStore/DBM.pm # once (41µs+0s) by Mail::SpamAssassin::Plugin::ReplaceTags::BEGIN@57 at line 57 of Mail/SpamAssassin/Plugin/ReplaceTags.pm # once (41µ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::Logger::BEGIN@39 at line 39 of Mail/SpamAssassin/Logger.pm # once (40µs+0s) by re::BEGIN@5 at line 5 of re.pm # once (40µs+0s) by Mail::SpamAssassin::DBBasedAddrList::BEGIN@21 at line 21 of Mail/SpamAssassin/DBBasedAddrList.pm # once (39µs+0s) by Net::SMTP::BEGIN@16 at line 16 of Net/SMTP.pm # once (39µs+0s) by Mail::SpamAssassin::ArchiveIterator::BEGIN@23 at line 23 of Mail/SpamAssassin/ArchiveIterator.pm # once (39µs+0s) by Mail::SpamAssassin::Util::Progress::BEGIN@46 at line 46 of Mail/SpamAssassin/Util/Progress.pm # once (39µs+0s) by URI::Escape::BEGIN@4 at line 4 of URI/Escape.pm # once (39µs+0s) by Mail::SpamAssassin::Constants::BEGIN@25 at line 25 of Mail/SpamAssassin/Constants.pm # once (39µs+0s) by Mail::SpamAssassin::RegistryBoundaries::BEGIN@29 at line 29 of Mail/SpamAssassin/RegistryBoundaries.pm # once (38µs+0s) by Mail::SpamAssassin::AsyncLoop::BEGIN@37 at line 37 of Mail/SpamAssassin/AsyncLoop.pm # once (38µs+0s) by File::Copy::BEGIN@12 at line 12 of File/Copy.pm # once (38µs+0s) by Mail::SpamAssassin::Plugin::WhiteListSubject::BEGIN@48 at line 48 of Mail/SpamAssassin/Plugin/WhiteListSubject.pm # once (38µs+0s) by Mail::SpamAssassin::Plugin::BodyEval::BEGIN@25 at line 25 of Mail/SpamAssassin/Plugin/BodyEval.pm # once (38µs+0s) by Mail::SpamAssassin::Plugin::BEGIN@101 at line 101 of Mail/SpamAssassin/Plugin.pm # once (38µs+0s) by Mail::SpamAssassin::Conf::SQL::BEGIN@47 at line 47 of Mail/SpamAssassin/Conf/SQL.pm # once (38µs+0s) by IO::Socket::SSL::BEGIN@3 at line 3 of IO/Socket/SSL/PublicSuffix.pm # once (38µs+0s) by Mail::SpamAssassin::BEGIN@63 at line 63 of Mail/SpamAssassin.pm # once (37µs+0s) by Net::DNS::RR::BEGIN@35 at line 35 of Net/DNS/RR.pm # once (37µs+0s) by URI::_idna::BEGIN@7 at line 7 of URI/_idna.pm # once (37µs+0s) by Mail::SpamAssassin::Plugin::AutoLearnThreshold::BEGIN@57 at line 57 of Mail/SpamAssassin/Plugin/AutoLearnThreshold.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 Net::DNS::Packet::BEGIN@30 at line 30 of Net/DNS/Packet.pm # once (37µs+0s) by Net::DNS::RR::A::BEGIN@10 at line 10 of Net/DNS/RR/A.pm # once (37µs+0s) by Mail::SpamAssassin::Plugin::SpamCop::BEGIN@48 at line 48 of Mail/SpamAssassin/Plugin/SpamCop.pm # once (36µs+0s) by Net::DNS::Update::BEGIN@33 at line 33 of Net/DNS/Update.pm # once (36µs+0s) by Net::DNS::Header::BEGIN@29 at line 29 of Net/DNS/Header.pm # once (36µs+0s) by Mail::SpamAssassin::Plugin::Check::BEGIN@18 at line 18 of Mail/SpamAssassin/Plugin/Check.pm # once (36µs+0s) by Mail::SpamAssassin::PerMsgLearner::BEGIN@50 at line 50 of Mail/SpamAssassin/PerMsgLearner.pm # once (36µs+0s) by Sys::Syslog::BEGIN@3 at line 3 of Sys/Syslog.pm # once (36µs+0s) by Mail::SpamAssassin::DnsResolver::BEGIN@39 at line 39 of Mail/SpamAssassin/DnsResolver.pm # once (35µs+0s) by Mail::SpamAssassin::Timeout::BEGIN@57 at line 57 of Mail/SpamAssassin/Timeout.pm # once (35µs+0s) by Mail::SpamAssassin::Conf::BEGIN@81 at line 81 of Mail/SpamAssassin/Conf.pm # once (35µs+0s) by Mail::SpamAssassin::Plugin::WLBLEval::BEGIN@24 at line 24 of Mail/SpamAssassin/Plugin/WLBLEval.pm # once (35µs+0s) by Encode::BEGIN@6 at line 6 of Encode.pm # once (35µs+0s) by Mail::SpamAssassin::Plugin::URIDNSBL::BEGIN@300 at line 300 of Mail/SpamAssassin/Plugin/URIDNSBL.pm # once (35µs+0s) by Net::DNS::Domain::BEGIN@39 at line 39 of Net/DNS/Domain.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 Mail::SpamAssassin::Plugin::RelayEval::BEGIN@25 at line 25 of Mail/SpamAssassin/Plugin/RelayEval.pm # once (34µs+0s) by Mail::SpamAssassin::Plugin::AskDNS::BEGIN@188 at line 188 of Mail/SpamAssassin/Plugin/AskDNS.pm # once (34µs+0s) by Mail::SpamAssassin::PluginHandler::BEGIN@32 at line 32 of Mail/SpamAssassin/PluginHandler.pm # once (34µs+0s) by Net::LibIDN2::BEGIN@7 at line 7 of Net/LibIDN2.pm # once (34µs+0s) by IO::Socket::INET6::BEGIN@13 at line 13 of IO/Socket/INET6.pm # once (34µs+0s) by Mail::SpamAssassin::PersistentAddrList::BEGIN@50 at line 50 of Mail/SpamAssassin/PersistentAddrList.pm # once (34µs+0s) by Mail::SpamAssassin::Plugin::HTTPSMismatch::BEGIN@23 at line 23 of Mail/SpamAssassin/Plugin/HTTPSMismatch.pm # once (34µs+0s) by DB_File::RECNOINFO::BEGIN@115 at line 115 of DB_File.pm # once (33µs+0s) by Mail::SpamAssassin::Plugin::URIEval::BEGIN@24 at line 24 of Mail/SpamAssassin/Plugin/URIEval.pm # once (33µs+0s) by Mail::SpamAssassin::Plugin::VBounce::BEGIN@33 at line 33 of Mail/SpamAssassin/Plugin/VBounce.pm # once (33µs+0s) by Mail::SpamAssassin::Conf::Parser::BEGIN@144 at line 144 of Mail/SpamAssassin/Conf/Parser.pm # once (33µs+0s) by Mail::SpamAssassin::Message::Metadata::BEGIN@52 at line 52 of Mail/SpamAssassin/Message/Metadata.pm # once (33µs+0s) by Mail::SpamAssassin::Plugin::MIMEHeader::BEGIN@61 at line 61 of Mail/SpamAssassin/Plugin/MIMEHeader.pm # once (33µs+0s) by Mail::SpamAssassin::Plugin::HTMLEval::BEGIN@21 at line 21 of Mail/SpamAssassin/Plugin/HTMLEval.pm # once (33µs+0s) by Mail::SpamAssassin::Plugin::SPF::BEGIN@40 at line 40 of Mail/SpamAssassin/Plugin/SPF.pm # once (32µs+0s) by Mail::SpamAssassin::HTML::BEGIN@24 at line 24 of Mail/SpamAssassin/HTML.pm # once (32µs+0s) by Mail::SpamAssassin::Plugin::Hashcash::BEGIN@87 at line 87 of Mail/SpamAssassin/Plugin/Hashcash.pm # once (32µs+0s) by Net::DNS::Resolver::Base::BEGIN@50 at line 50 of Net/DNS/Resolver/Base.pm # once (32µs+0s) by Net::DNS::DomainName::BEGIN@42 at line 42 of Net/DNS/DomainName.pm # once (32µs+0s) by Net::DNS::Resolver::UNIX::BEGIN@17 at line 17 of Net/DNS/Resolver/UNIX.pm # once (32µs+0s) by Mail::SpamAssassin::Plugin::ImageInfo::BEGIN@86 at line 86 of Mail/SpamAssassin/Plugin/ImageInfo.pm # once (32µs+0s) by Pod::Text::BEGIN@28 at line 28 of Pod/Text.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::Plugin::DNSEval::BEGIN@33 at line 33 of Mail/SpamAssassin/Plugin/DNSEval.pm # once (31µs+0s) by Carp::BEGIN@5 at line 5 of Carp.pm # once (31µs+0s) by Encode::Config::BEGIN@8 at line 8 of Encode/Config.pm # once (31µs+0s) by Net::Config::BEGIN@16 at line 16 of Net/Config.pm # once (31µs+0s) by Mail::SpamAssassin::Util::TieOneStringHash::BEGIN@23 at line 23 of Mail/SpamAssassin/Util/TieOneStringHash.pm # once (31µs+0s) by Encode::Encoding::BEGIN@5 at line 5 of Encode/Encoding.pm # once (30µs+0s) by Mail::SpamAssassin::Util::BEGIN@44 at line 44 of Mail/SpamAssassin/Util.pm # once (30µs+0s) by Net::DNS::RR::AAAA::BEGIN@10 at line 10 of Net/DNS/RR/AAAA.pm # once (30µs+0s) by Pod::Escapes::BEGIN@3 at line 3 of Pod/Escapes.pm # once (30µs+0s) by Mail::SpamAssassin::Locker::UnixNFSSafe::BEGIN@21 at line 21 of Mail/SpamAssassin/Locker/UnixNFSSafe.pm # once (30µs+0s) by Mail::SpamAssassin::Plugin::TxRep::BEGIN@203 at line 203 of Mail/SpamAssassin/Plugin/TxRep.pm # once (30µs+0s) by Mail::SpamAssassin::Plugin::URIDetail::BEGIN@74 at line 74 of Mail/SpamAssassin/Plugin/URIDetail.pm # once (30µs+0s) by DB_File::HASHINFO::BEGIN@14 at line 14 of DB_File.pm # once (30µs+0s) by POSIX::BEGIN@3 at line 3 of POSIX.pm # once (29µs+0s) by DB_File::BTREEINFO::BEGIN@133 at line 133 of DB_File.pm # once (29µs+0s) by Mail::SpamAssassin::Conf::LDAP::BEGIN@47 at line 47 of Mail/SpamAssassin/Conf/LDAP.pm # once (29µs+0s) by Mail::SpamAssassin::Logger::Stderr::BEGIN@33 at line 33 of Mail/SpamAssassin/Logger/Stderr.pm # once (29µs+0s) by Mail::SpamAssassin::PerMsgStatus::BEGIN@24 at line 24 of Mail/SpamAssassin/Dns.pm # once (28µs+0s) by URI::_punycode::BEGIN@4 at line 4 of URI/_punycode.pm # once (27µs+0s) by Net::DNS::BEGIN@35 at line 35 of Net/DNS.pm # once (27µs+0s) by Digest::SHA::BEGIN@6 at line 6 of Digest/SHA.pm # once (26µs+0s) by Mail::SpamAssassin::PerMsgStatus::BEGIN@53 at line 53 of Mail/SpamAssassin/PerMsgStatus.pm # once (26µs+0s) by Net::LibIDN::BEGIN@5 at line 5 of Net/LibIDN.pm # once (25µs+0s) by Config::BEGIN@10 at line 10 of Config.pm # once (24µs+0s) by Mail::SpamAssassin::Plugin::FreeMail::BEGIN@3 at line 3 of Mail/SpamAssassin/Plugin/FreeMail.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 Mail::SpamAssassin::Message::Metadata::BEGIN@45 at line 45 of Mail/SpamAssassin/Message/Metadata/Received.pm # once (23µs+0s) by IO::Socket::IP::BEGIN@14 at line 14 of IO/Socket/IP.pm # once (23µs+0s) by Mail::SpamAssassin::BayesStore::BEGIN@32 at line 32 of Mail/SpamAssassin/BayesStore.pm # once (23µs+0s) by Net::Patricia::BEGIN@27 at line 27 of Net/Patricia.pm # once (23µs+0s) by Net::DNS::Question::BEGIN@28 at line 28 of Net/DNS/Question.pm # once (23µs+0s) by Mail::SpamAssassin::Locker::BEGIN@21 at line 21 of Mail/SpamAssassin/Locker.pm # once (23µs+0s) by Encode::Alias::BEGIN@3 at line 3 of Encode/Alias.pm # once (23µs+0s) by Net::Cmd::BEGIN@16 at line 16 of Net/Cmd.pm # once (22µs+0s) by Mail::SpamAssassin::Util::ScopedTimer::BEGIN@23 at line 23 of Mail/SpamAssassin/Util/ScopedTimer.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 Mail::SpamAssassin::Locales::BEGIN@21 at line 21 of Mail/SpamAssassin/Locales.pm # once (22µs+0s) by Term::ReadKey::BEGIN@8 at line 8 of Term/ReadKey.pm # once (21µs+0s) by Mail::SpamAssassin::Bayes::BEGIN@36 at line 36 of Mail/SpamAssassin/Bayes.pm # once (19µs+0s) by DB_File::BEGIN@159 at line 159 of DB_File.pm
{
288116198µs shift;
289
290116818µs my $mask = ${^WARNING_BITS} // ($^W ? $Bits{all} : $DEFAULT) ;
291
292116785µs if (vec($mask, $Offsets{'all'}, 1)) {
293116390µs $mask |= $Bits{'all'} ;
294116348µs $mask |= $DeadBits{'all'} if vec($mask, $Offsets{'all'}+1, 1);
295 }
296
297 # append 'all' when implied (after a lone "FATAL" or "NONFATAL")
298116302µs push @_, 'all' if @_==1 && ( $_[0] eq 'FATAL' || $_[0] eq 'NONFATAL' );
299
300 # Empty @_ is equivalent to @_ = 'all' ;
3011161.82ms ${^WARNING_BITS} = @_ ? _bits($mask, @_) : $mask | $Bits{all} ;
302}
303
304sub unimport
305
# spent 1.01ms within warnings::unimport which was called 17 times, avg 60µs/call: # once (79µs+0s) by Mail::SpamAssassin::Plugin::Bayes::BEGIN@1509 at line 1509 of Mail/SpamAssassin/Plugin/Bayes.pm # once (71µs+0s) by Carp::BEGIN@6 at line 24 of Carp.pm # once (66µs+0s) by File::Glob::BEGIN@54 at line 54 of File/Glob.pm # once (65µs+0s) by IO::Socket::SSL::BEGIN@1891 at line 1891 of IO/Socket/SSL.pm # once (63µs+0s) by IO::Socket::SSL::BEGIN@231 at line 231 of IO/Socket/SSL.pm # once (62µs+0s) by Net::SMTP::BEGIN@30 at line 30 of Net/SMTP.pm # once (62µs+0s) by Exporter::Heavy::BEGIN@202 at line 202 of Exporter/Heavy.pm # once (61µs+0s) by Encode::BEGIN@268 at line 268 of Encode.pm # once (59µs+0s) by Mail::SpamAssassin::Util::BEGIN@1 at line 1 of (eval 31)[Mail/SpamAssassin/Util.pm:194] # once (59µs+0s) by IO::Socket::SSL::BEGIN@2051 at line 2051 of IO/Socket/SSL.pm # once (59µs+0s) by NetAddr::IP::InetBase::BEGIN@71 at line 71 of NetAddr/IP/InetBase.pm # once (58µs+0s) by Net::SMTP::BEGIN@41 at line 41 of Net/SMTP.pm # once (58µs+0s) by Carp::BEGIN@605 at line 605 of Carp.pm # once (56µ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 (48µs+0s) by Encode::Alias::BEGIN@4 at line 4 of Encode/Alias.pm # once (33µs+0s) by Net::SMTP::BEGIN@46 at line 46 of Net/SMTP.pm
{
3061739µs shift;
307
3081735µs my $catmask ;
30917130µs my $mask = ${^WARNING_BITS} // ($^W ? $Bits{all} : $DEFAULT) ;
310
31117115µs if (vec($mask, $Offsets{'all'}, 1)) {
3121665µs $mask |= $Bits{'all'} ;
3131663µ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")
3171774µs push @_, 'all' if !@_ || @_==1 && $_[0] eq 'FATAL';
318
3191775µs foreach my $word ( @_ ) {
32017143µs if ($word eq 'FATAL') {
321 next;
322 }
323 elsif ($catmask = $Bits{$word}) {
32417106µs $mask &= ~($catmask | $DeadBits{$word} | $All);
325 }
326 else
327 { Croaker("Unknown warnings category '$word'")}
328 }
329
33017298µs ${^WARNING_BITS} = $mask ;
331}
332
33327µsmy %builtin_type; @builtin_type{qw(SCALAR ARRAY HASH CODE REF GLOB LVALUE Regexp)} = ();
334
335sub MESSAGE () { 4 };
336sub FATAL () { 2 };
337sub NORMAL () { 1 };
338
339sub __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
417sub _mkMask
418
# spent 295µs within warnings::_mkMask which was called 16 times, avg 18µs/call: # 8 times (152µs+0s) by warnings::register_categories at line 432, avg 19µs/call # 8 times (144µs+0s) by warnings::register_categories at line 438, avg 18µs/call
{
4191632µs my ($bit) = @_;
4201645µs my $mask = "";
421
4221697µs vec($mask, $bit, 1) = 1;
42316186µs return $mask;
424}
425
426sub register_categories
427
# spent 5.28ms (4.98+295µs) within warnings::register_categories which was called 9 times, avg 587µs/call: # 8 times (4.96ms+295µs) by warnings::register::import at line 23 of warnings/register.pm, avg 658µs/call # once (20µs+0s) by Net::Patricia::BEGIN@31 at line 8 of version.pm
{
428927µs my @names = @_;
429
4309129µs for my $name (@names) {
431970µs if (! defined $Bits{$name}) {
432874µs8152µs $Bits{$name} = _mkMask($LAST_BIT);
# spent 152µs making 8 calls to warnings::_mkMask, avg 19µs/call
433838µs vec($Bits{'all'}, $LAST_BIT, 1) = 1;
434825µs $Offsets{$name} = $LAST_BIT ++;
4358246µs foreach my $k (keys %Bits) {
4365644.22ms vec($Bits{$k}, $LAST_BIT, 1) = 0;
437 }
438868µs8144µs $DeadBits{$name} = _mkMask($LAST_BIT);
# spent 144µs making 8 calls to warnings::_mkMask, avg 18µs/call
439837µs vec($DeadBits{'all'}, $LAST_BIT++, 1) = 1;
440 }
441 }
442}
443
444sub _error_loc {
445 require Carp;
446 goto &Carp::short_error_loc; # don't introduce another stack frame
447}
448
449sub enabled
450{
451 return __chk(NORMAL, @_);
452}
453
454sub fatal_enabled
455{
456 return __chk(FATAL, @_);
457}
458
459sub warn
460{
461 return __chk(FATAL | MESSAGE, @_);
462}
463
464sub 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.
471112µsdelete @warnings::{qw(NORMAL FATAL MESSAGE)};
472
4731101µs1;
474__END__
 
# spent 11µs within warnings::CORE:match which was called: # once (11µs+0s) by main::BEGIN@20 at line 14
sub warnings::CORE:match; # opcode