| Filename | /2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/x86_64-linux/Moose/Meta/Method.pm |
| Statements | Executed 44 statements in 422µs |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 3 | 1 | 1 | 107µs | 722µs | Moose::Meta::Method::_inline_throw_error |
| 1 | 1 | 1 | 8µs | 8µs | Moose::Meta::Method::BEGIN@2 |
| 1 | 1 | 1 | 7µs | 98µs | Moose::Meta::Method::BEGIN@14 |
| 1 | 1 | 1 | 6µs | 8µs | Moose::Meta::Method::BEGIN@9 |
| 1 | 1 | 1 | 6µs | 13µs | Moose::Meta::Method::BEGIN@10 |
| 1 | 1 | 1 | 5µs | 5µs | Moose::Meta::Method::BEGIN@12 |
| 0 | 0 | 0 | 0s | 0s | Moose::Meta::Method::_error_thrower |
| 0 | 0 | 0 | 0s | 0s | Moose::Meta::Method::throw_error |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package Moose::Meta::Method; | ||||
| 2 | # spent 8µs within Moose::Meta::Method::BEGIN@2 which was called:
# once (8µs+0s) by base::import at line 4 | ||||
| 3 | 1 | 4µs | $Moose::Meta::Method::AUTHORITY = 'cpan:STEVAN'; | ||
| 4 | 1 | 19µs | 1 | 8µs | } # spent 8µs making 1 call to Moose::Meta::Method::BEGIN@2 |
| 5 | { | ||||
| 6 | 2 | 1µs | $Moose::Meta::Method::VERSION = '2.0602'; | ||
| 7 | } | ||||
| 8 | |||||
| 9 | 3 | 16µs | 2 | 10µs | # spent 8µs (6+2) within Moose::Meta::Method::BEGIN@9 which was called:
# once (6µs+2µs) by base::import at line 9 # spent 8µs making 1 call to Moose::Meta::Method::BEGIN@9
# spent 2µs making 1 call to strict::import |
| 10 | 3 | 19µs | 2 | 21µs | # spent 13µs (6+7) within Moose::Meta::Method::BEGIN@10 which was called:
# once (6µs+7µs) by base::import at line 10 # spent 13µs making 1 call to Moose::Meta::Method::BEGIN@10
# spent 7µs making 1 call to warnings::import |
| 11 | |||||
| 12 | 3 | 18µs | 1 | 5µs | # spent 5µs within Moose::Meta::Method::BEGIN@12 which was called:
# once (5µs+0s) by base::import at line 12 # spent 5µs making 1 call to Moose::Meta::Method::BEGIN@12 |
| 13 | |||||
| 14 | 3 | 200µs | 2 | 98µs | # spent 98µs (7+91) within Moose::Meta::Method::BEGIN@14 which was called:
# once (7µs+91µs) by base::import at line 14 # spent 98µs making 1 call to Moose::Meta::Method::BEGIN@14
# spent 91µs making 1 call to base::import, recursion: max depth 1, sum of overlapping time 91µs |
| 15 | |||||
| 16 | 1 | 3µs | 1 | 2.05ms | Class::MOP::MiniTrait::apply(__PACKAGE__, 'Moose::Meta::Object::Trait'); # spent 2.05ms making 1 call to Class::MOP::MiniTrait::apply |
| 17 | |||||
| 18 | sub _error_thrower { | ||||
| 19 | my $self = shift; | ||||
| 20 | require Moose::Meta::Class; | ||||
| 21 | ( ref $self && $self->associated_metaclass ) || "Moose::Meta::Class"; | ||||
| 22 | } | ||||
| 23 | |||||
| 24 | sub throw_error { | ||||
| 25 | my $self = shift; | ||||
| 26 | my $inv = $self->_error_thrower; | ||||
| 27 | unshift @_, "message" if @_ % 2 == 1; | ||||
| 28 | unshift @_, method => $self if ref $self; | ||||
| 29 | unshift @_, $inv; | ||||
| 30 | my $handler = $inv->can("throw_error"); | ||||
| 31 | goto $handler; # to avoid incrementing depth by 1 | ||||
| 32 | } | ||||
| 33 | |||||
| 34 | # spent 722µs (107+615) within Moose::Meta::Method::_inline_throw_error which was called 3 times, avg 241µs/call:
# 3 times (107µs+615µs) by Class::MOP::Method::Accessor::__ANON__[/2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/x86_64-linux/Class/MOP/Method/Accessor.pm:154] at line 142 of Class/MOP/Method/Accessor.pm, avg 241µs/call | ||||
| 35 | 18 | 59µs | my ( $self, $msg, $args ) = @_; | ||
| 36 | |||||
| 37 | 3 | 32µs | my $inv = $self->_error_thrower; # spent 32µs making 3 calls to Moose::Meta::Method::Accessor::_error_thrower, avg 11µs/call | ||
| 38 | # XXX ugh | ||||
| 39 | 3 | 5µs | $inv = 'Moose::Meta::Class' unless $inv->can('_inline_throw_error'); # spent 5µs making 3 calls to UNIVERSAL::can, avg 2µs/call | ||
| 40 | |||||
| 41 | # XXX ugh ugh UGH | ||||
| 42 | 3 | 6µs | my $class = $self->associated_metaclass; # spent 6µs making 3 calls to Class::MOP::Method::associated_metaclass, avg 2µs/call | ||
| 43 | 9 | 77µs | if ($class) { | ||
| 44 | 6 | 24µs | my $class_name = B::perlstring($class->name); # spent 22µs making 3 calls to B::perlstring, avg 7µs/call
# spent 2µs making 3 calls to Class::MOP::Package::name, avg 667ns/call | ||
| 45 | 6 | 5µs | my $meth_name = B::perlstring($self->name); # spent 3µs making 3 calls to B::perlstring, avg 1µs/call
# spent 2µs making 3 calls to Class::MOP::Method::name, avg 767ns/call | ||
| 46 | $args = 'method => Class::MOP::class_of(' . $class_name . ')' | ||||
| 47 | . '->find_method_by_name(' . $meth_name . '), ' | ||||
| 48 | . (defined $args ? $args : ''); | ||||
| 49 | } | ||||
| 50 | |||||
| 51 | 3 | 543µs | return $inv->_inline_throw_error($msg, $args) # spent 543µs making 3 calls to Moose::Meta::Attribute::_inline_throw_error, avg 181µs/call | ||
| 52 | } | ||||
| 53 | |||||
| 54 | 1 | 6µs | 1; | ||
| 55 | |||||
| 56 | # ABSTRACT: A Moose Method metaclass | ||||
| 57 | |||||
| - - | |||||
| 60 | =pod | ||||
| 61 | |||||
| 62 | =head1 NAME | ||||
| 63 | |||||
| 64 | Moose::Meta::Method - A Moose Method metaclass | ||||
| 65 | |||||
| 66 | =head1 VERSION | ||||
| 67 | |||||
| 68 | version 2.0602 | ||||
| 69 | |||||
| 70 | =head1 DESCRIPTION | ||||
| 71 | |||||
| 72 | This class is a subclass of L<Class::MOP::Method> that provides | ||||
| 73 | additional Moose-specific functionality, all of which is private. | ||||
| 74 | |||||
| 75 | To understand this class, you should read the the L<Class::MOP::Method> | ||||
| 76 | documentation. | ||||
| 77 | |||||
| 78 | =head1 INHERITANCE | ||||
| 79 | |||||
| 80 | C<Moose::Meta::Method> is a subclass of L<Class::MOP::Method>. | ||||
| 81 | |||||
| 82 | =head1 BUGS | ||||
| 83 | |||||
| 84 | See L<Moose/BUGS> for details on reporting bugs. | ||||
| 85 | |||||
| 86 | =head1 AUTHOR | ||||
| 87 | |||||
| 88 | Moose is maintained by the Moose Cabal, along with the help of many contributors. See L<Moose/CABAL> and L<Moose/CONTRIBUTORS> for details. | ||||
| 89 | |||||
| 90 | =head1 COPYRIGHT AND LICENSE | ||||
| 91 | |||||
| 92 | This software is copyright (c) 2012 by Infinity Interactive, Inc.. | ||||
| 93 | |||||
| 94 | This is free software; you can redistribute it and/or modify it under | ||||
| 95 | the same terms as the Perl 5 programming language system itself. | ||||
| 96 | |||||
| 97 | =cut | ||||
| 98 | |||||
| 99 | |||||
| 100 | __END__ |