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