← Index
NYTProf Performance Profile   « block view • line view • sub view »
For mentat.storage.mongo.pl
  Run on Tue Jun 24 09:58:41 2014
Reported on Tue Jun 24 09:59:14 2014

Filename/usr/share/perl/5.14/warnings.pm
StatementsExecuted 1404 statements in 3.14ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1671531481.15ms1.15mswarnings::::importwarnings::import
711748µs837µswarnings::::register_categorieswarnings::register_categories
191913266µs266µswarnings::::unimportwarnings::unimport
142189µs89µswarnings::::_mkMaskwarnings::_mkMask
11129µs29µswarnings::::CORE:regcompwarnings::CORE:regcomp (opcode)
1118µs8µ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.12';
9
10# Verify that we're called correctly so that warnings will work.
11# see also strict.pm.
12260µs236µsunless ( __FILE__ =~ /(^|[\/\\])\Q${\__PACKAGE__}\E\.pmc?$/ ) {
# spent 29µs making 1 call to warnings::CORE:regcomp # spent 8µ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
17132µ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
80135µsour %Bits = (
81 'all' => "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15", # [0..50]
82 'ambiguous' => "\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00", # [29]
83 'bareword' => "\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00", # [30]
84 'closed' => "\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [6]
85 'closure' => "\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [1]
86 'debugging' => "\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00", # [22]
87 'deprecated' => "\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [2]
88 'digit' => "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00", # [31]
89 'exec' => "\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [7]
90 'exiting' => "\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [3]
91 'glob' => "\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [4]
92 'illegalproto' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00", # [47]
93 'imprecision' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00", # [46]
94 'inplace' => "\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00", # [23]
95 'internal' => "\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00", # [24]
96 'io' => "\x00\x54\x55\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [5..11]
97 'layer' => "\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [8]
98 'malloc' => "\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00", # [25]
99 'misc' => "\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [12]
100 'newline' => "\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [9]
101 'non_unicode' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01", # [48]
102 'nonchar' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04", # [49]
103 'numeric' => "\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [13]
104 'once' => "\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [14]
105 'overflow' => "\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [15]
106 'pack' => "\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00", # [16]
107 'parenthesis' => "\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00", # [32]
108 'pipe' => "\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [10]
109 'portable' => "\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00", # [17]
110 'precedence' => "\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00", # [33]
111 'printf' => "\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00", # [34]
112 'prototype' => "\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00", # [35]
113 'qw' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00", # [36]
114 'recursion' => "\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00", # [18]
115 'redefine' => "\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00", # [19]
116 'regexp' => "\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00", # [20]
117 'reserved' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00", # [37]
118 'semicolon' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00", # [38]
119 'severe' => "\x00\x00\x00\x00\x00\x54\x05\x00\x00\x00\x00\x00\x00", # [21..25]
120 'signal' => "\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00", # [26]
121 'substr' => "\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00", # [27]
122 'surrogate' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10", # [50]
123 'syntax' => "\x00\x00\x00\x00\x00\x00\x00\x55\x55\x15\x00\x40\x00", # [28..38,47]
124 'taint' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00", # [39]
125 'threads' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00", # [40]
126 'uninitialized' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00", # [41]
127 'unopened' => "\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [11]
128 'unpack' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00", # [42]
129 'untie' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00", # [43]
130 'utf8' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x15", # [44,48..50]
131 'void' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00", # [45]
132 );
133
134125µsour %DeadBits = (
135 'all' => "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\x2a", # [0..50]
136 'ambiguous' => "\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00", # [29]
137 'bareword' => "\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00", # [30]
138 'closed' => "\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [6]
139 'closure' => "\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [1]
140 'debugging' => "\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00", # [22]
141 'deprecated' => "\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [2]
142 'digit' => "\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00", # [31]
143 'exec' => "\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [7]
144 'exiting' => "\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [3]
145 'glob' => "\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [4]
146 'illegalproto' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00", # [47]
147 'imprecision' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00", # [46]
148 'inplace' => "\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00", # [23]
149 'internal' => "\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00", # [24]
150 'io' => "\x00\xa8\xaa\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [5..11]
151 'layer' => "\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [8]
152 'malloc' => "\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00", # [25]
153 'misc' => "\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [12]
154 'newline' => "\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [9]
155 'non_unicode' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02", # [48]
156 'nonchar' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08", # [49]
157 'numeric' => "\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [13]
158 'once' => "\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [14]
159 'overflow' => "\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [15]
160 'pack' => "\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00", # [16]
161 'parenthesis' => "\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00", # [32]
162 'pipe' => "\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [10]
163 'portable' => "\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00", # [17]
164 'precedence' => "\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00", # [33]
165 'printf' => "\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00", # [34]
166 'prototype' => "\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00", # [35]
167 'qw' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00", # [36]
168 'recursion' => "\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00", # [18]
169 'redefine' => "\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00", # [19]
170 'regexp' => "\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00", # [20]
171 'reserved' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00", # [37]
172 'semicolon' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00", # [38]
173 'severe' => "\x00\x00\x00\x00\x00\xa8\x0a\x00\x00\x00\x00\x00\x00", # [21..25]
174 'signal' => "\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00", # [26]
175 'substr' => "\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00", # [27]
176 'surrogate' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20", # [50]
177 'syntax' => "\x00\x00\x00\x00\x00\x00\x00\xaa\xaa\x2a\x00\x80\x00", # [28..38,47]
178 'taint' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00", # [39]
179 'threads' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00", # [40]
180 'uninitialized' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00", # [41]
181 'unopened' => "\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [11]
182 'unpack' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00", # [42]
183 'untie' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00", # [43]
184 'utf8' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x2a", # [44,48..50]
185 'void' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00", # [45]
186 );
187
1881600ns$NONE = "\0\0\0\0\0\0\0\0\0\0\0\0\0";
1891200ns$LAST_BIT = 102 ;
1901300ns$BYTES = 13 ;
191
192215µs$All = "" ; vec($All, $Offsets{'all'}, 2) = 3 ;
193
194sub Croaker
195{
196 require Carp; # this initializes %CarpInternal
197 local $Carp::CarpInternal{'warnings'};
198 delete $Carp::CarpInternal{'warnings'};
199 Carp::croak(@_);
200}
201
202sub _bits {
203 my $mask = shift ;
204 my $catmask ;
205 my $fatal = 0 ;
206 my $no_fatal = 0 ;
207
208 foreach my $word ( @_ ) {
209 if ($word eq 'FATAL') {
210 $fatal = 1;
211 $no_fatal = 0;
212 }
213 elsif ($word eq 'NONFATAL') {
214 $fatal = 0;
215 $no_fatal = 1;
216 }
217 elsif ($catmask = $Bits{$word}) {
218 $mask |= $catmask ;
219 $mask |= $DeadBits{$word} if $fatal ;
220 $mask &= ~($DeadBits{$word}|$All) if $no_fatal ;
221 }
222 else
223 { Croaker("Unknown warnings category '$word'")}
224 }
225
226 return $mask ;
227}
228
229sub bits
230{
231 # called from B::Deparse.pm
232 push @_, 'all' unless @_ ;
233 return _bits(undef, @_) ;
234}
235
236sub import
237
# spent 1.15ms within warnings::import which was called 167 times, avg 7µs/call: # 14 times (56µs+0s) by Moose::Exporter::__ANON__[/usr/local/lib/perl/5.14.2/Moose/Exporter.pm:519] at line 465 of Moose/Exporter.pm, avg 4µs/call # 2 times (11µs+0s) by Moose::Exporter::import at line 783 of Moose/Exporter.pm, avg 6µs/call # once (22µs+0s) by main::BEGIN@4 at line 4 of mentat.storage.mongo.pl # once (18µs+0s) by File::Compare::BEGIN@5 at line 5 of File/Compare.pm # once (15µs+0s) by DateTime::Infinite::Future::BEGIN@45 at line 45 of DateTime/Infinite.pm # once (15µs+0s) by DateTime::TimeZone::BEGIN@12 at line 12 of DateTime/TimeZone.pm # once (14µs+0s) by DateTime::Infinite::Past::BEGIN@73 at line 73 of DateTime/Infinite.pm # once (14µs+0s) by FakeLocale::BEGIN@99 at line 99 of DateTime/Infinite.pm # once (13µs+0s) by DateTime::TimeZone::OlsonDB::BEGIN@10 at line 10 of DateTime/TimeZone/OlsonDB.pm # once (13µs+0s) by File::Basename::BEGIN@52 at line 52 of File/Basename.pm # once (12µs+0s) by DateTime::Infinite::BEGIN@7 at line 7 of DateTime/Infinite.pm # once (12µs+0s) by Data::OptList::BEGIN@2 at line 2 of Sub/Install.pm # once (12µs+0s) by DateTime::TimeZone::Local::Unix::BEGIN@10 at line 10 of DateTime/TimeZone/Local/Unix.pm # once (12µs+0s) by Class::Singleton::BEGIN@20 at line 20 of Class/Singleton.pm # once (12µs+0s) by DateTime::Locale::BEGIN@4 at line 4 of DateTime/Locale.pm # once (12µs+0s) by DateTime::TimeZone::OlsonDB::Observance::BEGIN@10 at line 10 of DateTime/TimeZone/OlsonDB/Observance.pm # once (12µs+0s) by Value::Convertor::BEGIN@3 at line 3 of Value/Convertor.pm # once (12µs+0s) by DateTime::TimeZone::OlsonDB::Zone::BEGIN@10 at line 10 of DateTime/TimeZone/OlsonDB/Zone.pm # once (12µs+0s) by DateTime::BEGIN@9 at line 9 of DateTime.pm # once (12µs+0s) by Params::Validate::XS::BEGIN@7 at line 7 of Params/Validate/XS.pm # once (12µs+0s) by DateTime::Locale::Catalog::BEGIN@18 at line 18 of DateTime/Locale/Catalog.pm # once (12µs+0s) by re::BEGIN@5 at line 5 of re.pm # once (12µs+0s) by Sub::Name::BEGIN@45 at line 45 of Sub/Name.pm # once (12µs+0s) by Class::Load::XS::BEGIN@7 at line 7 of Class/Load/XS.pm # once (12µs+0s) by Try::Tiny::BEGIN@12 at line 12 of Try/Tiny.pm # once (12µs+0s) by POSIX::BEGIN@3 at line 3 of POSIX.pm # once (12µs+0s) by Config::BEGIN@10 at line 10 of Config.pm # once (12µs+0s) by DateTime::Duration::BEGIN@7 at line 7 of DateTime/Duration.pm # once (12µs+0s) by DateTime::TimeZone::Floating::BEGIN@10 at line 10 of DateTime/TimeZone/Floating.pm # once (11µs+0s) by DateTime::Locale::en_US::BEGIN@22 at line 22 of DateTime/Locale/en_US.pm # once (11µs+0s) by File::Find::BEGIN@4 at line 4 of File/Find.pm # once (11µs+0s) by Params::Validate::Constants::BEGIN@7 at line 7 of Params/Validate/Constants.pm # once (11µs+0s) by DateTime::Locale::Base::BEGIN@4 at line 4 of DateTime/Locale/Base.pm # once (11µs+0s) by DateTime::TimeZone::Local::BEGIN@10 at line 10 of DateTime/TimeZone/Local.pm # once (11µs+0s) by DateTime::TimeZone::OlsonDB::Rule::BEGIN@10 at line 10 of DateTime/TimeZone/OlsonDB/Rule.pm # once (11µs+0s) by DateTime::TimeZone::OlsonDB::Change::BEGIN@10 at line 10 of DateTime/TimeZone/OlsonDB/Change.pm # once (11µs+0s) by DateTime::Locale::en::BEGIN@22 at line 22 of DateTime/Locale/en.pm # once (11µs+0s) by Params::Validate::BEGIN@9 at line 9 of Params/Validate.pm # once (11µs+0s) by DateTime::Helpers::BEGIN@7 at line 7 of DateTime/Helpers.pm # once (10µs+0s) by DateTime::TimeZone::OffsetOnly::BEGIN@10 at line 10 of DateTime/TimeZone/OffsetOnly.pm # once (10µs+0s) by Module::Implementation::BEGIN@10 at line 10 of Module/Implementation.pm # once (10µs+0s) by DateTime::TimeZone::UTC::BEGIN@10 at line 10 of DateTime/TimeZone/UTC.pm # once (10µs+0s) by Class::Load::BEGIN@2 at line 2 of Data/OptList.pm # once (10µs+0s) by DateTime::Locale::root::BEGIN@22 at line 22 of DateTime/Locale/root.pm # once (10µs+0s) by Carp::BEGIN@5 at line 5 of Carp.pm # once (10µs+0s) by Class::Load::BEGIN@6 at line 6 of Class/Load.pm # once (9µs+0s) by Moose::Meta::TypeConstraint::DuckType::BEGIN@10 at line 10 of Moose/Meta/TypeConstraint/DuckType.pm # once (8µs+0s) by Moose::Meta::Role::Application::RoleSummation::BEGIN@10 at line 10 of Moose/Meta/Role/Application/RoleSummation.pm # once (8µs+0s) by Moose::Meta::TypeConstraint::Parameterized::BEGIN@10 at line 10 of Moose/Meta/TypeConstraint/Parameterized.pm # once (8µs+0s) by Moose::BEGIN@9 at line 9 of Moose.pm # once (8µs+0s) by Moose::Meta::Role::Attribute::BEGIN@10 at line 10 of Moose/Meta/Role/Attribute.pm # once (8µs+0s) by Class::MOP::Mixin::HasMethods::BEGIN@10 at line 10 of Class/MOP/Mixin/HasMethods.pm # once (7µs+0s) by MRO::Compat::BEGIN@3 at line 3 of MRO/Compat.pm # once (7µs+0s) by Moose::Object::BEGIN@11 at line 11 of Moose/Object.pm # once (6µs+0s) by Mentat::Storage::Mongo::BEGIN@3 at line 3 of Mentat/Storage/Mongo.pm # once (5µs+0s) by Moose::Meta::Role::Application::ToInstance::BEGIN@10 at line 10 of Moose/Meta/Role/Application/ToInstance.pm # once (5µs+0s) by Moose::Meta::Method::Overridden::BEGIN@10 at line 10 of Moose/Meta/Method/Overridden.pm # once (5µs+0s) by Moose::Meta::Method::Augmented::BEGIN@10 at line 10 of Moose/Meta/Method/Augmented.pm # once (5µs+0s) by Moose::Meta::Mixin::AttributeCore::BEGIN@10 at line 10 of Moose/Meta/Mixin/AttributeCore.pm # once (5µs+0s) by Class::MOP::Attribute::BEGIN@11 at line 11 of Class/MOP/Attribute.pm # once (5µs+0s) by Moose::Meta::Role::BEGIN@10 at line 10 of Moose/Meta/Role.pm # once (5µs+0s) by Moose::Meta::TypeConstraint::Class::BEGIN@10 at line 10 of Moose/Meta/TypeConstraint/Class.pm # once (5µs+0s) by Class::MOP::Method::Constructor::BEGIN@11 at line 11 of Class/MOP/Method/Constructor.pm # once (5µs+0s) by Moose::Meta::TypeConstraint::Registry::BEGIN@11 at line 11 of Moose/Meta/TypeConstraint/Registry.pm # once (5µs+0s) by Moose::Error::Default::BEGIN@10 at line 10 of Moose/Error/Default.pm # once (5µs+0s) by Log::Filter::Source::BEGIN@3 at line 3 of Log/Filter/Source.pm # once (5µs+0s) by Class::MOP::Method::Wrapped::BEGIN@11 at line 11 of Class/MOP/Method/Wrapped.pm # once (5µs+0s) by Moose::Meta::TypeConstraint::Enum::BEGIN@10 at line 10 of Moose/Meta/TypeConstraint/Enum.pm # once (5µs+0s) by Moose::Util::TypeConstraints::Builtins::BEGIN@10 at line 10 of Moose/Util/TypeConstraints/Builtins.pm # once (5µs+0s) by Log::Filter::Threshold::BEGIN@3 at line 3 of Log/Filter/Threshold.pm # once (5µs+0s) by Moose::Meta::Role::Composite::BEGIN@10 at line 10 of Moose/Meta/Role/Composite.pm # once (5µs+0s) by Moose::Meta::Method::Delegation::BEGIN@11 at line 11 of Moose/Meta/Method/Delegation.pm # once (5µs+0s) by Log::Writer::Module::BEGIN@3 at line 3 of Log/Writer/Module.pm # once (5µs+0s) by Class::MOP::Method::Accessor::BEGIN@11 at line 11 of Class/MOP/Method/Accessor.pm # once (5µs+0s) by Class::MOP::Class::BEGIN@11 at line 11 of Class/MOP/Class.pm # once (5µs+0s) by Moose::Meta::Method::Accessor::BEGIN@11 at line 11 of Moose/Meta/Method/Accessor.pm # once (5µs+0s) by Log::Filter::None::BEGIN@3 at line 3 of Log/Filter/None.pm # once (5µs+0s) by Class::MOP::Method::Overload::BEGIN@11 at line 11 of Class/MOP/Method/Overload.pm # once (5µs+0s) by Log::Filter::All::BEGIN@3 at line 3 of Log/Filter/All.pm # once (5µs+0s) by Class::MOP::Package::BEGIN@11 at line 11 of Class/MOP/Package.pm # once (5µs+0s) by Moose::Meta::Role::Method::Conflicting::BEGIN@11 at line 11 of Moose/Meta/Role/Method/Conflicting.pm # once (5µs+0s) by Log::Channel::Channel::BEGIN@3 at line 3 of Log/Channel/Channel.pm # once (5µs+0s) by Moose::Meta::Attribute::BEGIN@11 at line 11 of Moose/Meta/Attribute.pm # once (5µs+0s) by Encode::Config::BEGIN@8 at line 8 of Encode/Config.pm # once (5µs+0s) by Class::MOP::MiniTrait::BEGIN@10 at line 10 of Class/MOP/MiniTrait.pm # once (5µs+0s) by Moose::Meta::Role::Application::ToClass::BEGIN@10 at line 10 of Moose/Meta/Role/Application/ToClass.pm # once (5µs+0s) by Log::Writer::Email::BEGIN@3 at line 3 of Log/Writer/Email.pm # once (5µs+0s) by Moose::Meta::TypeConstraint::BEGIN@11 at line 11 of Moose/Meta/TypeConstraint.pm # once (5µs+0s) by Moose::Util::MetaRole::BEGIN@10 at line 10 of Moose/Util/MetaRole.pm # once (5µs+0s) by Moose::Meta::TypeCoercion::BEGIN@11 at line 11 of Moose/Meta/TypeCoercion.pm # once (5µs+0s) by Moose::Exporter::BEGIN@3 at line 3 of Sub/Exporter.pm # once (5µs+0s) by Moose::Meta::Instance::BEGIN@11 at line 11 of Moose/Meta/Instance.pm # once (5µs+0s) by Moose::Meta::Role::Application::ToRole::BEGIN@10 at line 10 of Moose/Meta/Role/Application/ToRole.pm # once (5µs+0s) by Encode::Alias::BEGIN@3 at line 3 of Encode/Alias.pm # once (5µs+0s) by Moose::Exporter::BEGIN@10 at line 10 of Moose/Exporter.pm # once (5µs+0s) by Moose::Meta::Method::Destructor::BEGIN@11 at line 11 of Moose/Meta/Method/Destructor.pm # once (5µs+0s) by Moose::Meta::Role::Method::BEGIN@11 at line 11 of Moose/Meta/Role/Method.pm # once (5µs+0s) by Class::MOP::Deprecated::BEGIN@10 at line 10 of Class/MOP/Deprecated.pm # once (5µs+0s) by Log::Writer::File::BEGIN@3 at line 3 of Log/Writer/File.pm # once (5µs+0s) by Log::Writer::Handle::BEGIN@3 at line 3 of Log/Writer/Handle.pm # once (5µs+0s) by Readonly::XS::BEGIN@19 at line 19 of Readonly/XS.pm # once (5µs+0s) by Moose::Meta::Role::Method::Required::BEGIN@11 at line 11 of Moose/Meta/Role/Method/Required.pm # once (5µs+0s) by Moose::Meta::Role::Application::BEGIN@10 at line 10 of Moose/Meta/Role/Application.pm # once (5µs+0s) by Moose::Meta::Method::Meta::BEGIN@11 at line 11 of Moose/Meta/Method/Meta.pm # once (5µs+0s) by Log::Filter::Severity::BEGIN@3 at line 3 of Log/Filter/Severity.pm # once (5µs+0s) by Moose::Meta::TypeConstraint::Role::BEGIN@10 at line 10 of Moose/Meta/TypeConstraint/Role.pm # once (5µs+0s) by Moose::Deprecated::BEGIN@10 at line 10 of Moose/Deprecated.pm # once (5µs+0s) by Class::MOP::Class::Immutable::Trait::BEGIN@10 at line 10 of Class/MOP/Class/Immutable/Trait.pm # once (5µs+0s) by Moose::Util::BEGIN@10 at line 10 of Moose/Util.pm # once (5µs+0s) by Moose::Meta::Method::Constructor::BEGIN@11 at line 11 of Moose/Meta/Method/Constructor.pm # once (5µs+0s) by Log::Filter::Message::BEGIN@3 at line 3 of Log/Filter/Message.pm # once (5µs+0s) by Mentat::Storage::Mongo::BEGIN@19 at line 19 of MongoDB.pm # once (5µs+0s) by Log::Writer::Std::BEGIN@3 at line 3 of Log/Writer/Std.pm # once (5µs+0s) by Log::Loger::BEGIN@3 at line 3 of Log/Loger.pm # once (5µs+0s) by Moose::Meta::Class::Immutable::Trait::BEGIN@10 at line 10 of Moose/Meta/Class/Immutable/Trait.pm # once (5µs+0s) by Log::Writer::Syslog::BEGIN@3 at line 3 of Log/Writer/Syslog.pm # once (5µs+0s) by Mentat::Storage::BEGIN@3 at line 3 of Mentat/Storage.pm # once (5µs+0s) by Log::Filter::Set::BEGIN@3 at line 3 of Log/Filter/Set.pm # once (5µs+0s) by Class::MOP::Method::Generated::BEGIN@11 at line 11 of Class/MOP/Method/Generated.pm # once (5µs+0s) by Moose::Meta::Class::BEGIN@11 at line 11 of Moose/Meta/Class.pm # once (5µs+0s) by Moose::Meta::TypeCoercion::Union::BEGIN@11 at line 11 of Moose/Meta/TypeCoercion/Union.pm # once (5µs+0s) by Sys::Syslog::BEGIN@3 at line 3 of Sys/Syslog.pm # once (5µs+0s) by Package::Stash::XS::BEGIN@9 at line 9 of Package/Stash/XS.pm # once (5µs+0s) by Sub::Exporter::Progressive::BEGIN@4 at line 4 of Sub/Exporter/Progressive.pm # once (5µs+0s) by Class::MOP::Method::Inlined::BEGIN@10 at line 10 of Class/MOP/Method/Inlined.pm # once (5µs+0s) by Class::MOP::Module::BEGIN@11 at line 11 of Class/MOP/Module.pm # once (5µs+0s) by Package::Stash::BEGIN@9 at line 9 of Package/Stash.pm # once (5µs+0s) by Devel::GlobalDestruction::BEGIN@4 at line 4 of Devel/GlobalDestruction.pm # once (5µs+0s) by Class::MOP::Mixin::HasAttributes::BEGIN@10 at line 10 of Class/MOP/Mixin/HasAttributes.pm # once (5µs+0s) by IO::BEGIN@8 at line 8 of IO.pm # once (5µs+0s) by boolean::BEGIN@3.10 at line 3 of boolean.pm # once (5µs+0s) by Moose::Meta::TypeConstraint::Union::BEGIN@11 at line 11 of Moose/Meta/TypeConstraint/Union.pm # once (5µs+0s) by Moose::Error::Util::BEGIN@5 at line 5 of Moose/Error/Util.pm # once (5µs+0s) by Mutex::Flock::BEGIN@3 at line 3 of Mutex/Flock.pm # once (5µs+0s) by Encode::Encoding::BEGIN@5 at line 5 of Encode/Encoding.pm # once (5µs+0s) by Moose::Meta::TypeConstraint::Parameterizable::BEGIN@10 at line 10 of Moose/Meta/TypeConstraint/Parameterizable.pm # once (5µs+0s) by Log::Filter::Re::BEGIN@3 at line 3 of Log/Filter/Re.pm # once (5µs+0s) by Encode::BEGIN@6 at line 6 of Encode.pm # once (5µs+0s) by Class::MOP::Mixin::BEGIN@10 at line 10 of Class/MOP/Mixin.pm # once (5µs+0s) by metaclass::BEGIN@11 at line 11 of metaclass.pm # once (5µs+0s) by Class::MOP::Instance::BEGIN@11 at line 11 of Class/MOP/Instance.pm # once (5µs+0s) by Class::MOP::Mixin::AttributeCore::BEGIN@10 at line 10 of Class/MOP/Mixin/AttributeCore.pm # once (5µs+0s) by Log::Filter::Module::BEGIN@3 at line 3 of Log/Filter/Module.pm # once (5µs+0s) by Log::Channel::Module::BEGIN@3 at line 3 of Log/Channel/Module.pm # once (5µs+0s) by Moose::Meta::Method::BEGIN@10 at line 10 of Moose/Meta/Method.pm # once (5µs+0s) by mro::BEGIN@11 at line 11 of mro.pm # once (4µs+0s) by Class::MOP::Object::BEGIN@11 at line 11 of Class/MOP/Object.pm # once (4µs+0s) by Class::MOP::Method::BEGIN@11 at line 11 of Class/MOP/Method.pm # once (4µs+0s) by Log::Core::Essentials::BEGIN@3 at line 3 of Log/Core/Essentials.pm # once (4µs+0s) by Package::DeprecationManager::BEGIN@7 at line 7 of Package/DeprecationManager.pm # once (4µs+0s) by Class::MOP::BEGIN@11 at line 11 of Class/MOP.pm # once (4µs+0s) by Class::MOP::Method::Meta::BEGIN@11 at line 11 of Class/MOP/Method/Meta.pm # once (4µs+0s) by Eval::Closure::BEGIN@9 at line 9 of Eval/Closure.pm
{
2386681.67ms shift;
239
240 my $mask = ${^WARNING_BITS} ;
241
2421413µs if (vec($mask, $Offsets{'all'}, 1)) {
243 $mask |= $Bits{'all'} ;
244 $mask |= $DeadBits{'all'} if vec($mask, $Offsets{'all'}+1, 1);
245 }
246
247 # Empty @_ is equivalent to @_ = 'all' ;
248 ${^WARNING_BITS} = @_ ? _bits($mask, @_) : $mask | $Bits{all} ;
249}
250
251sub unimport
252
# spent 266µs within warnings::unimport which was called 19 times, avg 14µs/call: # once (26µs+0s) by POSIX::BEGIN@39 at line 39 of POSIX.pm # once (25µs+0s) by Carp::BEGIN@6 at line 24 of Carp.pm # once (23µs+0s) by Module::Implementation::BEGIN@124 at line 124 of Module/Implementation.pm # once (22µs+0s) by Exporter::Heavy::BEGIN@183 at line 183 of Exporter/Heavy.pm # once (20µs+0s) by bigint::BEGIN@275 at line 275 of bigint.pm # once (20µs+0s) by Carp::BEGIN@568 at line 568 of Carp.pm # once (12µs+0s) by Readonly::XS::BEGIN@32 at line 32 of Readonly/XS.pm # once (11µs+0s) by MRO::Compat::BEGIN@39 at line 39 of MRO/Compat.pm # once (11µs+0s) by Moose::Util::TypeConstraints::BEGIN@667 at line 667 of Moose/Util/TypeConstraints.pm # once (11µs+0s) by Encode::BEGIN@240 at line 240 of Encode.pm # once (11µs+0s) by Devel::GlobalDestruction::BEGIN@23 at line 23 of Devel/GlobalDestruction.pm # once (11µs+0s) by Class::MOP::Package::BEGIN@95 at line 95 of Class/MOP/Package.pm # once (10µs+0s) by MRO::Compat::BEGIN@228 at line 228 of MRO/Compat.pm # once (9µs+0s) by Moose::Exporter::BEGIN@133 at line 133 of Moose/Exporter.pm # once (9µs+0s) by Encode::Alias::BEGIN@4 at line 4 of Encode/Alias.pm # once (9µs+0s) by Moose::Util::TypeConstraints::BEGIN@673 at line 673 of Moose/Util/TypeConstraints.pm # once (9µs+0s) by Readonly::XS::BEGIN@46 at line 46 of Readonly/XS.pm # once (8µs+0s) by Moose::Util::TypeConstraints::BEGIN@694 at line 694 of Moose/Util/TypeConstraints.pm # once (8µs+0s) by Moose::Util::TypeConstraints::BEGIN@678 at line 678 of Moose/Util/TypeConstraints.pm
{
253133236µs shift;
254
255 my $catmask ;
256 my $mask = ${^WARNING_BITS} ;
257
2583226µs if (vec($mask, $Offsets{'all'}, 1)) {
259 $mask |= $Bits{'all'} ;
260 $mask |= $DeadBits{'all'} if vec($mask, $Offsets{'all'}+1, 1);
261 }
262
263 push @_, 'all' unless @_;
264
265 foreach my $word ( @_ ) {
2663876µs if ($word eq 'FATAL') {
267 next;
268 }
269 elsif ($catmask = $Bits{$word}) {
270 $mask &= ~($catmask | $DeadBits{$word} | $All);
271 }
272 else
273 { Croaker("Unknown warnings category '$word'")}
274 }
275
276 ${^WARNING_BITS} = $mask ;
277}
278
27927µsmy %builtin_type; @builtin_type{qw(SCALAR ARRAY HASH CODE REF GLOB LVALUE Regexp)} = ();
280
281sub MESSAGE () { 4 };
282sub FATAL () { 2 };
283sub NORMAL () { 1 };
284
285sub __chk
286{
287 my $category ;
288 my $offset ;
289 my $isobj = 0 ;
290 my $wanted = shift;
291 my $has_message = $wanted & MESSAGE;
292
293 unless (@_ == 1 || @_ == ($has_message ? 2 : 0)) {
294 my $sub = (caller 1)[3];
295 my $syntax = $has_message ? "[category,] 'message'" : '[category]';
296 Croaker("Usage: $sub($syntax)");
297 }
298
299 my $message = pop if $has_message;
300
301 if (@_) {
302 # check the category supplied.
303 $category = shift ;
304 if (my $type = ref $category) {
305 Croaker("not an object")
306 if exists $builtin_type{$type};
307 $category = $type;
308 $isobj = 1 ;
309 }
310 $offset = $Offsets{$category};
311 Croaker("Unknown warnings category '$category'")
312 unless defined $offset;
313 }
314 else {
315 $category = (caller(1))[0] ;
316 $offset = $Offsets{$category};
317 Croaker("package '$category' not registered for warnings")
318 unless defined $offset ;
319 }
320
321 my $i;
322
323 if ($isobj) {
324 my $pkg;
325 $i = 2;
326 while (do { { package DB; $pkg = (caller($i++))[0] } } ) {
327 last unless @DB::args && $DB::args[0] =~ /^$category=/ ;
328 }
329 $i -= 2 ;
330 }
331 else {
332 $i = _error_loc(); # see where Carp will allocate the error
333 }
334
335 # Defaulting this to 0 reduces complexity in code paths below.
336 my $callers_bitmask = (caller($i))[9] || 0 ;
337
338 my @results;
339 foreach my $type (FATAL, NORMAL) {
340 next unless $wanted & $type;
341
342 push @results, (vec($callers_bitmask, $offset + $type - 1, 1) ||
343 vec($callers_bitmask, $Offsets{'all'} + $type - 1, 1));
344 }
345
346 # &enabled and &fatal_enabled
347 return $results[0] unless $has_message;
348
349 # &warnif, and the category is neither enabled as warning nor as fatal
350 return if $wanted == (NORMAL | FATAL | MESSAGE)
351 && !($results[0] || $results[1]);
352
353 require Carp;
354 Carp::croak($message) if $results[0];
355 # will always get here for &warn. will only get here for &warnif if the
356 # category is enabled
357 Carp::carp($message);
358}
359
360sub _mkMask
361
# spent 89µs within warnings::_mkMask which was called 14 times, avg 6µs/call: # 7 times (55µs+0s) by warnings::register_categories at line 375, avg 8µs/call # 7 times (33µs+0s) by warnings::register_categories at line 381, avg 5µs/call
{
36256131µs my ($bit) = @_;
363 my $mask = "";
364
365 vec($mask, $bit, 1) = 1;
366 return $mask;
367}
368
369sub register_categories
370
# spent 837µs (748+89) within warnings::register_categories which was called 7 times, avg 120µs/call: # 7 times (748µs+89µs) by warnings::register::import at line 24 of warnings/register.pm, avg 120µs/call
{
3711445µs my @names = @_;
372
373 for my $name (@names) {
37449221µs if (! defined $Bits{$name}) {
375755µs $Bits{$name} = _mkMask($LAST_BIT);
# spent 55µs making 7 calls to warnings::_mkMask, avg 8µs/call
376 vec($Bits{'all'}, $LAST_BIT, 1) = 1;
377 $Offsets{$name} = $LAST_BIT ++;
378 foreach my $k (keys %Bits) {
379385450µs vec($Bits{$k}, $LAST_BIT, 1) = 0;
380 }
381733µs $DeadBits{$name} = _mkMask($LAST_BIT);
# spent 33µs making 7 calls to warnings::_mkMask, avg 5µs/call
382 vec($DeadBits{'all'}, $LAST_BIT++, 1) = 1;
383 }
384 }
385}
386
387sub _error_loc {
388 require Carp;
389 goto &Carp::short_error_loc; # don't introduce another stack frame
390}
391
392sub enabled
393{
394 return __chk(NORMAL, @_);
395}
396
397sub fatal_enabled
398{
399 return __chk(FATAL, @_);
400}
401
402sub warn
403{
404 return __chk(FATAL | MESSAGE, @_);
405}
406
407sub warnif
408{
409 return __chk(NORMAL | FATAL | MESSAGE, @_);
410}
411
412# These are not part of any public interface, so we can delete them to save
413# space.
414118µsdelete $warnings::{$_} foreach qw(NORMAL FATAL MESSAGE);
415
416176µs1;
417
418# ex: set ro:
 
# spent 8µs within warnings::CORE:match which was called: # once (8µs+0s) by main::BEGIN@4 at line 12
sub warnings::CORE:match; # opcode
# spent 29µs within warnings::CORE:regcomp which was called: # once (29µs+0s) by main::BEGIN@4 at line 12
sub warnings::CORE:regcomp; # opcode