← Index
NYTProf Performance Profile   « line view »
For index.cgi
  Run on Sat May 9 17:18:47 2020
Reported on Sat May 9 17:19:07 2020

Filename/usr/share/perl/5.18/warnings.pm
StatementsExecuted 603 statements in 1.22ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
433231263µs263µswarnings::::importwarnings::import
311259µs286µswarnings::::register_categorieswarnings::register_categories
202015257µs257µswarnings::::unimportwarnings::unimport
62128µs28µswarnings::::_mkMaskwarnings::_mkMask
11119µs19µswarnings::::CORE:regcompwarnings::CORE:regcomp (opcode)
1114µs4µ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
811µsour $VERSION = '1.18';
9
10# Verify that we're called correctly so that warnings will work.
11# see also strict.pm.
12137µs223µsunless ( __FILE__ =~ /(^|[\/\\])\Q${\__PACKAGE__}\E\.pmc?$/ ) {
# spent 19µs making 1 call to warnings::CORE:regcomp # spent 4µs making 1 call to warnings::CORE:match
13 my (undef, $f, $l) = caller;
14 die("Incorrect use of pragma '${\__PACKAGE__}' at $f line $l.\n");
15}
16
17119µsour %Offsets = (
18
19 # Warnings Categories added in Perl 5.008
20
21 'all' => 0,
22 'closure' => 2,
23 'deprecated' => 4,
24 'exiting' => 6,
25 'glob' => 8,
26 'io' => 10,
27 'closed' => 12,
28 'exec' => 14,
29 'layer' => 16,
30 'newline' => 18,
31 'pipe' => 20,
32 'unopened' => 22,
33 'misc' => 24,
34 'numeric' => 26,
35 'once' => 28,
36 'overflow' => 30,
37 'pack' => 32,
38 'portable' => 34,
39 'recursion' => 36,
40 'redefine' => 38,
41 'regexp' => 40,
42 'severe' => 42,
43 'debugging' => 44,
44 'inplace' => 46,
45 'internal' => 48,
46 'malloc' => 50,
47 'signal' => 52,
48 'substr' => 54,
49 'syntax' => 56,
50 'ambiguous' => 58,
51 'bareword' => 60,
52 'digit' => 62,
53 'parenthesis' => 64,
54 'precedence' => 66,
55 'printf' => 68,
56 'prototype' => 70,
57 'qw' => 72,
58 'reserved' => 74,
59 'semicolon' => 76,
60 'taint' => 78,
61 'threads' => 80,
62 'uninitialized' => 82,
63 'unpack' => 84,
64 'untie' => 86,
65 'utf8' => 88,
66 'void' => 90,
67
68 # Warnings Categories added in Perl 5.011
69
70 'imprecision' => 92,
71 'illegalproto' => 94,
72
73 # Warnings Categories added in Perl 5.013
74
75 'non_unicode' => 96,
76 'nonchar' => 98,
77 'surrogate' => 100,
78
79 # Warnings Categories added in Perl 5.017
80
81 'experimental' => 102,
82 'experimental::lexical_subs'=> 104,
83 'experimental::lexical_topic'=> 106,
84 'experimental::regex_sets'=> 108,
85 'experimental::smartmatch'=> 110,
86 );
87
88125µsour %Bits = (
89 'all' => "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55", # [0..55]
90 'ambiguous' => "\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00", # [29]
91 'bareword' => "\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00", # [30]
92 'closed' => "\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [6]
93 'closure' => "\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [1]
94 'debugging' => "\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00", # [22]
95 'deprecated' => "\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [2]
96 'digit' => "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00", # [31]
97 'exec' => "\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [7]
98 'exiting' => "\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [3]
99 'experimental' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x55", # [51..55]
100 'experimental::lexical_subs'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01", # [52]
101 'experimental::lexical_topic'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04", # [53]
102 'experimental::regex_sets'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10", # [54]
103 'experimental::smartmatch'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40", # [55]
104 'glob' => "\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [4]
105 'illegalproto' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00", # [47]
106 'imprecision' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00", # [46]
107 'inplace' => "\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00", # [23]
108 'internal' => "\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00", # [24]
109 'io' => "\x00\x54\x55\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [5..11]
110 'layer' => "\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [8]
111 'malloc' => "\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00", # [25]
112 'misc' => "\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [12]
113 'newline' => "\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [9]
114 'non_unicode' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00", # [48]
115 'nonchar' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00", # [49]
116 'numeric' => "\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [13]
117 'once' => "\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [14]
118 'overflow' => "\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [15]
119 'pack' => "\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [16]
120 'parenthesis' => "\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00", # [32]
121 'pipe' => "\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [10]
122 'portable' => "\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [17]
123 'precedence' => "\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00", # [33]
124 'printf' => "\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00", # [34]
125 'prototype' => "\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00", # [35]
126 'qw' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00", # [36]
127 'recursion' => "\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [18]
128 'redefine' => "\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [19]
129 'regexp' => "\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00", # [20]
130 'reserved' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00", # [37]
131 'semicolon' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00", # [38]
132 'severe' => "\x00\x00\x00\x00\x00\x54\x05\x00\x00\x00\x00\x00\x00\x00", # [21..25]
133 'signal' => "\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00", # [26]
134 'substr' => "\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00", # [27]
135 'surrogate' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00", # [50]
136 'syntax' => "\x00\x00\x00\x00\x00\x00\x00\x55\x55\x15\x00\x40\x00\x00", # [28..38,47]
137 'taint' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00", # [39]
138 'threads' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00", # [40]
139 'uninitialized' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00", # [41]
140 'unopened' => "\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [11]
141 'unpack' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00", # [42]
142 'untie' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00", # [43]
143 'utf8' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x15\x00", # [44,48..50]
144 'void' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00", # [45]
145 );
146
147120µsour %DeadBits = (
148 'all' => "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", # [0..55]
149 'ambiguous' => "\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00", # [29]
150 'bareword' => "\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00", # [30]
151 'closed' => "\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [6]
152 'closure' => "\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [1]
153 'debugging' => "\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00", # [22]
154 'deprecated' => "\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [2]
155 'digit' => "\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00", # [31]
156 'exec' => "\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [7]
157 'exiting' => "\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [3]
158 'experimental' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\xaa", # [51..55]
159 'experimental::lexical_subs'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02", # [52]
160 'experimental::lexical_topic'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08", # [53]
161 'experimental::regex_sets'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20", # [54]
162 'experimental::smartmatch'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80", # [55]
163 'glob' => "\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [4]
164 'illegalproto' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00", # [47]
165 'imprecision' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00", # [46]
166 'inplace' => "\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00", # [23]
167 'internal' => "\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00", # [24]
168 'io' => "\x00\xa8\xaa\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [5..11]
169 'layer' => "\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [8]
170 'malloc' => "\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00", # [25]
171 'misc' => "\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [12]
172 'newline' => "\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [9]
173 'non_unicode' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00", # [48]
174 'nonchar' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00", # [49]
175 'numeric' => "\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [13]
176 'once' => "\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [14]
177 'overflow' => "\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [15]
178 'pack' => "\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [16]
179 'parenthesis' => "\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00", # [32]
180 'pipe' => "\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [10]
181 'portable' => "\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [17]
182 'precedence' => "\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00", # [33]
183 'printf' => "\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00", # [34]
184 'prototype' => "\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00", # [35]
185 'qw' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00", # [36]
186 'recursion' => "\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [18]
187 'redefine' => "\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [19]
188 'regexp' => "\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00", # [20]
189 'reserved' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00", # [37]
190 'semicolon' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00", # [38]
191 'severe' => "\x00\x00\x00\x00\x00\xa8\x0a\x00\x00\x00\x00\x00\x00\x00", # [21..25]
192 'signal' => "\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00", # [26]
193 'substr' => "\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00", # [27]
194 'surrogate' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00", # [50]
195 'syntax' => "\x00\x00\x00\x00\x00\x00\x00\xaa\xaa\x2a\x00\x80\x00\x00", # [28..38,47]
196 'taint' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00", # [39]
197 'threads' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00", # [40]
198 'uninitialized' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00", # [41]
199 'unopened' => "\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [11]
200 'unpack' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00", # [42]
201 'untie' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00", # [43]
202 'utf8' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x2a\x00", # [44,48..50]
203 'void' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00", # [45]
204 );
205
2061400ns$NONE = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
20713µs$DEFAULT = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x00\x55", # [2,52..55,4,22,23,25]
208$LAST_BIT = 112 ;
2091300ns$BYTES = 14 ;
210
21128µs$All = "" ; vec($All, $Offsets{'all'}, 2) = 3 ;
212
213sub Croaker
214{
215 require Carp; # this initializes %CarpInternal
216 local $Carp::CarpInternal{'warnings'};
217 delete $Carp::CarpInternal{'warnings'};
218 Carp::croak(@_);
219}
220
221sub _bits {
222 my $mask = shift ;
223 my $catmask ;
224 my $fatal = 0 ;
225 my $no_fatal = 0 ;
226
227 foreach my $word ( @_ ) {
228 if ($word eq 'FATAL') {
229 $fatal = 1;
230 $no_fatal = 0;
231 }
232 elsif ($word eq 'NONFATAL') {
233 $fatal = 0;
234 $no_fatal = 1;
235 }
236 elsif ($catmask = $Bits{$word}) {
237 $mask |= $catmask ;
238 $mask |= $DeadBits{$word} if $fatal ;
239 $mask &= ~($DeadBits{$word}|$All) if $no_fatal ;
240 }
241 else
242 { Croaker("Unknown warnings category '$word'")}
243 }
244
245 return $mask ;
246}
247
248sub bits
249{
250 # called from B::Deparse.pm
251 push @_, 'all' unless @_ ;
252 return _bits(undef, @_) ;
253}
254
255sub import
256
# spent 263µs within warnings::import which was called 43 times, avg 6µs/call: # 11 times (63µs+0s) by Moo::_strictures::import at line 14 of Moo/_strictures.pm, avg 6µs/call # 2 times (12µs+0s) by Moo::import at line 26 of Moo.pm, avg 6µs/call # once (12µs+0s) by main::BEGIN@3 at line 3 of index.cgi # once (9µs+0s) by Data::GUID::BEGIN@3 at line 3 of Sub/Exporter.pm # once (9µs+0s) by Sub::Name::BEGIN@54 at line 54 of Sub/Name.pm # once (7µs+0s) by namespace::clean::BEGIN@3 at line 3 of namespace/clean.pm # once (7µs+0s) by namespace::clean::_Util::BEGIN@12 at line 12 of namespace/clean/_Util.pm # once (7µs+0s) by Devel::GlobalDestruction::BEGIN@4 at line 4 of Devel/GlobalDestruction.pm # once (7µs+0s) by overloading::BEGIN@2 at line 2 of overloading.pm # once (6µs+0s) by Unicode::Normalize::BEGIN@11 at line 11 of Unicode/Normalize.pm # once (6µs+0s) by Moo::BEGIN@2 at line 2 of Class/Method/Modifiers.pm # once (6µs+0s) by Package::Stash::XS::BEGIN@9 at line 9 of Package/Stash/XS.pm # once (6µs+0s) by Sub::Exporter::BEGIN@2 at line 2 of Data/OptList.pm # once (6µs+0s) by List::Util::BEGIN@10 at line 10 of List/Util.pm # once (6µs+0s) by B::Hooks::EndOfScope::XS::BEGIN@5 at line 5 of B/Hooks/EndOfScope/XS.pm # once (6µs+0s) by Class::XSAccessor::BEGIN@4 at line 4 of Class/XSAccessor.pm # once (6µs+0s) by Class::XSAccessor::Heavy::BEGIN@6 at line 6 of Class/XSAccessor/Heavy.pm # once (6µs+0s) by Data::GUID::BEGIN@2 at line 2 of Sub/Install.pm # once (6µs+0s) by String::Markov::BEGIN@2 at line 2 of namespace/autoclean.pm # once (6µs+0s) by Variable::Magic::BEGIN@6 at line 6 of Variable/Magic.pm # once (6µs+0s) by Moo::_strictures::BEGIN@3 at line 3 of Moo/_strictures.pm # once (6µs+0s) by main::BEGIN@2.1 at line 2 of Data/GUID.pm # once (6µs+0s) by Package::Stash::BEGIN@7 at line 7 of Package/Stash.pm # once (6µs+0s) by Config::BEGIN@10 at line 10 of Config.pm # once (5µs+0s) by Carp::BEGIN@5 at line 5 of Carp.pm # once (5µs+0s) by B::Hooks::EndOfScope::BEGIN@6 at line 6 of B/Hooks/EndOfScope.pm # once (5µs+0s) by Scalar::Util::BEGIN@10 at line 10 of Scalar/Util.pm # once (5µs+0s) by mro::BEGIN@11 at line 11 of mro.pm # once (5µs+0s) by Try::Tiny::BEGIN@10 at line 10 of Try/Tiny.pm # once (5µs+0s) by Module::Implementation::BEGIN@6 at line 6 of Module/Implementation.pm # once (5µs+0s) by Sub::Exporter::Progressive::BEGIN@4 at line 4 of Sub/Exporter/Progressive.pm # once (5µs+0s) by Sub::Util::BEGIN@8 at line 8 of Sub/Util.pm
{
2574310µs shift;
258
2594370µs my $mask = ${^WARNING_BITS} // ($^W ? $Bits{all} : $DEFAULT) ;
260
2614349µs if (vec($mask, $Offsets{'all'}, 1)) {
2621800ns $mask |= $Bits{'all'} ;
2631900ns $mask |= $DeadBits{'all'} if vec($mask, $Offsets{'all'}+1, 1);
264 }
265
266 # Empty @_ is equivalent to @_ = 'all' ;
26743278µs ${^WARNING_BITS} = @_ ? _bits($mask, @_) : $mask | $Bits{all} ;
268}
269
270sub unimport
271
# spent 257µs within warnings::unimport which was called 20 times, avg 13µs/call: # once (18µs+0s) by Sub::Quote::BEGIN@16 at line 16 of (eval 33)[Sub/Quote.pm:3] # once (14µs+0s) by Sub::Defer::BEGIN@27 at line 27 of Sub/Defer.pm # once (14µs+0s) by Module::Implementation::BEGIN@129 at line 129 of Module/Implementation.pm # once (14µs+0s) by Class::XSAccessor::Heavy::BEGIN@30 at line 30 of Class/XSAccessor/Heavy.pm # once (14µs+0s) by Class::XSAccessor::BEGIN@84 at line 84 of Class/XSAccessor.pm # once (14µs+0s) by Carp::BEGIN@434 at line 434 of Carp.pm # once (14µs+0s) by Moo::HandleMoose::_TypeMap::BEGIN@21 at line 21 of Moo/HandleMoose/_TypeMap.pm # once (14µs+0s) by Moo::_Utils::BEGIN@90 at line 90 of Moo/_Utils.pm # once (13µs+0s) by Moo::BEGIN@112 at line 112 of Moo.pm # once (13µs+0s) by Devel::GlobalDestruction::BEGIN@23 at line 23 of Devel/GlobalDestruction.pm # once (13µs+0s) by Class::Method::Modifiers::BEGIN@150 at line 150 of Class/Method/Modifiers.pm # once (13µs+0s) by Moo::Object::BEGIN@65 at line 65 of Moo/Object.pm # once (13µs+0s) by Unicode::Normalize::BEGIN@14 at line 14 of Unicode/Normalize.pm # once (13µs+0s) by Sub::Quote::BEGIN@4 at line 4 of (eval 13)[Sub/Quote.pm:3] # once (12µs+0s) by Moo::sification::BEGIN@4 at line 4 of Moo/sification.pm # once (12µs+0s) by Class::Method::Modifiers::BEGIN@204 at line 204 of Class/Method/Modifiers.pm # once (11µs+0s) by Moo::_Utils::BEGIN@3 at line 3 of Moo/_Utils.pm # once (11µs+0s) by Carp::BEGIN@441 at line 441 of Carp.pm # once (10µs+0s) by Moo::_Utils::BEGIN@97 at line 97 of Moo/_Utils.pm # once (8µs+0s) by Class::Method::Modifiers::BEGIN@151 at line 151 of Class/Method/Modifiers.pm
{
272205µs shift;
273
274205µs my $catmask ;
2752048µs my $mask = ${^WARNING_BITS} // ($^W ? $Bits{all} : $DEFAULT) ;
276
2772029µs if (vec($mask, $Offsets{'all'}, 1)) {
2781511µs $mask |= $Bits{'all'} ;
2791513µs $mask |= $DeadBits{'all'} if vec($mask, $Offsets{'all'}+1, 1);
280 }
281
282209µs push @_, 'all' unless @_;
283
2842025µs foreach my $word ( @_ ) {
2852066µs if ($word eq 'FATAL') {
286 next;
287 }
288 elsif ($catmask = $Bits{$word}) {
289 $mask &= ~($catmask | $DeadBits{$word} | $All);
290 }
291 else
292 { Croaker("Unknown warnings category '$word'")}
293 }
294
29520145µs ${^WARNING_BITS} = $mask ;
296}
297
29827µsmy %builtin_type; @builtin_type{qw(SCALAR ARRAY HASH CODE REF GLOB LVALUE Regexp)} = ();
299
300sub MESSAGE () { 4 };
301sub FATAL () { 2 };
302sub NORMAL () { 1 };
303
304sub __chk
305{
306 my $category ;
307 my $offset ;
308 my $isobj = 0 ;
309 my $wanted = shift;
310 my $has_message = $wanted & MESSAGE;
311
312 unless (@_ == 1 || @_ == ($has_message ? 2 : 0)) {
313 my $sub = (caller 1)[3];
314 my $syntax = $has_message ? "[category,] 'message'" : '[category]';
315 Croaker("Usage: $sub($syntax)");
316 }
317
318 my $message = pop if $has_message;
319
320 if (@_) {
321 # check the category supplied.
322 $category = shift ;
323 if (my $type = ref $category) {
324 Croaker("not an object")
325 if exists $builtin_type{$type};
326 $category = $type;
327 $isobj = 1 ;
328 }
329 $offset = $Offsets{$category};
330 Croaker("Unknown warnings category '$category'")
331 unless defined $offset;
332 }
333 else {
334 $category = (caller(1))[0] ;
335 $offset = $Offsets{$category};
336 Croaker("package '$category' not registered for warnings")
337 unless defined $offset ;
338 }
339
340 my $i;
341
342 if ($isobj) {
343 my $pkg;
344 $i = 2;
345 while (do { { package DB; $pkg = (caller($i++))[0] } } ) {
346 last unless @DB::args && $DB::args[0] =~ /^$category=/ ;
347 }
348 $i -= 2 ;
349 }
350 else {
351 $i = _error_loc(); # see where Carp will allocate the error
352 }
353
354 # Default to 0 if caller returns nothing. Default to $DEFAULT if it
355 # explicitly returns undef.
356 my(@callers_bitmask) = (caller($i))[9] ;
357 my $callers_bitmask =
358 @callers_bitmask ? $callers_bitmask[0] // $DEFAULT : 0 ;
359
360 my @results;
361 foreach my $type (FATAL, NORMAL) {
362 next unless $wanted & $type;
363
364 push @results, (vec($callers_bitmask, $offset + $type - 1, 1) ||
365 vec($callers_bitmask, $Offsets{'all'} + $type - 1, 1));
366 }
367
368 # &enabled and &fatal_enabled
369 return $results[0] unless $has_message;
370
371 # &warnif, and the category is neither enabled as warning nor as fatal
372 return if $wanted == (NORMAL | FATAL | MESSAGE)
373 && !($results[0] || $results[1]);
374
375 require Carp;
376 Carp::croak($message) if $results[0];
377 # will always get here for &warn. will only get here for &warnif if the
378 # category is enabled
379 Carp::carp($message);
380}
381
382sub _mkMask
383
# spent 28µs within warnings::_mkMask which was called 6 times, avg 5µs/call: # 3 times (18µs+0s) by warnings::register_categories at line 397, avg 6µs/call # 3 times (10µs+0s) by warnings::register_categories at line 403, avg 3µs/call
{
38463µs my ($bit) = @_;
38563µs my $mask = "";
386
387610µs vec($mask, $bit, 1) = 1;
388629µs return $mask;
389}
390
391sub register_categories
392
# spent 286µs (259+28) within warnings::register_categories which was called 3 times, avg 95µs/call: # 3 times (259µs+28µs) by warnings::register::import at line 24 of warnings/register.pm, avg 95µs/call
{
39332µs my @names = @_;
394
395312µs for my $name (@names) {
39636µs if (! defined $Bits{$name}) {
39739µs318µs $Bits{$name} = _mkMask($LAST_BIT);
# spent 18µs making 3 calls to warnings::_mkMask, avg 6µs/call
39835µs vec($Bits{'all'}, $LAST_BIT, 1) = 1;
39933µs $Offsets{$name} = $LAST_BIT ++;
400333µs foreach my $k (keys %Bits) {
401174163µs vec($Bits{$k}, $LAST_BIT, 1) = 0;
402 }
40337µs310µs $DeadBits{$name} = _mkMask($LAST_BIT);
# spent 10µs making 3 calls to warnings::_mkMask, avg 3µs/call
40435µs vec($DeadBits{'all'}, $LAST_BIT++, 1) = 1;
405 }
406 }
407}
408
409sub _error_loc {
410 require Carp;
411 goto &Carp::short_error_loc; # don't introduce another stack frame
412}
413
414sub enabled
415{
416 return __chk(NORMAL, @_);
417}
418
419sub fatal_enabled
420{
421 return __chk(FATAL, @_);
422}
423
424sub warn
425{
426 return __chk(FATAL | MESSAGE, @_);
427}
428
429sub warnif
430{
431 return __chk(NORMAL | FATAL | MESSAGE, @_);
432}
433
434# These are not part of any public interface, so we can delete them to save
435# space.
43616µsdelete @warnings::{qw(NORMAL FATAL MESSAGE)};
437
438136µs1;
439
440# ex: set ro:
 
# spent 4µs within warnings::CORE:match which was called: # once (4µs+0s) by main::BEGIN@3 at line 12
sub warnings::CORE:match; # opcode
# spent 19µs within warnings::CORE:regcomp which was called: # once (19µs+0s) by main::BEGIN@3 at line 12
sub warnings::CORE:regcomp; # opcode