← Index
NYTProf Performance Profile   « line view »
For script/ponapi
  Run on Wed Feb 10 15:51:26 2016
Reported on Thu Feb 11 09:43:10 2016

Filename/usr/local/lib/perl/5.18.2/Moose/Meta/Method/Augmented.pm
StatementsExecuted 10 statements in 233µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1119µs24µsMoose::Meta::Method::Augmented::::BEGIN@4Moose::Meta::Method::Augmented::BEGIN@4
1118µs104µsMoose::Meta::Method::Augmented::::BEGIN@9Moose::Meta::Method::Augmented::BEGIN@9
1117µs13µsMoose::Meta::Method::Augmented::::BEGIN@5Moose::Meta::Method::Augmented::BEGIN@5
1116µs28µsMoose::Meta::Method::Augmented::::BEGIN@7Moose::Meta::Method::Augmented::BEGIN@7
0000s0sMoose::Meta::Method::Augmented::::__ANON__[:49]Moose::Meta::Method::Augmented::__ANON__[:49]
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;
21500nsour $VERSION = '2.1604';
3
4221µs239µs
# spent 24µs (9+15) within Moose::Meta::Method::Augmented::BEGIN@4 which was called: # once (9µs+15µs) by Moose::Meta::Class::BEGIN@14 at line 4
use strict;
# spent 24µs making 1 call to Moose::Meta::Method::Augmented::BEGIN@4 # spent 15µs making 1 call to strict::import
5226µs218µs
# spent 13µs (7+6) within Moose::Meta::Method::Augmented::BEGIN@5 which was called: # once (7µs+6µs) by Moose::Meta::Class::BEGIN@14 at line 5
use warnings;
# spent 13µs making 1 call to Moose::Meta::Method::Augmented::BEGIN@5 # spent 6µs making 1 call to warnings::import
6
7224µs249µs
# spent 28µs (6+22) within Moose::Meta::Method::Augmented::BEGIN@7 which was called: # once (6µs+22µs) by Moose::Meta::Class::BEGIN@14 at line 7
use parent 'Moose::Meta::Method';
# spent 28µs making 1 call to Moose::Meta::Method::Augmented::BEGIN@7 # spent 22µs making 1 call to parent::import
8
92160µs2201µs
# spent 104µs (8+97) within Moose::Meta::Method::Augmented::BEGIN@9 which was called: # once (8µs+97µs) by Moose::Meta::Class::BEGIN@14 at line 9
use Moose::Util 'throw_exception';
# spent 104µs making 1 call to Moose::Meta::Method::Augmented::BEGIN@9 # spent 97µs making 1 call to Sub::Exporter::__ANON__[Sub/Exporter.pm:337]
10
11sub new {
12 my ( $class, %args ) = @_;
13
14 # the package can be overridden by roles
15 # it is really more like body's compilation stash
16 # this is where we need to override the definition of super() so that the
17 # body of the code can call the right overridden version
18 my $name = $args{name};
19 my $meta = $args{class};
20
21 my $super = $meta->find_next_method_by_name($name);
22
23 (defined $super)
24 || throw_exception( CannotAugmentNoSuperMethod => params => \%args,
25 class => $class,
26 method_name => $name
27 );
28
29 my $_super_package = $super->package_name;
30 # BUT!,... if this is an overridden method ....
31 if ($super->isa('Moose::Meta::Method::Overridden')) {
32 # we need to be sure that we actually
33 # find the next method, which is not
34 # an 'override' method, the reason is
35 # that an 'override' method will not
36 # be the one calling inner()
37 my $real_super = $meta->_find_next_method_by_name_which_is_not_overridden($name);
38 $_super_package = $real_super->package_name;
39 }
40
41 my $super_body = $super->body;
42
43 my $method = $args{method};
44
45 my $body = sub {
46 local $Moose::INNER_ARGS{$_super_package} = [ @_ ];
47 local $Moose::INNER_BODY{$_super_package} = $method;
48 $super_body->(@_);
49 };
50
51 # FIXME store additional attrs
52 $class->wrap(
53 $body,
54 package_name => $meta->name,
55 name => $name
56 );
57}
58
5912µs1;
60
61# ABSTRACT: A Moose Method metaclass for augmented methods
62
63__END__