← Index
NYTProf Performance Profile   « block view • line view • sub view »
For -e
  Run on Wed Nov 17 21:45:08 2010
Reported on Wed Nov 17 22:13:41 2010

Filename/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Moose/Meta/Method/Augmented.pm
StatementsExecuted 13 statements in 1.31ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11169µs88µsMoose::Meta::Method::Augmented::::BEGIN@3Moose::Meta::Method::Augmented::BEGIN@3
11138µs330µsMoose::Meta::Method::Augmented::::BEGIN@10Moose::Meta::Method::Augmented::BEGIN@10
11138µs106µsMoose::Meta::Method::Augmented::::BEGIN@4Moose::Meta::Method::Augmented::BEGIN@4
0000s0sMoose::Meta::Method::Augmented::::__ANON__[:47]Moose::Meta::Method::Augmented::__ANON__[:47]
0000s0sMoose::Meta::Method::Augmented::::newMoose::Meta::Method::Augmented::new
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Moose::Meta::Method::Augmented;
2
33100µs2107µs
# spent 88µs (69+19) within Moose::Meta::Method::Augmented::BEGIN@3 which was called: # once (69µs+19µs) by Moose::Meta::Class::BEGIN@20 at line 3
use strict;
# spent 88µs making 1 call to Moose::Meta::Method::Augmented::BEGIN@3 # spent 19µs making 1 call to strict::import
43208µs2174µs
# spent 106µs (38+68) within Moose::Meta::Method::Augmented::BEGIN@4 which was called: # once (38µs+68µs) by Moose::Meta::Class::BEGIN@20 at line 4
use warnings;
# spent 106µs making 1 call to Moose::Meta::Method::Augmented::BEGIN@4 # spent 68µs making 1 call to warnings::import
5
616µsour $VERSION = '1.19';
7194µs$VERSION = eval $VERSION;
# spent 15µs executing statements in string eval
816µsour $AUTHORITY = 'cpan:STEVAN';
9
103881µs2621µs
# spent 330µs (38+292) within Moose::Meta::Method::Augmented::BEGIN@10 which was called: # once (38µs+292µs) by Moose::Meta::Class::BEGIN@20 at line 10
use base 'Moose::Meta::Method';
# spent 330µs making 1 call to Moose::Meta::Method::Augmented::BEGIN@10 # spent 292µs making 1 call to base::import
11
12sub new {
13 my ( $class, %args ) = @_;
14
15 # the package can be overridden by roles
16 # it is really more like body's compilation stash
17 # this is where we need to override the definition of super() so that the
18 # body of the code can call the right overridden version
19 my $name = $args{name};
20 my $meta = $args{class};
21
22 my $super = $meta->find_next_method_by_name($name);
23
24 (defined $super)
25 || $meta->throw_error("You cannot augment '$name' because it has no super method", data => $name);
26
27 my $_super_package = $super->package_name;
28 # BUT!,... if this is an overridden method ....
29 if ($super->isa('Moose::Meta::Method::Overridden')) {
30 # we need to be sure that we actually
31 # find the next method, which is not
32 # an 'override' method, the reason is
33 # that an 'override' method will not
34 # be the one calling inner()
35 my $real_super = $meta->_find_next_method_by_name_which_is_not_overridden($name);
36 $_super_package = $real_super->package_name;
37 }
38
39 my $super_body = $super->body;
40
41 my $method = $args{method};
42
43 my $body = sub {
44 local $Moose::INNER_ARGS{$_super_package} = [ @_ ];
45 local $Moose::INNER_BODY{$_super_package} = $method;
46 $super_body->(@_);
47 };
48
49 # FIXME store additional attrs
50 $class->wrap(
51 $body,
52 package_name => $meta->name,
53 name => $name
54 );
55}
56
57116µs1;
58
59__END__