← Index
NYTProf Performance Profile   « block view • line view • sub view »
For -e
  Run on Wed Nov 17 22:00:36 2010
Reported on Wed Nov 17 22:10:54 2010

Filename/home/doy/coding/src/Moose/blib/lib//Moose/Meta/Method/Augmented.pm
StatementsExecuted 13 statements in 1.10ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11169µs88µsMoose::Meta::Method::Augmented::::BEGIN@3Moose::Meta::Method::Augmented::BEGIN@3
11140µs294µsMoose::Meta::Method::Augmented::::BEGIN@10Moose::Meta::Method::Augmented::BEGIN@10
11139µs108µ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
3397µ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
43223µs2176µs
# spent 108µs (39+69) within Moose::Meta::Method::Augmented::BEGIN@4 which was called: # once (39µs+69µs) by Moose::Meta::Class::BEGIN@20 at line 4
use warnings;
# spent 108µs making 1 call to Moose::Meta::Method::Augmented::BEGIN@4 # spent 69µs making 1 call to warnings::import
5
614µsour $VERSION = '1.19';
7156µs$VERSION = eval $VERSION;
# spent 10µs executing statements in string eval
814µsour $AUTHORITY = 'cpan:STEVAN';
9
103710µs2548µs
# spent 294µs (40+254) within Moose::Meta::Method::Augmented::BEGIN@10 which was called: # once (40µs+254µs) by Moose::Meta::Class::BEGIN@20 at line 10
use base 'Moose::Meta::Method';
# spent 294µs making 1 call to Moose::Meta::Method::Augmented::BEGIN@10 # spent 254µ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
57111µs1;
58
59__END__