| Filename | /usr/lib/x86_64-linux-gnu/perl-base/warnings.pm |
| Statements | Executed 8329 statements in 3.48ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 79 | 73 | 69 | 953µs | 2.20ms | warnings::import |
| 304 | 1 | 1 | 911µs | 1.20ms | warnings::_bits |
| 93 | 87 | 46 | 622µs | 889µs | warnings::unimport |
| 397 | 2 | 1 | 552µs | 552µs | warnings::_expand_bits |
| 9 | 2 | 2 | 77µs | 114µs | warnings::register_categories |
| 309 | 2 | 1 | 52µs | 52µs | warnings::CORE:match (opcode) |
| 16 | 2 | 1 | 37µs | 37µs | warnings::_mkMask |
| 0 | 0 | 0 | 0s | 0s | warnings::Croaker |
| 0 | 0 | 0 | 0s | 0s | warnings::__chk |
| 0 | 0 | 0 | 0s | 0s | warnings::_error_loc |
| 0 | 0 | 0 | 0s | 0s | warnings::bits |
| 0 | 0 | 0 | 0s | 0s | warnings::enabled |
| 0 | 0 | 0 | 0s | 0s | warnings::enabled_at_level |
| 0 | 0 | 0 | 0s | 0s | warnings::fatal_enabled |
| 0 | 0 | 0 | 0s | 0s | warnings::fatal_enabled_at_level |
| 0 | 0 | 0 | 0s | 0s | warnings::warn |
| 0 | 0 | 0 | 0s | 0s | warnings::warn_at_level |
| 0 | 0 | 0 | 0s | 0s | warnings::warnif |
| 0 | 0 | 0 | 0s | 0s | warnings::warnif_at_level |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | # -*- buffer-read-only: t -*- | ||||
| 2 | # !!!!!!! DO NOT EDIT THIS FILE !!!!!!! | ||||
| 3 | # This file is built by regen/warnings.pl. | ||||
| 4 | # Any changes made here will be lost! | ||||
| 5 | |||||
| 6 | package warnings; | ||||
| 7 | |||||
| 8 | 1 | 300ns | our $VERSION = "1.58"; | ||
| 9 | |||||
| 10 | # Verify that we're called correctly so that warnings will work. | ||||
| 11 | # Can't use Carp, since Carp uses us! | ||||
| 12 | # String regexps because constant folding = smaller optree = less memory vs regexp literal | ||||
| 13 | # see also strict.pm. | ||||
| 14 | 1 | 10µs | 1 | 5µs | die sprintf "Incorrect use of pragma '%s' at %s line %d.\n", __PACKAGE__, +(caller)[1,2] # spent 5µs making 1 call to warnings::CORE:match |
| 15 | if __FILE__ !~ ( '(?x) \b '.__PACKAGE__.' \.pmc? \z' ) | ||||
| 16 | && __FILE__ =~ ( '(?x) \b (?i:'.__PACKAGE__.') \.pmc? \z' ); | ||||
| 17 | |||||
| 18 | 1 | 12µs | our %Offsets = ( | ||
| 19 | # Warnings Categories added in Perl 5.008 | ||||
| 20 | 'all' => 0, | ||||
| 21 | 'closure' => 2, | ||||
| 22 | 'deprecated' => 4, | ||||
| 23 | 'exiting' => 6, | ||||
| 24 | 'glob' => 8, | ||||
| 25 | 'io' => 10, | ||||
| 26 | 'closed' => 12, | ||||
| 27 | 'exec' => 14, | ||||
| 28 | 'layer' => 16, | ||||
| 29 | 'newline' => 18, | ||||
| 30 | 'pipe' => 20, | ||||
| 31 | 'unopened' => 22, | ||||
| 32 | 'misc' => 24, | ||||
| 33 | 'numeric' => 26, | ||||
| 34 | 'once' => 28, | ||||
| 35 | 'overflow' => 30, | ||||
| 36 | 'pack' => 32, | ||||
| 37 | 'portable' => 34, | ||||
| 38 | 'recursion' => 36, | ||||
| 39 | 'redefine' => 38, | ||||
| 40 | 'regexp' => 40, | ||||
| 41 | 'severe' => 42, | ||||
| 42 | 'debugging' => 44, | ||||
| 43 | 'inplace' => 46, | ||||
| 44 | 'internal' => 48, | ||||
| 45 | 'malloc' => 50, | ||||
| 46 | 'signal' => 52, | ||||
| 47 | 'substr' => 54, | ||||
| 48 | 'syntax' => 56, | ||||
| 49 | 'ambiguous' => 58, | ||||
| 50 | 'bareword' => 60, | ||||
| 51 | 'digit' => 62, | ||||
| 52 | 'parenthesis' => 64, | ||||
| 53 | 'precedence' => 66, | ||||
| 54 | 'printf' => 68, | ||||
| 55 | 'prototype' => 70, | ||||
| 56 | 'qw' => 72, | ||||
| 57 | 'reserved' => 74, | ||||
| 58 | 'semicolon' => 76, | ||||
| 59 | 'taint' => 78, | ||||
| 60 | 'threads' => 80, | ||||
| 61 | 'uninitialized' => 82, | ||||
| 62 | 'unpack' => 84, | ||||
| 63 | 'untie' => 86, | ||||
| 64 | 'utf8' => 88, | ||||
| 65 | 'void' => 90, | ||||
| 66 | |||||
| 67 | # Warnings Categories added in Perl 5.011 | ||||
| 68 | 'imprecision' => 92, | ||||
| 69 | 'illegalproto' => 94, | ||||
| 70 | |||||
| 71 | # Warnings Categories added in Perl 5.013 | ||||
| 72 | 'non_unicode' => 96, | ||||
| 73 | 'nonchar' => 98, | ||||
| 74 | 'surrogate' => 100, | ||||
| 75 | |||||
| 76 | # Warnings Categories added in Perl 5.017 | ||||
| 77 | 'experimental' => 102, | ||||
| 78 | 'experimental::lexical_subs' => 104, | ||||
| 79 | 'experimental::regex_sets' => 106, | ||||
| 80 | 'experimental::smartmatch' => 108, | ||||
| 81 | |||||
| 82 | # Warnings Categories added in Perl 5.019 | ||||
| 83 | 'experimental::postderef' => 110, | ||||
| 84 | 'experimental::signatures' => 112, | ||||
| 85 | 'syscalls' => 114, | ||||
| 86 | |||||
| 87 | # Warnings Categories added in Perl 5.021 | ||||
| 88 | 'experimental::bitwise' => 116, | ||||
| 89 | 'experimental::const_attr' => 118, | ||||
| 90 | 'experimental::re_strict' => 120, | ||||
| 91 | 'experimental::refaliasing' => 122, | ||||
| 92 | 'locale' => 124, | ||||
| 93 | 'missing' => 126, | ||||
| 94 | 'redundant' => 128, | ||||
| 95 | |||||
| 96 | # Warnings Categories added in Perl 5.025 | ||||
| 97 | 'experimental::declared_refs' => 130, | ||||
| 98 | |||||
| 99 | # Warnings Categories added in Perl 5.027 | ||||
| 100 | 'experimental::alpha_assertions' => 132, | ||||
| 101 | 'experimental::script_run' => 134, | ||||
| 102 | 'shadow' => 136, | ||||
| 103 | |||||
| 104 | # Warnings Categories added in Perl 5.029 | ||||
| 105 | 'experimental::private_use' => 138, | ||||
| 106 | 'experimental::uniprop_wildcards' => 140, | ||||
| 107 | 'experimental::vlb' => 142, | ||||
| 108 | |||||
| 109 | # Warnings Categories added in Perl 5.031 | ||||
| 110 | 'experimental::isa' => 144, | ||||
| 111 | |||||
| 112 | # Warnings Categories added in Perl 5.033 | ||||
| 113 | 'experimental::try' => 146, | ||||
| 114 | |||||
| 115 | # Warnings Categories added in Perl 5.035 | ||||
| 116 | 'experimental::args_array_with_signatures'=> 148, | ||||
| 117 | 'experimental::builtin' => 150, | ||||
| 118 | 'experimental::defer' => 152, | ||||
| 119 | 'experimental::extra_paired_delimiters'=> 154, | ||||
| 120 | 'experimental::for_list' => 156, | ||||
| 121 | 'scalar' => 158, | ||||
| 122 | ); | ||||
| 123 | |||||
| 124 | 1 | 13µs | our %Bits = ( | ||
| 125 | 'all' => "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55", # [0..79] | ||||
| 126 | 'ambiguous' => "\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [29] | ||||
| 127 | 'bareword' => "\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [30] | ||||
| 128 | 'closed' => "\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [6] | ||||
| 129 | 'closure' => "\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [1] | ||||
| 130 | 'debugging' => "\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [22] | ||||
| 131 | 'deprecated' => "\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [2] | ||||
| 132 | 'digit' => "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [31] | ||||
| 133 | 'exec' => "\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [7] | ||||
| 134 | 'exiting' => "\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [3] | ||||
| 135 | 'experimental' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x55\x51\x05\x54\x54\x55\x15", # [51..56,58..61,65..67,69..78] | ||||
| 136 | 'experimental::alpha_assertions' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00", # [66] | ||||
| 137 | 'experimental::args_array_with_signatures'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00", # [74] | ||||
| 138 | 'experimental::bitwise' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00", # [58] | ||||
| 139 | 'experimental::builtin' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00", # [75] | ||||
| 140 | 'experimental::const_attr' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00", # [59] | ||||
| 141 | 'experimental::declared_refs' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00", # [65] | ||||
| 142 | 'experimental::defer' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01", # [76] | ||||
| 143 | 'experimental::extra_paired_delimiters'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04", # [77] | ||||
| 144 | 'experimental::for_list' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10", # [78] | ||||
| 145 | 'experimental::isa' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00", # [72] | ||||
| 146 | 'experimental::lexical_subs' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00", # [52] | ||||
| 147 | 'experimental::postderef' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00", # [55] | ||||
| 148 | 'experimental::private_use' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00", # [69] | ||||
| 149 | 'experimental::re_strict' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00", # [60] | ||||
| 150 | 'experimental::refaliasing' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00", # [61] | ||||
| 151 | 'experimental::regex_sets' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00", # [53] | ||||
| 152 | 'experimental::script_run' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00", # [67] | ||||
| 153 | 'experimental::signatures' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00", # [56] | ||||
| 154 | 'experimental::smartmatch' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00", # [54] | ||||
| 155 | 'experimental::try' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00", # [73] | ||||
| 156 | 'experimental::uniprop_wildcards' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00", # [70] | ||||
| 157 | 'experimental::vlb' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00", # [71] | ||||
| 158 | 'glob' => "\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [4] | ||||
| 159 | 'illegalproto' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00", # [47] | ||||
| 160 | 'imprecision' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00", # [46] | ||||
| 161 | 'inplace' => "\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [23] | ||||
| 162 | 'internal' => "\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [24] | ||||
| 163 | 'io' => "\x00\x54\x55\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00", # [5..11,57] | ||||
| 164 | 'layer' => "\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [8] | ||||
| 165 | 'locale' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00", # [62] | ||||
| 166 | 'malloc' => "\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [25] | ||||
| 167 | 'misc' => "\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [12] | ||||
| 168 | 'missing' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00", # [63] | ||||
| 169 | 'newline' => "\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [9] | ||||
| 170 | 'non_unicode' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00", # [48] | ||||
| 171 | 'nonchar' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00", # [49] | ||||
| 172 | 'numeric' => "\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [13] | ||||
| 173 | 'once' => "\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [14] | ||||
| 174 | 'overflow' => "\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [15] | ||||
| 175 | 'pack' => "\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [16] | ||||
| 176 | 'parenthesis' => "\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [32] | ||||
| 177 | 'pipe' => "\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [10] | ||||
| 178 | 'portable' => "\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [17] | ||||
| 179 | 'precedence' => "\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [33] | ||||
| 180 | 'printf' => "\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [34] | ||||
| 181 | 'prototype' => "\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [35] | ||||
| 182 | 'qw' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [36] | ||||
| 183 | 'recursion' => "\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [18] | ||||
| 184 | 'redefine' => "\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [19] | ||||
| 185 | 'redundant' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00", # [64] | ||||
| 186 | 'regexp' => "\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [20] | ||||
| 187 | 'reserved' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [37] | ||||
| 188 | 'scalar' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40", # [79] | ||||
| 189 | 'semicolon' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [38] | ||||
| 190 | 'severe' => "\x00\x00\x00\x00\x00\x54\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [21..25] | ||||
| 191 | 'shadow' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00", # [68] | ||||
| 192 | 'signal' => "\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [26] | ||||
| 193 | 'substr' => "\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [27] | ||||
| 194 | 'surrogate' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00", # [50] | ||||
| 195 | 'syntax' => "\x00\x00\x00\x00\x00\x00\x00\x55\x55\x15\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00", # [28..38,47] | ||||
| 196 | 'syscalls' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00", # [57] | ||||
| 197 | 'taint' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [39] | ||||
| 198 | 'threads' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [40] | ||||
| 199 | 'uninitialized' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [41] | ||||
| 200 | 'unopened' => "\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [11] | ||||
| 201 | 'unpack' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [42] | ||||
| 202 | 'untie' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [43] | ||||
| 203 | 'utf8' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x15\x00\x00\x00\x00\x00\x00\x00", # [44,48..50] | ||||
| 204 | 'void' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00", # [45] | ||||
| 205 | ); | ||||
| 206 | |||||
| 207 | 1 | 9µs | our %DeadBits = ( | ||
| 208 | 'all' => "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", # [0..79] | ||||
| 209 | 'ambiguous' => "\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [29] | ||||
| 210 | 'bareword' => "\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [30] | ||||
| 211 | 'closed' => "\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [6] | ||||
| 212 | 'closure' => "\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [1] | ||||
| 213 | 'debugging' => "\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [22] | ||||
| 214 | 'deprecated' => "\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [2] | ||||
| 215 | 'digit' => "\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [31] | ||||
| 216 | 'exec' => "\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [7] | ||||
| 217 | 'exiting' => "\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [3] | ||||
| 218 | 'experimental' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\xaa\xa2\x0a\xa8\xa8\xaa\x2a", # [51..56,58..61,65..67,69..78] | ||||
| 219 | 'experimental::alpha_assertions' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00", # [66] | ||||
| 220 | 'experimental::args_array_with_signatures'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00", # [74] | ||||
| 221 | 'experimental::bitwise' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00", # [58] | ||||
| 222 | 'experimental::builtin' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00", # [75] | ||||
| 223 | 'experimental::const_attr' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00", # [59] | ||||
| 224 | 'experimental::declared_refs' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00", # [65] | ||||
| 225 | 'experimental::defer' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02", # [76] | ||||
| 226 | 'experimental::extra_paired_delimiters'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08", # [77] | ||||
| 227 | 'experimental::for_list' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20", # [78] | ||||
| 228 | 'experimental::isa' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00", # [72] | ||||
| 229 | 'experimental::lexical_subs' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00", # [52] | ||||
| 230 | 'experimental::postderef' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00", # [55] | ||||
| 231 | 'experimental::private_use' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00", # [69] | ||||
| 232 | 'experimental::re_strict' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00", # [60] | ||||
| 233 | 'experimental::refaliasing' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00", # [61] | ||||
| 234 | 'experimental::regex_sets' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00", # [53] | ||||
| 235 | 'experimental::script_run' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00", # [67] | ||||
| 236 | 'experimental::signatures' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00", # [56] | ||||
| 237 | 'experimental::smartmatch' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00", # [54] | ||||
| 238 | 'experimental::try' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00", # [73] | ||||
| 239 | 'experimental::uniprop_wildcards' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00", # [70] | ||||
| 240 | 'experimental::vlb' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00", # [71] | ||||
| 241 | 'glob' => "\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [4] | ||||
| 242 | 'illegalproto' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00", # [47] | ||||
| 243 | 'imprecision' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00", # [46] | ||||
| 244 | 'inplace' => "\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [23] | ||||
| 245 | 'internal' => "\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [24] | ||||
| 246 | 'io' => "\x00\xa8\xaa\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00", # [5..11,57] | ||||
| 247 | 'layer' => "\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [8] | ||||
| 248 | 'locale' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00", # [62] | ||||
| 249 | 'malloc' => "\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [25] | ||||
| 250 | 'misc' => "\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [12] | ||||
| 251 | 'missing' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00", # [63] | ||||
| 252 | 'newline' => "\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [9] | ||||
| 253 | 'non_unicode' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00", # [48] | ||||
| 254 | 'nonchar' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00", # [49] | ||||
| 255 | 'numeric' => "\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [13] | ||||
| 256 | 'once' => "\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [14] | ||||
| 257 | 'overflow' => "\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [15] | ||||
| 258 | 'pack' => "\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [16] | ||||
| 259 | 'parenthesis' => "\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [32] | ||||
| 260 | 'pipe' => "\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [10] | ||||
| 261 | 'portable' => "\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [17] | ||||
| 262 | 'precedence' => "\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [33] | ||||
| 263 | 'printf' => "\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [34] | ||||
| 264 | 'prototype' => "\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [35] | ||||
| 265 | 'qw' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [36] | ||||
| 266 | 'recursion' => "\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [18] | ||||
| 267 | 'redefine' => "\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [19] | ||||
| 268 | 'redundant' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00", # [64] | ||||
| 269 | 'regexp' => "\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [20] | ||||
| 270 | 'reserved' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [37] | ||||
| 271 | 'scalar' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80", # [79] | ||||
| 272 | 'semicolon' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [38] | ||||
| 273 | 'severe' => "\x00\x00\x00\x00\x00\xa8\x0a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [21..25] | ||||
| 274 | 'shadow' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00", # [68] | ||||
| 275 | 'signal' => "\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [26] | ||||
| 276 | 'substr' => "\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [27] | ||||
| 277 | 'surrogate' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00", # [50] | ||||
| 278 | 'syntax' => "\x00\x00\x00\x00\x00\x00\x00\xaa\xaa\x2a\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00", # [28..38,47] | ||||
| 279 | 'syscalls' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00", # [57] | ||||
| 280 | 'taint' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [39] | ||||
| 281 | 'threads' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [40] | ||||
| 282 | 'uninitialized' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [41] | ||||
| 283 | 'unopened' => "\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [11] | ||||
| 284 | 'unpack' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [42] | ||||
| 285 | 'untie' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [43] | ||||
| 286 | 'utf8' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x2a\x00\x00\x00\x00\x00\x00\x00", # [44,48..50] | ||||
| 287 | 'void' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00", # [45] | ||||
| 288 | ); | ||||
| 289 | |||||
| 290 | # These are used by various things, including our own tests | ||||
| 291 | 1 | 200ns | our $NONE = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; | ||
| 292 | 1 | 100ns | our $DEFAULT = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x00\x51\x51\x15\x54\x54\x55\x15"; # [2,4,22,23,25,52,54..56,58..62,65..67,69..78] | ||
| 293 | 1 | 100ns | our $LAST_BIT = 160 ; | ||
| 294 | 1 | 100ns | our $BYTES = 20 ; | ||
| 295 | |||||
| 296 | sub Croaker | ||||
| 297 | { | ||||
| 298 | require Carp; # this initializes %CarpInternal | ||||
| 299 | local $Carp::CarpInternal{'warnings'}; | ||||
| 300 | delete $Carp::CarpInternal{'warnings'}; | ||||
| 301 | Carp::croak(@_); | ||||
| 302 | } | ||||
| 303 | |||||
| 304 | sub _expand_bits { | ||||
| 305 | 397 | 52µs | my $bits = shift; | ||
| 306 | 397 | 84µs | my $want_len = ($LAST_BIT + 7) >> 3; | ||
| 307 | 397 | 50µs | my $len = length($bits); | ||
| 308 | 397 | 50µs | if ($len != $want_len) { | ||
| 309 | 46 | 21µs | if ($bits eq "") { | ||
| 310 | $bits = "\x00" x $want_len; | ||||
| 311 | } elsif ($len > $want_len) { | ||||
| 312 | substr $bits, $want_len, $len-$want_len, ""; | ||||
| 313 | } else { | ||||
| 314 | 46 | 34µs | my $x = vec($bits, $Offsets{all} >> 1, 2); | ||
| 315 | 46 | 16µs | $x |= $x << 2; | ||
| 316 | 46 | 6µs | $x |= $x << 4; | ||
| 317 | 46 | 46µs | $bits .= chr($x) x ($want_len - $len); | ||
| 318 | } | ||||
| 319 | } | ||||
| 320 | 397 | 399µs | return $bits; | ||
| 321 | } | ||||
| 322 | |||||
| 323 | # spent 1.20ms (911µs+285µs) within warnings::_bits which was called 304 times, avg 4µs/call:
# 304 times (911µs+285µs) by warnings::import at line 373, avg 4µs/call | ||||
| 324 | 304 | 39µs | my $mask = shift ; | ||
| 325 | 304 | 20µs | my $catmask ; | ||
| 326 | 304 | 30µs | my $fatal = 0 ; | ||
| 327 | 304 | 23µs | my $no_fatal = 0 ; | ||
| 328 | |||||
| 329 | 304 | 142µs | 304 | 285µs | $mask = _expand_bits($mask); # spent 285µs making 304 calls to warnings::_expand_bits, avg 937ns/call |
| 330 | 304 | 61µs | foreach my $word ( @_ ) { | ||
| 331 | 512 | 205µs | if ($word eq 'FATAL') { | ||
| 332 | 208 | 17µs | $fatal = 1; | ||
| 333 | 208 | 15µs | $no_fatal = 0; | ||
| 334 | } | ||||
| 335 | elsif ($word eq 'NONFATAL') { | ||||
| 336 | $fatal = 0; | ||||
| 337 | $no_fatal = 1; | ||||
| 338 | } | ||||
| 339 | elsif ($catmask = $Bits{$word}) { | ||||
| 340 | 304 | 60µs | $mask |= $catmask ; | ||
| 341 | 304 | 56µs | $mask |= $DeadBits{$word} if $fatal ; | ||
| 342 | 304 | 21µs | $mask = ~(~$mask | $DeadBits{$word}) if $no_fatal ; | ||
| 343 | } | ||||
| 344 | else | ||||
| 345 | { Croaker("Unknown warnings category '$word'")} | ||||
| 346 | } | ||||
| 347 | |||||
| 348 | 304 | 207µs | return $mask ; | ||
| 349 | } | ||||
| 350 | |||||
| 351 | sub bits | ||||
| 352 | { | ||||
| 353 | # called from B::Deparse.pm | ||||
| 354 | push @_, 'all' unless @_ ; | ||||
| 355 | return _bits("", @_) ; | ||||
| 356 | } | ||||
| 357 | |||||
| 358 | sub import | ||||
| 359 | # spent 2.20ms (953µs+1.24) within warnings::import which was called 79 times, avg 28µs/call:
# 3 times (360µs+658µs) by strictures::_enable_2 at line 171 of strictures.pm, avg 340µs/call
# 3 times (45µs+64µs) by strictures::_enable_2 at line 173 of strictures.pm, avg 36µs/call
# 3 times (18µs+25µs) by strictures::_enable_2 at line 170 of strictures.pm, avg 15µs/call
# once (10µs+9µs) by Data::Printer::Config::BEGIN@3 at line 3 of Data/Printer/Config.pm
# once (10µs+9µs) by Scalar::Util::BEGIN@10 at line 10 of Scalar/Util.pm
# once (10µs+10µs) by IPC::Run::IO::BEGIN@66 at line 66 of IPC/Run/IO.pm
# once (10µs+9µs) by ExtUtils::MakeMaker::Locale::BEGIN@4 at line 4 of ExtUtils/MakeMaker/Locale.pm
# once (10µs+9µs) by ExtUtils::MM_Any::BEGIN@4 at line 4 of ExtUtils/MM_Any.pm
# once (10µs+9µs) by ExtUtils::MakeMaker::version::BEGIN@15 at line 15 of ExtUtils/MakeMaker/version.pm
# once (10µs+9µs) by main::BEGIN@16.8 at line 16 of Getopt/Long.pm
# once (9µs+10µs) by Text::CSV_XS::BEGIN@22 at line 22 of Text/CSV_XS.pm
# once (9µs+9µs) by main::BEGIN@1.3 at line 1 of YAML/XS.pm
# once (9µs+9µs) by Carp::Assert::BEGIN@5 at line 5 of Carp/Assert.pm
# once (9µs+9µs) by re::BEGIN@5 at line 5 of re.pm
# once (10µs+9µs) by File::Basename::BEGIN@14 at line 14 of File/Basename.pm
# once (9µs+9µs) by Pod::Text::BEGIN@19 at line 19 of Pod/Text.pm
# once (10µs+8µs) by main::BEGIN@3.6 at line 3 of Capture/Tiny.pm
# once (9µs+9µs) by Text::ParseWords::BEGIN@4 at line 4 of Text/ParseWords.pm
# once (10µs+8µs) by builtin::BEGIN@4 at line 4 of builtin.pm
# once (9µs+9µs) by Encode::MIME::Name::BEGIN@3 at line 3 of Encode/MIME/Name.pm
# once (9µs+9µs) by File::Slurp::BEGIN@4 at line 4 of File/Slurp.pm
# once (9µs+8µs) by Encode::Encoding::BEGIN@5 at line 5 of Encode/Encoding.pm
# once (7µs+10µs) by overloading::BEGIN@2 at line 2 of overloading.pm
# once (9µs+8µs) by bytes::BEGIN@4 at line 4 of bytes.pm
# once (9µs+8µs) by IO::BEGIN@8 at line 8 of IO.pm
# once (9µs+8µs) by Symbol::BEGIN@4 at line 4 of Symbol.pm
# once (9µs+7µs) by Contextual::Return::Failure::BEGIN@7 at line 7 of Contextual/Return/Failure.pm
# once (9µs+8µs) by IO::Prompter::BEGIN@5 at line 5 of IO/Prompter.pm
# once (8µs+8µs) by strictures::BEGIN@4 at line 4 of strictures.pm
# once (9µs+7µs) by utf8::BEGIN@4 at line 4 of utf8.pm
# once (8µs+8µs) by IPC::Run::BEGIN@1014 at line 1014 of IPC/Run.pm
# once (8µs+7µs) by POSIX::BEGIN@3 at line 3 of POSIX.pm
# once (8µs+7µs) by ExtUtils::MM_Unix::BEGIN@6 at line 6 of ExtUtils/MM_Unix.pm
# once (8µs+7µs) by IPC::Run::Timer::BEGIN@161 at line 161 of IPC/Run/Timer.pm
# once (8µs+7µs) by Encode::Config::BEGIN@8 at line 8 of Encode/Config.pm
# once (8µs+7µs) by Data::Printer::Filter::GLOB::BEGIN@3 at line 3 of Data/Printer/Filter/GLOB.pm
# once (8µs+7µs) by Encode::Alias::BEGIN@3 at line 3 of Encode/Alias.pm
# once (8µs+7µs) by Want::BEGIN@6 at line 6 of Want.pm
# once (7µs+7µs) by Data::Printer::Theme::BEGIN@3 at line 3 of Data/Printer/Theme.pm
# once (7µs+7µs) by ExtUtils::MM::BEGIN@4 at line 4 of ExtUtils/MM.pm
# once (7µs+7µs) by Module::Load::BEGIN@4 at line 4 of Module/Load.pm
# once (8µs+6µs) by YAML::XS::LibYAML::BEGIN@4 at line 4 of YAML/XS/LibYAML.pm
# once (7µs+7µs) by Pod::Escapes::BEGIN@3 at line 3 of Pod/Escapes.pm
# once (5µs+8µs) by IPC::Run::BEGIN@1051 at line 1051 of IPC/Run.pm
# once (7µs+6µs) by Config::BEGIN@10 at line 10 of Config.pm
# once (7µs+6µs) by Module::Metadata::BEGIN@15 at line 15 of Module/Metadata.pm
# once (6µs+7µs) by List::Util::BEGIN@10 at line 10 of List/Util.pm
# once (7µs+6µs) by Data::Printer::Filter::SCALAR::BEGIN@3 at line 3 of Data/Printer/Filter/SCALAR.pm
# once (7µs+6µs) by Contextual::Return::BEGIN@2 at line 2 of Contextual/Return.pm
# once (7µs+6µs) by ExtUtils::MakeMaker::BEGIN@5 at line 5 of ExtUtils/MakeMaker.pm
# once (7µs+6µs) by Data::Printer::Filter::GenericClass::BEGIN@3 at line 3 of Data/Printer/Filter/GenericClass.pm
# once (6µs+6µs) by ExtUtils::Liblist::BEGIN@4 at line 4 of ExtUtils/Liblist.pm
# once (7µs+6µs) by Data::Printer::Filter::FORMAT::BEGIN@3 at line 3 of Data/Printer/Filter/FORMAT.pm
# once (7µs+6µs) by I18N::Langinfo::BEGIN@5 at line 5 of I18N/Langinfo.pm
# once (6µs+6µs) by Encode::BEGIN@6 at line 6 of Encode.pm
# once (7µs+5µs) by Data::Printer::Filter::HASH::BEGIN@3 at line 3 of Data/Printer/Filter/HASH.pm
# once (6µs+6µs) by Data::Printer::Filter::REF::BEGIN@3 at line 3 of Data/Printer/Filter/REF.pm
# once (6µs+6µs) by Data::Printer::BEGIN@3 at line 3 of Data/Printer.pm
# once (6µs+6µs) by Carp::BEGIN@5 at line 5 of Carp.pm
# once (6µs+6µs) by File::Find::BEGIN@4 at line 4 of File/Find.pm
# once (6µs+6µs) by diagnostics::BEGIN@1.1 at line 1 of Text/Tabs.pm
# once (6µs+6µs) by Data::Printer::Filter::ARRAY::BEGIN@3 at line 3 of Data/Printer/Filter/ARRAY.pm
# once (6µs+5µs) by ExtUtils::Liblist::Kid::BEGIN@13 at line 13 of ExtUtils/Liblist/Kid.pm
# once (6µs+5µs) by Data::Printer::Filter::VSTRING::BEGIN@3 at line 3 of Data/Printer/Filter/VSTRING.pm
# once (6µs+5µs) by Data::Printer::Filter::Regexp::BEGIN@3 at line 3 of Data/Printer/Filter/Regexp.pm
# once (6µs+5µs) by Config::BEGIN@6 at line 6 of Config_heavy.pl
# once (6µs+5µs) by Data::Printer::Filter::CODE::BEGIN@3 at line 3 of Data/Printer/Filter/CODE.pm
# once (6µs+5µs) by open::BEGIN@2 at line 2 of open.pm
# once (5µs+5µs) by Data::Printer::Filter::BEGIN@3 at line 3 of Data/Printer/Filter.pm
# once (6µs+4µs) by IPC::Run::Debug::BEGIN@70 at line 70 of IPC/Run/Debug.pm
# once (5µs+5µs) by ExtUtils::MakeMaker::Config::BEGIN@4 at line 4 of ExtUtils/MakeMaker/Config.pm
# once (5µs+4µs) by Data::Printer::BEGIN@2.27 at line 2 of Data/Printer/Object.pm
# once (4µs+4µs) by Data::Printer::Common::BEGIN@4 at line 4 of Data/Printer/Common.pm | ||||
| 360 | 79 | 22µs | my $invocant = shift; | ||
| 361 | |||||
| 362 | # append 'all' when implied (empty import list or after a lone | ||||
| 363 | # "FATAL" or "NONFATAL") | ||||
| 364 | 79 | 59µs | push @_, 'all' | ||
| 365 | if !@_ || (@_==1 && ($_[0] eq 'FATAL' || $_[0] eq 'NONFATAL')); | ||||
| 366 | |||||
| 367 | 79 | 25µs | my @fatal = (); | ||
| 368 | 79 | 159µs | foreach my $warning (@_) { | ||
| 369 | 308 | 392µs | 308 | 47µs | if($warning =~ /^(NON)?FATAL$/) { # spent 47µs making 308 calls to warnings::CORE:match, avg 153ns/call |
| 370 | @fatal = ($warning); | ||||
| 371 | } elsif(substr($warning, 0, 1) ne '-') { | ||||
| 372 | 304 | 122µs | my $mask = ${^WARNING_BITS} // ($^W ? $Bits{all} : $DEFAULT) ; | ||
| 373 | 304 | 207µs | 304 | 1.20ms | ${^WARNING_BITS} = _bits($mask, @fatal, $warning); # spent 1.20ms making 304 calls to warnings::_bits, avg 4µs/call |
| 374 | } else { | ||||
| 375 | $invocant->unimport(substr($warning, 1)); | ||||
| 376 | } | ||||
| 377 | } | ||||
| 378 | } | ||||
| 379 | |||||
| 380 | sub unimport | ||||
| 381 | # spent 889µs (622+267) within warnings::unimport which was called 93 times, avg 10µs/call:
# 3 times (20µs+14µs) by Contextual::Return::BEGIN@246 or Contextual::Return::BEGIN@252 or IO::Prompter::BEGIN@6 at line 17 of if.pm, avg 11µs/call
# 3 times (23µs+2µs) by strictures::_enable_2 at line 172 of strictures.pm, avg 8µs/call
# 3 times (11µs+2µs) by strictures::_enable_2 at line 174 of strictures.pm, avg 4µs/call
# once (12µs+7µs) by ExtUtils::MM_Any::BEGIN@1674 at line 1674 of ExtUtils/MM_Any.pm
# once (11µs+8µs) by ExtUtils::MM_Unix::BEGIN@2985 at line 2985 of ExtUtils/MM_Unix.pm
# once (11µs+7µs) by ExtUtils::MakeMaker::BEGIN@978 at line 978 of ExtUtils/MakeMaker.pm
# once (11µs+7µs) by Module::Metadata::BEGIN@767 at line 767 of Module/Metadata.pm
# once (10µs+6µs) by Text::ParseWords::BEGIN@55 at line 55 of Text/ParseWords.pm
# once (9µs+6µs) by Data::Printer::BEGIN@47 at line 47 of Data/Printer.pm
# once (12µs+3µs) by Pod::Simple::BlackBox::BEGIN@1 at line 1 of (eval 27)[Pod/Simple/BlackBox.pm:40]
# once (8µs+6µs) by Data::Printer::Common::BEGIN@206 at line 206 of Data/Printer/Common.pm
# once (9µs+6µs) by Contextual::Return::BEGIN@370 at line 370 of Contextual/Return.pm
# once (9µs+6µs) by Text::CSV_XS::BEGIN@57 at line 57 of Text/CSV_XS.pm
# once (9µs+5µs) by Data::Printer::Filter::GLOB::BEGIN@22 at line 22 of Data/Printer/Filter/GLOB.pm
# once (12µs+3µs) by Exporter::Heavy::BEGIN@188 at line 188 of Exporter/Heavy.pm
# once (11µs+3µs) by Storable::BEGIN@66 at line 66 of Storable.pm
# once (11µs+3µs) by IPC::Open3::BEGIN@295 at line 295 of IPC/Open3.pm
# once (8µs+5µs) by ExtUtils::MakeMaker::Locale::BEGIN@142 at line 142 of ExtUtils/MakeMaker/Locale.pm
# once (8µs+5µs) by ExtUtils::MakeMaker::version::BEGIN@29 at line 29 of ExtUtils/MakeMaker/version.pm
# once (8µs+5µs) by main::BEGIN@42 at line 42 of /home/hejohns/documentsNoSync/22f/490/gradescope-utils/bin/split.pl
# once (8µs+5µs) by Data::Printer::Filter::SCALAR::BEGIN@28 at line 28 of Data/Printer/Filter/SCALAR.pm
# once (10µs+2µs) by Module::Load::Conditional::BEGIN@323 at line 323 of Module/Load/Conditional.pm
# once (10µs+3µs) by Pod::Simple::BlackBox::BEGIN@1.25 at line 1 of (eval 44)[Pod/Simple/BlackBox.pm:40]
# once (6µs+6µs) by Contextual::Return::BEGIN@711 at line 711 of Contextual/Return.pm
# once (10µs+3µs) by IO::Prompter::BEGIN@743 at line 743 of IO/Prompter.pm
# once (10µs+3µs) by Pod::Simple::BlackBox::BEGIN@67 at line 67 of Pod/Simple/BlackBox.pm
# once (8µs+4µs) by Contextual::Return::BEGIN@967 at line 967 of Contextual/Return.pm
# once (10µs+2µs) by overload::BEGIN@5 at line 5 of overload.pm
# once (6µs+5µs) by Contextual::Return::BEGIN@13 at line 13 of Contextual/Return.pm
# once (9µs+2µs) by Carp::BEGIN@742 at line 742 of Carp.pm
# once (8µs+3µs) by IO::Prompter::BEGIN@105 at line 105 of IO/Prompter.pm
# once (6µs+4µs) by Contextual::Return::Value::BEGIN@1575 at line 1575 of Contextual/Return.pm
# once (6µs+4µs) by Contextual::Return::Value::BEGIN@1476 at line 1476 of Contextual/Return.pm
# once (6µs+4µs) by Contextual::Return::Value::BEGIN@1531 at line 1531 of Contextual/Return.pm
# once (6µs+4µs) by Data::Printer::BEGIN@60 at line 60 of Data/Printer.pm
# once (6µs+4µs) by Contextual::Return::Value::BEGIN@1426 at line 1426 of Contextual/Return.pm
# once (6µs+4µs) by Contextual::Return::BEGIN@499 at line 499 of Contextual/Return.pm
# once (8µs+2µs) by IO::Prompter::BEGIN@394 at line 394 of IO/Prompter.pm
# once (6µs+4µs) by Contextual::Return::Value::BEGIN@1290 at line 1290 of Contextual/Return.pm
# once (6µs+4µs) by Contextual::Return::Value::BEGIN@1376 at line 1376 of Contextual/Return.pm
# once (8µs+2µs) by IO::Prompter::BEGIN@942 at line 942 of IO/Prompter.pm
# once (6µs+3µs) by Contextual::Return::Value::BEGIN@1232 at line 1232 of Contextual/Return.pm
# once (6µs+4µs) by Text::ParseWords::BEGIN@123 at line 123 of Text/ParseWords.pm
# once (6µs+3µs) by Contextual::Return::Lvalue::BEGIN@1705 at line 1705 of Contextual/Return.pm
# once (5µs+4µs) by ExtUtils::MakeMaker::_version::BEGIN@3022 at line 3022 of ExtUtils/MM_Unix.pm
# once (6µs+4µs) by Contextual::Return::Value::BEGIN@1083 at line 1083 of Contextual/Return.pm
# once (6µs+3µs) by Contextual::Return::Value::BEGIN@1130 at line 1130 of Contextual/Return.pm
# once (8µs+2µs) by Pod::Simple::BlackBox::BEGIN@273 at line 273 of Pod/Simple/BlackBox.pm
# once (6µs+4µs) by Contextual::Return::BEGIN@845 at line 845 of Contextual/Return.pm
# once (6µs+4µs) by Contextual::Return::BEGIN@589 at line 589 of Contextual/Return.pm
# once (6µs+3µs) by Contextual::Return::Value::BEGIN@1176 at line 1176 of Contextual/Return.pm
# once (8µs+2µs) by File::Glob::BEGIN@50 at line 50 of File/Glob.pm
# once (6µs+3µs) by Contextual::Return::BEGIN@290 at line 290 of Contextual/Return.pm
# once (6µs+3µs) by Contextual::Return::BEGIN@1000 at line 1000 of Contextual/Return.pm
# once (6µs+3µs) by Contextual::Return::BEGIN@341 at line 341 of Contextual/Return.pm
# once (7µs+2µs) by IO::Prompter::BEGIN@971 at line 971 of IO/Prompter.pm
# once (7µs+2µs) by IO::Prompter::BEGIN@1171 at line 1171 of IO/Prompter.pm
# once (5µs+3µs) by Contextual::Return::Lvalue::BEGIN@1717 at line 1717 of Contextual/Return.pm
# once (7µs+2µs) by IO::Prompter::BEGIN@268 at line 268 of IO/Prompter.pm
# once (7µs+1µs) by IO::Prompter::BEGIN@156 at line 156 of IO/Prompter.pm
# once (6µs+2µs) by main::BEGIN@44 at line 44 of /home/hejohns/documentsNoSync/22f/490/gradescope-utils/bin/split.pl
# once (7µs+2µs) by strictures::BEGIN@97 at line 97 of strictures.pm
# once (6µs+2µs) by IO::Prompter::BEGIN@1059 at line 1059 of IO/Prompter.pm
# once (6µs+1µs) by Carp::BEGIN@6 at line 24 of Carp.pm
# once (6µs+2µs) by Contextual::Return::BEGIN@87 at line 87 of Contextual/Return.pm
# once (5µs+2µs) by Gradescope::Color::BEGIN@13 at line 13 of /home/hejohns/documentsNoSync/22f/490/gradescope-utils/lib/Gradescope/Color.pm
# once (6µs+1µs) by IO::Prompter::BEGIN@752 at line 752 of IO/Prompter.pm
# once (5µs+1µs) by Pod::Simple::BlackBox::BEGIN@1.9 at line 1 of (eval 28)[Pod/Simple/BlackBox.pm:44]
# once (5µs+1µs) by Pod::Simple::BlackBox::BEGIN@1.16 at line 1 of (eval 35)[Pod/Simple/BlackBox.pm:74]
# once (5µs+2µs) by Pod::Simple::BlackBox::BEGIN@1.26 at line 1 of (eval 45)[Pod/Simple/BlackBox.pm:44]
# once (5µs+1µs) by Gradescope::Translate::BEGIN@11 at line 11 of /home/hejohns/documentsNoSync/22f/490/gradescope-utils/lib/Gradescope/Translate.pm
# once (5µs+1µs) by Gradescope::Color::BEGIN@11 at line 11 of /home/hejohns/documentsNoSync/22f/490/gradescope-utils/lib/Gradescope/Color.pm
# once (5µs+1000ns) by Gradescope::Translate::BEGIN@13 at line 13 of /home/hejohns/documentsNoSync/22f/490/gradescope-utils/lib/Gradescope/Translate.pm
# once (4µs+1µs) by Pod::Simple::BlackBox::BEGIN@1.10 at line 1 of (eval 29)[Pod/Simple/BlackBox.pm:40]
# once (4µs+1µs) by Pod::Simple::BlackBox::BEGIN@1.11 at line 1 of (eval 30)[Pod/Simple/BlackBox.pm:44]
# once (4µs+1µs) by Pod::Simple::BlackBox::BEGIN@1.22 at line 1 of (eval 41)[Pod/Simple/BlackBox.pm:44]
# once (4µs+900ns) by Pod::Simple::BlackBox::BEGIN@1.12 at line 1 of (eval 31)[Pod/Simple/BlackBox.pm:40]
# once (4µs+1000ns) by Pod::Simple::BlackBox::BEGIN@1.19 at line 1 of (eval 38)[Pod/Simple/BlackBox.pm:40]
# once (4µs+1000ns) by Pod::Simple::BlackBox::BEGIN@1.15 at line 1 of (eval 34)[Pod/Simple/BlackBox.pm:44]
# once (4µs+1000ns) by Pod::Simple::BlackBox::BEGIN@1.20 at line 1 of (eval 39)[Pod/Simple/BlackBox.pm:44]
# once (4µs+1000ns) by Pod::Simple::BlackBox::BEGIN@1.23 at line 1 of (eval 42)[Pod/Simple/BlackBox.pm:40]
# once (4µs+900ns) by Pod::Simple::BlackBox::BEGIN@1.18 at line 1 of (eval 37)[Pod/Simple/BlackBox.pm:44]
# once (4µs+900ns) by Pod::Simple::BlackBox::BEGIN@1.13 at line 1 of (eval 32)[Pod/Simple/BlackBox.pm:44]
# once (4µs+1µs) by Pod::Simple::BlackBox::BEGIN@1.21 at line 1 of (eval 40)[Pod/Simple/BlackBox.pm:40]
# once (4µs+800ns) by Pod::Simple::BlackBox::BEGIN@1.17 at line 1 of (eval 36)[Pod/Simple/BlackBox.pm:40]
# once (4µs+1µs) by Pod::Simple::BlackBox::BEGIN@1.14 at line 1 of (eval 33)[Pod/Simple/BlackBox.pm:40]
# once (3µs+1µs) by Pod::Simple::BlackBox::BEGIN@1.24 at line 1 of (eval 43)[Pod/Simple/BlackBox.pm:44] | ||||
| 382 | 93 | 12µs | shift; | ||
| 383 | |||||
| 384 | 93 | 10µs | my $catmask ; | ||
| 385 | 93 | 72µs | my $mask = ${^WARNING_BITS} // ($^W ? $Bits{all} : $DEFAULT) ; | ||
| 386 | |||||
| 387 | # append 'all' when implied (empty import list or after a lone "FATAL") | ||||
| 388 | 93 | 54µs | push @_, 'all' if !@_ || @_==1 && $_[0] eq 'FATAL'; | ||
| 389 | |||||
| 390 | 93 | 79µs | 93 | 268µs | $mask = _expand_bits($mask); # spent 268µs making 93 calls to warnings::_expand_bits, avg 3µs/call |
| 391 | 93 | 38µs | foreach my $word ( @_ ) { | ||
| 392 | 120 | 163µs | if ($word eq 'FATAL') { | ||
| 393 | 3 | 1µs | next; | ||
| 394 | } | ||||
| 395 | elsif ($catmask = $Bits{$word}) { | ||||
| 396 | $mask = ~(~$mask | $catmask | $DeadBits{$word}); | ||||
| 397 | } | ||||
| 398 | else | ||||
| 399 | { Croaker("Unknown warnings category '$word'")} | ||||
| 400 | } | ||||
| 401 | |||||
| 402 | 93 | 217µs | ${^WARNING_BITS} = $mask ; | ||
| 403 | } | ||||
| 404 | |||||
| 405 | 2 | 2µs | my %builtin_type; @builtin_type{qw(SCALAR ARRAY HASH CODE REF GLOB LVALUE Regexp)} = (); | ||
| 406 | |||||
| 407 | sub LEVEL () { 8 }; | ||||
| 408 | sub MESSAGE () { 4 }; | ||||
| 409 | sub FATAL () { 2 }; | ||||
| 410 | sub NORMAL () { 1 }; | ||||
| 411 | |||||
| 412 | sub __chk | ||||
| 413 | { | ||||
| 414 | my $category ; | ||||
| 415 | my $offset ; | ||||
| 416 | my $isobj = 0 ; | ||||
| 417 | my $wanted = shift; | ||||
| 418 | my $has_message = $wanted & MESSAGE; | ||||
| 419 | my $has_level = $wanted & LEVEL ; | ||||
| 420 | |||||
| 421 | if ($has_level) { | ||||
| 422 | if (@_ != ($has_message ? 3 : 2)) { | ||||
| 423 | my $sub = (caller 1)[3]; | ||||
| 424 | my $syntax = $has_message | ||||
| 425 | ? "category, level, 'message'" | ||||
| 426 | : 'category, level'; | ||||
| 427 | Croaker("Usage: $sub($syntax)"); | ||||
| 428 | } | ||||
| 429 | } | ||||
| 430 | elsif (not @_ == 1 || @_ == ($has_message ? 2 : 0)) { | ||||
| 431 | my $sub = (caller 1)[3]; | ||||
| 432 | my $syntax = $has_message ? "[category,] 'message'" : '[category]'; | ||||
| 433 | Croaker("Usage: $sub($syntax)"); | ||||
| 434 | } | ||||
| 435 | |||||
| 436 | my $message = pop if $has_message; | ||||
| 437 | |||||
| 438 | if (@_) { | ||||
| 439 | # check the category supplied. | ||||
| 440 | $category = shift ; | ||||
| 441 | if (my $type = ref $category) { | ||||
| 442 | Croaker("not an object") | ||||
| 443 | if exists $builtin_type{$type}; | ||||
| 444 | $category = $type; | ||||
| 445 | $isobj = 1 ; | ||||
| 446 | } | ||||
| 447 | $offset = $Offsets{$category}; | ||||
| 448 | Croaker("Unknown warnings category '$category'") | ||||
| 449 | unless defined $offset; | ||||
| 450 | } | ||||
| 451 | else { | ||||
| 452 | $category = (caller(1))[0] ; | ||||
| 453 | $offset = $Offsets{$category}; | ||||
| 454 | Croaker("package '$category' not registered for warnings") | ||||
| 455 | unless defined $offset ; | ||||
| 456 | } | ||||
| 457 | |||||
| 458 | my $i; | ||||
| 459 | |||||
| 460 | if ($isobj) { | ||||
| 461 | my $pkg; | ||||
| 462 | $i = 2; | ||||
| 463 | while (do { { package DB; $pkg = (caller($i++))[0] } } ) { | ||||
| 464 | last unless @DB::args && $DB::args[0] =~ /^$category=/ ; | ||||
| 465 | } | ||||
| 466 | $i -= 2 ; | ||||
| 467 | } | ||||
| 468 | elsif ($has_level) { | ||||
| 469 | $i = 2 + shift; | ||||
| 470 | } | ||||
| 471 | else { | ||||
| 472 | $i = _error_loc(); # see where Carp will allocate the error | ||||
| 473 | } | ||||
| 474 | |||||
| 475 | # Default to 0 if caller returns nothing. Default to $DEFAULT if it | ||||
| 476 | # explicitly returns undef. | ||||
| 477 | my(@callers_bitmask) = (caller($i))[9] ; | ||||
| 478 | my $callers_bitmask = | ||||
| 479 | @callers_bitmask ? $callers_bitmask[0] // $DEFAULT : 0 ; | ||||
| 480 | length($callers_bitmask) > ($offset >> 3) or $offset = $Offsets{all}; | ||||
| 481 | |||||
| 482 | my @results; | ||||
| 483 | foreach my $type (FATAL, NORMAL) { | ||||
| 484 | next unless $wanted & $type; | ||||
| 485 | |||||
| 486 | push @results, vec($callers_bitmask, $offset + $type - 1, 1); | ||||
| 487 | } | ||||
| 488 | |||||
| 489 | # &enabled and &fatal_enabled | ||||
| 490 | return $results[0] unless $has_message; | ||||
| 491 | |||||
| 492 | # &warnif, and the category is neither enabled as warning nor as fatal | ||||
| 493 | return if ($wanted & (NORMAL | FATAL | MESSAGE)) | ||||
| 494 | == (NORMAL | FATAL | MESSAGE) | ||||
| 495 | && !($results[0] || $results[1]); | ||||
| 496 | |||||
| 497 | # If we have an explicit level, bypass Carp. | ||||
| 498 | if ($has_level and @callers_bitmask) { | ||||
| 499 | # logic copied from util.c:mess_sv | ||||
| 500 | my $stuff = " at " . join " line ", (caller $i)[1,2]; | ||||
| 501 | $stuff .= sprintf ", <%s> %s %d", | ||||
| 502 | *${^LAST_FH}{NAME}, | ||||
| 503 | ($/ eq "\n" ? "line" : "chunk"), $. | ||||
| 504 | if $. && ${^LAST_FH}; | ||||
| 505 | die "$message$stuff.\n" if $results[0]; | ||||
| 506 | return warn "$message$stuff.\n"; | ||||
| 507 | } | ||||
| 508 | |||||
| 509 | require Carp; | ||||
| 510 | Carp::croak($message) if $results[0]; | ||||
| 511 | # will always get here for &warn. will only get here for &warnif if the | ||||
| 512 | # category is enabled | ||||
| 513 | Carp::carp($message); | ||||
| 514 | } | ||||
| 515 | |||||
| 516 | sub _mkMask | ||||
| 517 | { | ||||
| 518 | 16 | 3µs | my ($bit) = @_; | ||
| 519 | 16 | 3µs | my $mask = ""; | ||
| 520 | |||||
| 521 | 16 | 19µs | vec($mask, $bit, 1) = 1; | ||
| 522 | 16 | 25µs | return $mask; | ||
| 523 | } | ||||
| 524 | |||||
| 525 | sub register_categories | ||||
| 526 | # spent 114µs (77+37) within warnings::register_categories which was called 9 times, avg 13µs/call:
# 8 times (74µs+37µs) by warnings::register::import at line 23 of warnings/register.pm, avg 14µs/call
# once (2µs+0s) by Module::Load::Conditional::BEGIN@12 at line 7 of version.pm | ||||
| 527 | 9 | 5µs | my @names = @_; | ||
| 528 | |||||
| 529 | 9 | 15µs | for my $name (@names) { | ||
| 530 | 9 | 7µs | if (! defined $Bits{$name}) { | ||
| 531 | 8 | 7µs | $Offsets{$name} = $LAST_BIT; | ||
| 532 | 8 | 16µs | 8 | 29µs | $Bits{$name} = _mkMask($LAST_BIT++); # spent 29µs making 8 calls to warnings::_mkMask, avg 4µs/call |
| 533 | 8 | 8µs | 8 | 8µs | $DeadBits{$name} = _mkMask($LAST_BIT++); # spent 8µs making 8 calls to warnings::_mkMask, avg 1µs/call |
| 534 | 8 | 6µs | if (length($Bits{$name}) > length($Bits{all})) { | ||
| 535 | 2 | 700ns | $Bits{all} .= "\x55"; | ||
| 536 | 2 | 900ns | $DeadBits{all} .= "\xaa"; | ||
| 537 | } | ||||
| 538 | } | ||||
| 539 | } | ||||
| 540 | } | ||||
| 541 | |||||
| 542 | sub _error_loc { | ||||
| 543 | require Carp; | ||||
| 544 | goto &Carp::short_error_loc; # don't introduce another stack frame | ||||
| 545 | } | ||||
| 546 | |||||
| 547 | sub enabled | ||||
| 548 | { | ||||
| 549 | return __chk(NORMAL, @_); | ||||
| 550 | } | ||||
| 551 | |||||
| 552 | sub fatal_enabled | ||||
| 553 | { | ||||
| 554 | return __chk(FATAL, @_); | ||||
| 555 | } | ||||
| 556 | |||||
| 557 | sub warn | ||||
| 558 | { | ||||
| 559 | return __chk(FATAL | MESSAGE, @_); | ||||
| 560 | } | ||||
| 561 | |||||
| 562 | sub warnif | ||||
| 563 | { | ||||
| 564 | return __chk(NORMAL | FATAL | MESSAGE, @_); | ||||
| 565 | } | ||||
| 566 | |||||
| 567 | sub enabled_at_level | ||||
| 568 | { | ||||
| 569 | return __chk(NORMAL | LEVEL, @_); | ||||
| 570 | } | ||||
| 571 | |||||
| 572 | sub fatal_enabled_at_level | ||||
| 573 | { | ||||
| 574 | return __chk(FATAL | LEVEL, @_); | ||||
| 575 | } | ||||
| 576 | |||||
| 577 | sub warn_at_level | ||||
| 578 | { | ||||
| 579 | return __chk(FATAL | MESSAGE | LEVEL, @_); | ||||
| 580 | } | ||||
| 581 | |||||
| 582 | sub warnif_at_level | ||||
| 583 | { | ||||
| 584 | return __chk(NORMAL | FATAL | MESSAGE | LEVEL, @_); | ||||
| 585 | } | ||||
| 586 | |||||
| 587 | # These are not part of any public interface, so we can delete them to save | ||||
| 588 | # space. | ||||
| 589 | 1 | 3µs | delete @warnings::{qw(NORMAL FATAL MESSAGE LEVEL)}; | ||
| 590 | |||||
| 591 | 1 | 26µs | 1; | ||
| 592 | __END__ | ||||
sub warnings::CORE:match; # opcode |