File | /usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/Moose/Meta/Method.pm |
Statements Executed | 31 |
Statement Execution Time | 874µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
9 | 3 | 2 | 29µs | 29µs | _inline_throw_error | Moose::Meta::Method::
1 | 1 | 1 | 14µs | 16µs | BEGIN@3 | Moose::Meta::Method::
1 | 1 | 1 | 8µs | 66µs | BEGIN@10 | Moose::Meta::Method::
1 | 1 | 1 | 6µs | 15µs | BEGIN@4 | Moose::Meta::Method::
0 | 0 | 0 | 0s | 0s | _error_thrower | Moose::Meta::Method::
0 | 0 | 0 | 0s | 0s | throw_error | Moose::Meta::Method::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Moose::Meta::Method; | ||||
2 | |||||
3 | 3 | 20µs | 2 | 19µs | # spent 16µs (14+3) within Moose::Meta::Method::BEGIN@3 which was called
# once (14µs+3µs) by base::import at line 3 # spent 16µs making 1 call to Moose::Meta::Method::BEGIN@3
# spent 3µs making 1 call to strict::import |
4 | 3 | 38µs | 2 | 24µs | # spent 15µs (6+9) within Moose::Meta::Method::BEGIN@4 which was called
# once (6µs+9µs) by base::import at line 4 # spent 15µs making 1 call to Moose::Meta::Method::BEGIN@4
# spent 9µs making 1 call to warnings::import |
5 | |||||
6 | 1 | 3µs | our $VERSION = '0.98'; | ||
7 | 1 | 78µs | $VERSION = eval $VERSION; | ||
8 | 1 | 1µs | our $AUTHORITY = 'cpan:STEVAN'; | ||
9 | |||||
10 | 3 | 678µs | 2 | 66µs | # spent 66µs (8+57) within Moose::Meta::Method::BEGIN@10 which was called
# once (8µs+57µs) by base::import at line 10 # spent 66µs making 1 call to Moose::Meta::Method::BEGIN@10
# spent 57µs making 1 call to base::import, recursion: max depth 1, time 57µs |
11 | |||||
12 | sub _error_thrower { | ||||
13 | my $self = shift; | ||||
14 | ( ref $self && $self->associated_metaclass ) || "Moose::Meta::Class"; | ||||
15 | } | ||||
16 | |||||
17 | sub throw_error { | ||||
18 | my $self = shift; | ||||
19 | my $inv = $self->_error_thrower; | ||||
20 | unshift @_, "message" if @_ % 2 == 1; | ||||
21 | unshift @_, method => $self if ref $self; | ||||
22 | unshift @_, $inv; | ||||
23 | my $handler = $inv->can("throw_error"); | ||||
24 | goto $handler; # to avoid incrementing depth by 1 | ||||
25 | } | ||||
26 | |||||
27 | # spent 29µs within Moose::Meta::Method::_inline_throw_error which was called 9 times, avg 3µs/call:
# 6 times (22µs+0s) by Moose::Meta::Method::Accessor::_generate_reader_method_inline at line 95 of Moose/Meta/Method/Accessor.pm, avg 4µs/call
# 2 times (5µs+0s) by Moose::Meta::Method::Constructor::_generate_slot_initializer at line 200 of Moose/Meta/Method/Constructor.pm, avg 2µs/call
# once (2µs+0s) by Moose::Meta::Method::Constructor::_generate_BUILDARGS at line 137 of Moose/Meta/Method/Constructor.pm | ||||
28 | 9 | 7µs | my ( $self, $msg, $args ) = @_; | ||
29 | 9 | 31µs | "\$meta->throw_error($msg" . ($args ? ", $args" : "") . ")"; # FIXME makes deparsing *REALLY* hard | ||
30 | } | ||||
31 | |||||
32 | 1 | 18µs | 1; | ||
33 | |||||
34 | __END__ | ||||
35 | |||||
36 | =pod | ||||
37 | |||||
38 | =head1 NAME | ||||
39 | |||||
40 | Moose::Meta::Method - A Moose Method metaclass | ||||
41 | |||||
42 | =head1 DESCRIPTION | ||||
43 | |||||
44 | This class is a subclass of L<Class::MOP::Method> that provides | ||||
45 | additional Moose-specific functionality, all of which is private. | ||||
46 | |||||
47 | To understand this class, you should read the the L<Class::MOP::Method> | ||||
48 | documentation. | ||||
49 | |||||
50 | =head1 INHERITANCE | ||||
51 | |||||
52 | C<Moose::Meta::Method> is a subclass of L<Class::MOP::Method>. | ||||
53 | |||||
54 | =head1 BUGS | ||||
55 | |||||
56 | See L<Moose/BUGS> for details on reporting bugs. | ||||
57 | |||||
58 | =head1 AUTHOR | ||||
59 | |||||
60 | Stevan Little E<lt>stevan@iinteractive.comE<gt> | ||||
61 | |||||
62 | =head1 COPYRIGHT AND LICENSE | ||||
63 | |||||
64 | Copyright 2006-2010 by Infinity Interactive, Inc. | ||||
65 | |||||
66 | L<http://www.iinteractive.com> | ||||
67 | |||||
68 | This library is free software; you can redistribute it and/or modify | ||||
69 | it under the same terms as Perl itself. | ||||
70 | |||||
71 | =cut |