← Index
NYTProf Performance Profile   « line view »
For fastest.pl
  Run on Fri Jan 31 20:48:16 2014
Reported on Fri Jan 31 20:49:40 2014

Filename/opt/perl-5.18.1/lib/site_perl/5.18.1/darwin-thread-multi-2level/Moose/Meta/Method/Overridden.pm
StatementsExecuted 10 statements in 357µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11111µs11µsMoose::Meta::Method::Overridden::::BEGIN@2Moose::Meta::Method::Overridden::BEGIN@2
1119µs14µsMoose::Meta::Method::Overridden::::BEGIN@10Moose::Meta::Method::Overridden::BEGIN@10
1119µs3.06msMoose::Meta::Method::Overridden::::BEGIN@12Moose::Meta::Method::Overridden::BEGIN@12
1119µs25µsMoose::Meta::Method::Overridden::::BEGIN@9Moose::Meta::Method::Overridden::BEGIN@9
0000s0sMoose::Meta::Method::Overridden::::__ANON__[:39]Moose::Meta::Method::Overridden::__ANON__[:39]
0000s0sMoose::Meta::Method::Overridden::::newMoose::Meta::Method::Overridden::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::Overridden;
2
# spent 11µs within Moose::Meta::Method::Overridden::BEGIN@2 which was called: # once (11µs+0s) by Moose::Meta::Class::BEGIN@21 at line 4
BEGIN {
317µs $Moose::Meta::Method::Overridden::AUTHORITY = 'cpan:STEVAN';
4146µs111µs}
# spent 11µs making 1 call to Moose::Meta::Method::Overridden::BEGIN@2
5{
621µs $Moose::Meta::Method::Overridden::VERSION = '2.1005';
7}
8
9231µs241µs
# spent 25µs (9+16) within Moose::Meta::Method::Overridden::BEGIN@9 which was called: # once (9µs+16µs) by Moose::Meta::Class::BEGIN@21 at line 9
use strict;
# spent 25µs making 1 call to Moose::Meta::Method::Overridden::BEGIN@9 # spent 16µs making 1 call to strict::import
10232µs218µs
# spent 14µs (9+5) within Moose::Meta::Method::Overridden::BEGIN@10 which was called: # once (9µs+5µs) by Moose::Meta::Class::BEGIN@21 at line 10
use warnings;
# spent 14µs making 1 call to Moose::Meta::Method::Overridden::BEGIN@10 # spent 5µs making 1 call to warnings::import
11
122236µs26.10ms
# spent 3.06ms (9µs+3.05) within Moose::Meta::Method::Overridden::BEGIN@12 which was called: # once (9µs+3.05ms) by Moose::Meta::Class::BEGIN@21 at line 12
use base 'Moose::Meta::Method';
# spent 3.06ms making 1 call to Moose::Meta::Method::Overridden::BEGIN@12 # spent 3.05ms making 1 call to base::import
13
14sub new {
15 my ( $class, %args ) = @_;
16
17 # the package can be overridden by roles
18 # it is really more like body's compilation stash
19 # this is where we need to override the definition of super() so that the
20 # body of the code can call the right overridden version
21 my $super_package = $args{package} || $args{class}->name;
22
23 my $name = $args{name};
24
25 my $super = $args{class}->find_next_method_by_name($name);
26
27 (defined $super)
28 || $class->throw_error("You cannot override '$name' because it has no super method", data => $name);
29
30 my $super_body = $super->body;
31
32 my $method = $args{method};
33
34 my $body = sub {
35 local $Moose::SUPER_PACKAGE = $super_package;
36 local @Moose::SUPER_ARGS = @_;
37 local $Moose::SUPER_BODY = $super_body;
38 return $method->(@_);
39 };
40
41 # FIXME do we need this make sure this works for next::method?
42 # subname "${super_package}::${name}", $method;
43
44 # FIXME store additional attrs
45 $class->wrap(
46 $body,
47 package_name => $args{class}->name,
48 name => $name
49 );
50}
51
5214µs1;
53
54# ABSTRACT: A Moose Method metaclass for overridden methods
55
56__END__