| Filename | /usr/share/perl5/Moo/HandleMoose/_TypeMap.pm | 
| Statements | Executed 0 statements in 0s | 
| Calls | P | F | Exclusive Time  | 
        Inclusive Time  | 
        Subroutine | 
|---|---|---|---|---|---|
| 1 | 1 | 1 | 16µs | 53µs | Moo::HandleMoose::_TypeMap::BEGIN@2 | 
| 1 | 1 | 1 | 9µs | 18µs | Moo::HandleMoose::_TypeMap::BEGIN@21 | 
| 1 | 1 | 1 | 8µs | 16µs | Moo::HandleMoose::_TypeMap::BEGIN@11 | 
| 1 | 1 | 1 | 5µs | 5µs | Moo::HandleMoose::_TypeMap::CLEAR | 
| 1 | 1 | 1 | 5µs | 5µs | Moo::HandleMoose::_TypeMap::BEGIN@10 | 
| 1 | 1 | 1 | 2µs | 2µs | Moo::HandleMoose::_TypeMap::TIEHASH | 
| 0 | 0 | 0 | 0s | 0s | Moo::HandleMoose::_TypeMap::CLONE | 
| 0 | 0 | 0 | 0s | 0s | Moo::HandleMoose::_TypeMap::DELETE | 
| 0 | 0 | 0 | 0s | 0s | Moo::HandleMoose::_TypeMap::DESTROY | 
| 0 | 0 | 0 | 0s | 0s | Moo::HandleMoose::_TypeMap::EXISTS | 
| 0 | 0 | 0 | 0s | 0s | Moo::HandleMoose::_TypeMap::FETCH | 
| 0 | 0 | 0 | 0s | 0s | Moo::HandleMoose::_TypeMap::FIRSTKEY | 
| 0 | 0 | 0 | 0s | 0s | Moo::HandleMoose::_TypeMap::NEXTKEY | 
| 0 | 0 | 0 | 0s | 0s | Moo::HandleMoose::_TypeMap::SCALAR | 
| 0 | 0 | 0 | 0s | 0s | Moo::HandleMoose::_TypeMap::STORE | 
| 0 | 0 | 0 | 0s | 0s | Moo::HandleMoose::_TypeMap::_str_to_ref | 
| Line | State ments  | 
      Time on line  | 
      Calls | Time in subs  | 
      Code | 
|---|---|---|---|---|---|
| 1 | package Moo::HandleMoose::_TypeMap; | ||||
| 2 | 3 | 89µs | # spent 53µs (16+36) within Moo::HandleMoose::_TypeMap::BEGIN@2 which was called:
#    once (16µs+36µs) by Sub::Defer::BEGIN@5 at line 2 # spent    53µs making 1 call to Moo::HandleMoose::_TypeMap::BEGIN@2
# spent    21µs making 1 call to strictures::import
# spent    16µs making 1 call to strictures::VERSION  | ||
| 3 | |||||
| 4 | package | ||||
| 5 | Moo::HandleMoose; | ||||
| 6 | our %TYPE_MAP; | ||||
| 7 | |||||
| 8 | package Moo::HandleMoose::_TypeMap; | ||||
| 9 | |||||
| 10 | 1 | 5µs | # spent 5µs within Moo::HandleMoose::_TypeMap::BEGIN@10 which was called:
#    once (5µs+0s) by Sub::Defer::BEGIN@5 at line 10 # spent     5µs making 1 call to Moo::HandleMoose::_TypeMap::BEGIN@10  | ||
| 11 | 2 | 24µs | # spent 16µs (8+8) within Moo::HandleMoose::_TypeMap::BEGIN@11 which was called:
#    once (8µs+8µs) by Sub::Defer::BEGIN@5 at line 11 # spent    16µs making 1 call to Moo::HandleMoose::_TypeMap::BEGIN@11
# spent     8µs making 1 call to Config::import  | ||
| 12 | |||||
| 13 | our %WEAK_TYPES; | ||||
| 14 | |||||
| 15 | sub _str_to_ref { | ||||
| 16 | my $in = shift; | ||||
| 17 | return $in | ||||
| 18 | if ref $in; | ||||
| 19 | |||||
| 20 | if ($in =~ /(?:^|=)[A-Z]+\(0x([0-9a-zA-Z]+)\)$/) { | ||||
| 21 | 2 | 27µs | # spent 18µs (9+9) within Moo::HandleMoose::_TypeMap::BEGIN@21 which was called:
#    once (9µs+9µs) by Sub::Defer::BEGIN@5 at line 21     # spent    18µs making 1 call to Moo::HandleMoose::_TypeMap::BEGIN@21
    # spent     9µs making 1 call to warnings::unimport  | ||
| 22 | require B; | ||||
| 23 | my $sv = bless \$id, 'B::SV'; | ||||
| 24 | my $ref = eval { $sv->object_2svref }; | ||||
| 25 | if (!defined $ref) { | ||||
| 26 | die <<'END_ERROR'; | ||||
| 27 | Moo initialization encountered types defined in a parent thread - ensure that | ||||
| 28 | Moo is require()d before any further thread spawns following a type definition. | ||||
| 29 | END_ERROR | ||||
| 30 | } | ||||
| 31 | return $ref; | ||||
| 32 | } | ||||
| 33 | return $in; | ||||
| 34 | } | ||||
| 35 | |||||
| 36 | # spent 2µs within Moo::HandleMoose::_TypeMap::TIEHASH which was called:
#    once (2µs+0s) by Sub::Defer::BEGIN@5 at line 71  | ||||
| 37 | |||||
| 38 | sub STORE { | ||||
| 39 | my ($self, $key, $value) = @_; | ||||
| 40 | my $type = _str_to_ref($key); | ||||
| 41 | $WEAK_TYPES{$type} = $type; | ||||
| 42 | Scalar::Util::weaken($WEAK_TYPES{$type}) | ||||
| 43 | if ref $type; | ||||
| 44 | $self->{$key} = $value; | ||||
| 45 | } | ||||
| 46 | |||||
| 47 | sub FETCH { $_[0]->{$_[1]} } | ||||
| 48 | sub FIRSTKEY { my $a = scalar keys %{$_[0]}; each %{$_[0]} } | ||||
| 49 | sub NEXTKEY { each %{$_[0]} } | ||||
| 50 | sub EXISTS { exists $_[0]->{$_[1]} } | ||||
| 51 | sub DELETE { delete $_[0]->{$_[1]} } | ||||
| 52 | # spent 5µs within Moo::HandleMoose::_TypeMap::CLEAR which was called:
#    once (5µs+0s) by Sub::Defer::BEGIN@5 at line 72  | ||||
| 53 | sub SCALAR { scalar %{$_[0]} } | ||||
| 54 | |||||
| 55 | sub CLONE { | ||||
| 56 | my @types = map { | ||||
| 57 | defined $WEAK_TYPES{$_} ? ($WEAK_TYPES{$_} => $TYPE_MAP{$_}) : () | ||||
| 58 | } keys %TYPE_MAP; | ||||
| 59 | %WEAK_TYPES = (); | ||||
| 60 | %TYPE_MAP = @types; | ||||
| 61 | } | ||||
| 62 | |||||
| 63 | sub DESTROY { | ||||
| 64 | my %types = %{$_[0]}; | ||||
| 65 | untie %TYPE_MAP; | ||||
| 66 | %TYPE_MAP = %types; | ||||
| 67 | } | ||||
| 68 | |||||
| 69 | 1 | 3µs | if ($Config{useithreads}) { # spent     3µs making 1 call to Config::FETCH  | ||
| 70 | my @types = %TYPE_MAP; | ||||
| 71 | 1 | 2µs |   tie %TYPE_MAP, __PACKAGE__;   # spent     2µs making 1 call to Moo::HandleMoose::_TypeMap::TIEHASH  | ||
| 72 | 1 | 5µs |   %TYPE_MAP = @types;   # spent     5µs making 1 call to Moo::HandleMoose::_TypeMap::CLEAR  | ||
| 73 | } | ||||
| 74 | |||||
| 75 | 1; |