| Filename | /home/doy/nytprof/markdent/accessor parameters_metaclass defined at /home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm |
| Statements | Executed 136 statements in 1.19ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0s | 0s | Class::MOP::Method::Generated::__ANON__[accessor parameters_metaclass defined at MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm:52] |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | my $type_constraint = ${$__captures->{'$type_constraint'}}; | ||||
| 2 | my $type_constraint_obj = ${$__captures->{'$type_constraint_obj'}}; | ||||
| 3 | my $meta = ${$__captures->{'$meta'}}; | ||||
| 4 | my $attr = ${$__captures->{'$attr'}}; | ||||
| 5 | #line 32 "accessor parameters_metaclass defined at /home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm" | ||||
| 6 | sub { | ||||
| 7 | |||||
| 8 | if (scalar(@_) >= 2) { | ||||
| 9 | |||||
| - - | |||||
| 12 | $type_constraint->($_[1]) || $meta->throw_error("Attribute (parameters_metaclass) does not pass the type constraint because: " . $type_constraint_obj->get_message($_[1]), data => $_[1]); | ||||
| 13 | |||||
| 14 | $_[0]->{"parameters_metaclass"} = $_[1]; | ||||
| 15 | |||||
| 16 | } | ||||
| 17 | unless (exists $_[0]->{"parameters_metaclass"}) { | ||||
| 18 | my $default = $attr->default($_[0]); | ||||
| 19 | |||||
| 20 | $type_constraint->($default) || $meta->throw_error("Attribute (parameters_metaclass) does not pass the type constraint because: " . $type_constraint_obj->get_message($default), data => $default); | ||||
| 21 | $_[0]->{"parameters_metaclass"} = $default; | ||||
| 22 | } | ||||
| 23 | |||||
| 24 | |||||
| 25 | return $_[0]->{"parameters_metaclass"} | ||||
| 26 | } | ||||
| 27 | ; | ||||
| 28 | |||||
| - - | |||||
| 32 | |||||
| - - | |||||
| 34 | 129 | 1.07ms | |||
| - - | |||||
| 43 | 6 | 93µs | |||
| 44 | 2 | 30.6ms | # spent 30.6ms making 2 calls to Class::MOP::Mixin::AttributeCore::default, avg 15.3ms/call | ||
| - - | |||||
| 46 | 2 | 173µs | # spent 173µs making 2 calls to Moose::Meta::TypeConstraint::Class::__ANON__[Moose/Meta/TypeConstraint/Class.pm:38], avg 87µs/call | ||
| - - | |||||
| 53 | 1 | 29µs |