← Index
NYTProf Performance Profile   « block view • line view • sub view »
For xt/tapper-mcp-scheduler-with-db-longrun.t
  Run on Tue May 22 17:18:39 2012
Reported on Tue May 22 17:22:49 2012

Filename/2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/x86_64-linux/Moose/Meta/TypeConstraint/Parameterized.pm
StatementsExecuted 27 statements in 666µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
111653µs2.39msMoose::Meta::TypeConstraint::Parameterized::::BEGIN@15Moose::Meta::TypeConstraint::Parameterized::BEGIN@15
11111µs11µsMoose::Meta::TypeConstraint::Parameterized::::BEGIN@14Moose::Meta::TypeConstraint::Parameterized::BEGIN@14
11110µs10µsMoose::Meta::TypeConstraint::Parameterized::::BEGIN@2Moose::Meta::TypeConstraint::Parameterized::BEGIN@2
11110µs82µsMoose::Meta::TypeConstraint::Parameterized::::BEGIN@17Moose::Meta::TypeConstraint::Parameterized::BEGIN@17
1119µs14µsMoose::Meta::TypeConstraint::Parameterized::::BEGIN@9Moose::Meta::TypeConstraint::Parameterized::BEGIN@9
1119µs46µsMoose::Meta::TypeConstraint::Parameterized::::BEGIN@13Moose::Meta::TypeConstraint::Parameterized::BEGIN@13
1118µs571µsMoose::Meta::TypeConstraint::Parameterized::::BEGIN@11Moose::Meta::TypeConstraint::Parameterized::BEGIN@11
1118µs24µsMoose::Meta::TypeConstraint::Parameterized::::BEGIN@10Moose::Meta::TypeConstraint::Parameterized::BEGIN@10
0000s0sMoose::Meta::TypeConstraint::Parameterized::::_inline_checkMoose::Meta::TypeConstraint::Parameterized::_inline_check
0000s0sMoose::Meta::TypeConstraint::Parameterized::::can_be_inlinedMoose::Meta::TypeConstraint::Parameterized::can_be_inlined
0000s0sMoose::Meta::TypeConstraint::Parameterized::::compile_type_constraintMoose::Meta::TypeConstraint::Parameterized::compile_type_constraint
0000s0sMoose::Meta::TypeConstraint::Parameterized::::create_child_typeMoose::Meta::TypeConstraint::Parameterized::create_child_type
0000s0sMoose::Meta::TypeConstraint::Parameterized::::equalsMoose::Meta::TypeConstraint::Parameterized::equals
0000s0sMoose::Meta::TypeConstraint::Parameterized::::inline_environmentMoose::Meta::TypeConstraint::Parameterized::inline_environment
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::TypeConstraint::Parameterized;
2
# spent 10µs within Moose::Meta::TypeConstraint::Parameterized::BEGIN@2 which was called: # once (10µs+0s) by Moose::Util::TypeConstraints::BEGIN@34 at line 4
BEGIN {
314µs $Moose::Meta::TypeConstraint::Parameterized::AUTHORITY = 'cpan:STEVAN';
4123µs110µs}
5{
621µs $Moose::Meta::TypeConstraint::Parameterized::VERSION = '2.0602';
7}
8
9319µs219µs
# spent 14µs (9+5) within Moose::Meta::TypeConstraint::Parameterized::BEGIN@9 which was called: # once (9µs+5µs) by Moose::Util::TypeConstraints::BEGIN@34 at line 9
use strict;
# spent 14µs making 1 call to Moose::Meta::TypeConstraint::Parameterized::BEGIN@9 # spent 5µs making 1 call to strict::import
10318µs240µs
# spent 24µs (8+16) within Moose::Meta::TypeConstraint::Parameterized::BEGIN@10 which was called: # once (8µs+16µs) by Moose::Util::TypeConstraints::BEGIN@34 at line 10
use warnings;
# spent 24µs making 1 call to Moose::Meta::TypeConstraint::Parameterized::BEGIN@10 # spent 16µs making 1 call to warnings::import
11329µs21.13ms
# spent 571µs (8+563) within Moose::Meta::TypeConstraint::Parameterized::BEGIN@11 which was called: # once (8µs+563µs) by Moose::Util::TypeConstraints::BEGIN@34 at line 11
use metaclass;
# spent 571µs making 1 call to Moose::Meta::TypeConstraint::Parameterized::BEGIN@11 # spent 563µs making 1 call to metaclass::import
12
13322µs284µs
# spent 46µs (9+38) within Moose::Meta::TypeConstraint::Parameterized::BEGIN@13 which was called: # once (9µs+38µs) by Moose::Util::TypeConstraints::BEGIN@34 at line 13
use Scalar::Util 'blessed';
# spent 46µs making 1 call to Moose::Meta::TypeConstraint::Parameterized::BEGIN@13 # spent 38µs making 1 call to Exporter::import
14323µs111µs
# spent 11µs within Moose::Meta::TypeConstraint::Parameterized::BEGIN@14 which was called: # once (11µs+0s) by Moose::Util::TypeConstraints::BEGIN@34 at line 14
use Moose::Util::TypeConstraints;
153127µs12.39ms
# spent 2.39ms (653µs+1.74) within Moose::Meta::TypeConstraint::Parameterized::BEGIN@15 which was called: # once (653µs+1.74ms) by Moose::Util::TypeConstraints::BEGIN@34 at line 15
use Moose::Meta::TypeConstraint::Parameterizable;
16
173382µs2153µs
# spent 82µs (10+72) within Moose::Meta::TypeConstraint::Parameterized::BEGIN@17 which was called: # once (10µs+72µs) by Moose::Util::TypeConstraints::BEGIN@34 at line 17
use base 'Moose::Meta::TypeConstraint';
# spent 82µs making 1 call to Moose::Meta::TypeConstraint::Parameterized::BEGIN@17 # spent 72µs making 1 call to base::import
18
1915µs3534µs__PACKAGE__->meta->add_attribute('type_parameter' => (
# spent 509µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 19µs making 1 call to Moose::Meta::TypeConstraint::Parameterized::meta # spent 6µs making 1 call to Class::MOP::_definition_context
20 accessor => 'type_parameter',
21 predicate => 'has_type_parameter',
22 Class::MOP::_definition_context(),
23));
24
2514µs3437µs__PACKAGE__->meta->add_attribute('parameterized_from' => (
# spent 421µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute # spent 11µs making 1 call to Moose::Meta::TypeConstraint::Parameterized::meta # spent 6µs making 1 call to Class::MOP::_definition_context
26 accessor => 'parameterized_from',
27 predicate => 'has_parameterized_from',
28 Class::MOP::_definition_context(),
29));
30
31sub equals {
32 my ( $self, $type_or_name ) = @_;
33
34 my $other = Moose::Util::TypeConstraints::find_type_constraint($type_or_name);
35
36 return unless $other->isa(__PACKAGE__);
37
38 return (
39 $self->type_parameter->equals( $other->type_parameter )
40 and
41 $self->parent->equals( $other->parent )
42 );
43}
44
45sub compile_type_constraint {
46 my $self = shift;
47
48 unless ( $self->has_type_parameter ) {
49 require Moose;
50 Moose->throw_error("You cannot create a Higher Order type without a type parameter");
51 }
52
53 my $type_parameter = $self->type_parameter;
54
55 unless ( blessed $type_parameter && $type_parameter->isa('Moose::Meta::TypeConstraint') ) {
56 require Moose;
57 Moose->throw_error("The type parameter must be a Moose meta type");
58 }
59
60 foreach my $type (Moose::Util::TypeConstraints::get_all_parameterizable_types()) {
61 if (my $constraint = $type->generate_constraint_for($self)) {
62 $self->_set_constraint($constraint);
63 return $self->SUPER::compile_type_constraint;
64 }
65 }
66
67 # if we get here, then we couldn't
68 # find a way to parameterize this type
69 require Moose;
70 Moose->throw_error("The " . $self->name . " constraint cannot be used, because "
71 . $self->parent->name . " doesn't subtype or coerce from a parameterizable type.");
72}
73
74sub can_be_inlined {
75 my $self = shift;
76
77 return
78 $self->has_parameterized_from
79 && $self->parameterized_from->has_inline_generator
80 && $self->type_parameter->can_be_inlined;
81}
82
83sub inline_environment {
84 my $self = shift;
85
86 return {
87 ($self->has_parameterized_from
88 ? (%{ $self->parameterized_from->inline_environment })
89 : ()),
90 ($self->has_type_parameter
91 ? (%{ $self->type_parameter->inline_environment })
92 : ()),
93 };
94}
95
96sub _inline_check {
97 my $self = shift;
98
99 return unless $self->can_be_inlined;
100
101 return $self->parameterized_from->generate_inline_for( $self->type_parameter, @_ );
102}
103
104sub create_child_type {
105 my ($self, %opts) = @_;
106 return Moose::Meta::TypeConstraint::Parameterizable->new(%opts, parent=>$self);
107}
108
10919µs1;
110
111# ABSTRACT: Type constraints with a bound parameter (ArrayRef[Int])
112
- -
115=pod
116
117=head1 NAME
118
119Moose::Meta::TypeConstraint::Parameterized - Type constraints with a bound parameter (ArrayRef[Int])
120
121=head1 VERSION
122
123version 2.0602
124
125=head1 METHODS
126
127This class is intentionally not documented because the API is
128confusing and needs some work.
129
130=head1 INHERITANCE
131
132C<Moose::Meta::TypeConstraint::Parameterized> is a subclass of
133L<Moose::Meta::TypeConstraint>.
134
135=head1 BUGS
136
137See L<Moose/BUGS> for details on reporting bugs.
138
139=head1 AUTHOR
140
141Moose is maintained by the Moose Cabal, along with the help of many contributors. See L<Moose/CABAL> and L<Moose/CONTRIBUTORS> for details.
142
143=head1 COPYRIGHT AND LICENSE
144
145This software is copyright (c) 2012 by Infinity Interactive, Inc..
146
147This is free software; you can redistribute it and/or modify it under
148the same terms as the Perl 5 programming language system itself.
149
150=cut
151
152
153__END__