| Filename | /home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Moose/Meta/Method/Accessor/Native/String/replace.pm |
| Statements | Executed 23 statements in 1.55ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 154µs | 173µs | Moose::Meta::Method::Accessor::Native::String::replace::BEGIN@3 |
| 1 | 1 | 1 | 45µs | 785µs | Moose::Meta::Method::Accessor::Native::String::replace::BEGIN@54 |
| 1 | 1 | 1 | 43µs | 112µs | Moose::Meta::Method::Accessor::Native::String::replace::BEGIN@4 |
| 1 | 1 | 1 | 42µs | 14.7ms | Moose::Meta::Method::Accessor::Native::String::replace::BEGIN@13 |
| 1 | 1 | 1 | 22µs | 22µs | Moose::Meta::Method::Accessor::Native::String::replace::BEGIN@6 |
| 1 | 1 | 1 | 20µs | 20µs | Moose::Meta::Method::Accessor::Native::String::replace::BEGIN@7 |
| 0 | 0 | 0 | 0s | 0s | Moose::Meta::Method::Accessor::Native::String::replace::_inline_check_arguments |
| 0 | 0 | 0 | 0s | 0s | Moose::Meta::Method::Accessor::Native::String::replace::_inline_optimized_set_new_value |
| 0 | 0 | 0 | 0s | 0s | Moose::Meta::Method::Accessor::Native::String::replace::_maximum_arguments |
| 0 | 0 | 0 | 0s | 0s | Moose::Meta::Method::Accessor::Native::String::replace::_minimum_arguments |
| 0 | 0 | 0 | 0s | 0s | Moose::Meta::Method::Accessor::Native::String::replace::_potential_value |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package Moose::Meta::Method::Accessor::Native::String::replace; | ||||
| 2 | |||||
| 3 | 3 | 114µs | 2 | 192µs | # spent 173µs (154+19) within Moose::Meta::Method::Accessor::Native::String::replace::BEGIN@3 which was called:
# once (154µs+19µs) by Moose::Meta::Attribute::Native::Trait::String::BEGIN@16 at line 3 # spent 173µs making 1 call to Moose::Meta::Method::Accessor::Native::String::replace::BEGIN@3
# spent 19µs making 1 call to strict::import |
| 4 | 3 | 103µs | 2 | 182µs | # spent 112µs (43+70) within Moose::Meta::Method::Accessor::Native::String::replace::BEGIN@4 which was called:
# once (43µs+70µs) by Moose::Meta::Attribute::Native::Trait::String::BEGIN@16 at line 4 # spent 112µs making 1 call to Moose::Meta::Method::Accessor::Native::String::replace::BEGIN@4
# spent 70µs making 1 call to warnings::import |
| 5 | |||||
| 6 | 3 | 80µs | 1 | 22µs | # spent 22µs within Moose::Meta::Method::Accessor::Native::String::replace::BEGIN@6 which was called:
# once (22µs+0s) by Moose::Meta::Attribute::Native::Trait::String::BEGIN@16 at line 6 # spent 22µs making 1 call to Moose::Meta::Method::Accessor::Native::String::replace::BEGIN@6 |
| 7 | 3 | 222µs | 1 | 20µs | # spent 20µs within Moose::Meta::Method::Accessor::Native::String::replace::BEGIN@7 which was called:
# once (20µs+0s) by Moose::Meta::Attribute::Native::Trait::String::BEGIN@16 at line 7 # spent 20µs making 1 call to Moose::Meta::Method::Accessor::Native::String::replace::BEGIN@7 |
| 8 | |||||
| 9 | 1 | 4µs | our $VERSION = '1.19'; | ||
| 10 | 1 | 91µs | $VERSION = eval $VERSION; # spent 14µs executing statements in string eval | ||
| 11 | 1 | 5µs | our $AUTHORITY = 'cpan:STEVAN'; | ||
| 12 | |||||
| 13 | 3 | 727µs | 2 | 29.3ms | # spent 14.7ms (42µs+14.6) within Moose::Meta::Method::Accessor::Native::String::replace::BEGIN@13 which was called:
# once (42µs+14.6ms) by Moose::Meta::Attribute::Native::Trait::String::BEGIN@16 at line 13 # spent 14.7ms making 1 call to Moose::Meta::Method::Accessor::Native::String::replace::BEGIN@13
# spent 14.6ms making 1 call to Moose::Exporter::__ANON__[Moose/Exporter.pm:456] |
| 14 | |||||
| 15 | 1 | 39µs | 1 | 31.4ms | with 'Moose::Meta::Method::Accessor::Native::Writer' => { # spent 31.4ms making 1 call to Moose::Role::with |
| 16 | -excludes => [ | ||||
| 17 | qw( | ||||
| 18 | _minimum_arguments | ||||
| 19 | _maximum_arguments | ||||
| 20 | _inline_check_arguments | ||||
| 21 | _inline_optimized_set_new_value | ||||
| 22 | ) | ||||
| 23 | ] | ||||
| 24 | }; | ||||
| 25 | |||||
| 26 | sub _minimum_arguments { 1 } | ||||
| 27 | |||||
| 28 | sub _maximum_arguments { 2 } | ||||
| 29 | |||||
| 30 | sub _inline_check_arguments { | ||||
| 31 | my $self = shift; | ||||
| 32 | |||||
| 33 | return $self->_inline_throw_error( | ||||
| 34 | q{'The first argument passed to replace must be a string or regexp reference'} | ||||
| 35 | ) | ||||
| 36 | . q{ unless Moose::Util::_STRINGLIKE0( $_[0] ) || Params::Util::_REGEX( $_[0] );} | ||||
| 37 | . $self->_inline_throw_error( | ||||
| 38 | q{'The second argument passed to replace must be a string or code reference'} | ||||
| 39 | ) . q{ unless Moose::Util::_STRINGLIKE0( $_[1] ) || Params::Util::_CODELIKE( $_[1] );}; | ||||
| 40 | } | ||||
| 41 | |||||
| 42 | sub _potential_value { | ||||
| 43 | my ( $self, $slot_access ) = @_; | ||||
| 44 | |||||
| 45 | return "( do { my \$val = $slot_access; ref \$_[1] ? \$val =~ s/\$_[0]/\$_[1]->()/e : \$val =~ s/\$_[0]/\$_[1]/; \$val } )"; | ||||
| 46 | } | ||||
| 47 | |||||
| 48 | sub _inline_optimized_set_new_value { | ||||
| 49 | my ( $self, $inv, $new, $slot_access ) = @_; | ||||
| 50 | |||||
| 51 | return "if ( ref \$_[1] ) { $slot_access =~ s/\$_[0]/\$_[1]->()/e; } else { $slot_access =~ s/\$_[0]/\$_[1]/; }"; | ||||
| 52 | } | ||||
| 53 | |||||
| 54 | 3 | 119µs | 2 | 1.52ms | # spent 785µs (45+739) within Moose::Meta::Method::Accessor::Native::String::replace::BEGIN@54 which was called:
# once (45µs+739µs) by Moose::Meta::Attribute::Native::Trait::String::BEGIN@16 at line 54 # spent 785µs making 1 call to Moose::Meta::Method::Accessor::Native::String::replace::BEGIN@54
# spent 739µs making 1 call to Moose::Exporter::__ANON__[Moose/Exporter.pm:557] |
| 55 | |||||
| 56 | 1 | 48µs | 1; |