Filename | /Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Class/MOP.pm |
Statements | Executed 4413 statements in 17.7ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 5.94ms | 18.4ms | BEGIN@26 | Class::MOP::
1 | 1 | 1 | 2.08ms | 2.31ms | BEGIN@27 | Class::MOP::
2451 | 9 | 6 | 1.82ms | 1.82ms | get_metaclass_by_name | Class::MOP::
1 | 1 | 1 | 1.34ms | 3.95ms | BEGIN@25 | Class::MOP::
1 | 1 | 1 | 1.26ms | 1.37ms | BEGIN@15 | Class::MOP::
1243 | 4 | 3 | 1.06ms | 1.06ms | get_code_info (xsub) | Class::MOP::
347 | 8 | 6 | 925µs | 1.04ms | class_of | Class::MOP::
123 | 120 | 23 | 560µs | 560µs | _definition_context | Class::MOP::
1 | 1 | 1 | 495µs | 632µs | BEGIN@24 | Class::MOP::
1 | 1 | 1 | 458µs | 801µs | BEGIN@23 | Class::MOP::
140 | 2 | 1 | 312µs | 368µs | metaclass_is_weak | Class::MOP::
101 | 2 | 2 | 135µs | 135µs | store_metaclass_by_name | Class::MOP::
29 | 2 | 2 | 32µs | 32µs | __ANON__[:478] | Class::MOP::
32 | 2 | 2 | 32µs | 32µs | __ANON__[:132] | Class::MOP::
35 | 3 | 2 | 30µs | 30µs | __ANON__[:177] | Class::MOP::
35 | 3 | 2 | 28µs | 28µs | __ANON__[:269] | Class::MOP::
35 | 3 | 2 | 26µs | 26µs | __ANON__[:222] | Class::MOP::
35 | 3 | 2 | 25µs | 25µs | __ANON__[:249] | Class::MOP::
13 | 1 | 1 | 13µs | 13µs | __ANON__[:286] | Class::MOP::
23 | 1 | 1 | 9µs | 9µs | __ANON__ (xsub) | Class::MOP::
1 | 1 | 1 | 8µs | 8µs | BEGIN@13 | Class::MOP::
1 | 1 | 1 | 8µs | 11µs | BEGIN@11 | Class::MOP::
1 | 1 | 1 | 7µs | 7µs | BEGIN@3 | Class::MOP::
1 | 1 | 1 | 7µs | 14µs | BEGIN@18 | Class::MOP::
1 | 1 | 1 | 6µs | 6µs | BEGIN@28 | Class::MOP::
1 | 1 | 1 | 6µs | 27µs | BEGIN@17 | Class::MOP::
1 | 1 | 1 | 6µs | 8µs | BEGIN@20 | Class::MOP::
1 | 1 | 1 | 5µs | 28µs | BEGIN@21 | Class::MOP::
1 | 1 | 1 | 5µs | 34µs | BEGIN@19 | Class::MOP::
1 | 1 | 1 | 5µs | 15µs | BEGIN@10 | Class::MOP::
1 | 1 | 1 | 5µs | 5µs | BEGIN@30 | Class::MOP::
2 | 1 | 1 | 4µs | 4µs | load_class | Class::MOP::
0 | 0 | 0 | 0s | 0s | __ANON__[:486] | Class::MOP::
0 | 0 | 0 | 0s | 0s | __ANON__[:596] | Class::MOP::
0 | 0 | 0 | 0s | 0s | does_metaclass_exist | Class::MOP::
0 | 0 | 0 | 0s | 0s | get_all_metaclass_instances | Class::MOP::
0 | 0 | 0 | 0s | 0s | get_all_metaclass_names | Class::MOP::
0 | 0 | 0 | 0s | 0s | get_all_metaclasses | Class::MOP::
0 | 0 | 0 | 0s | 0s | is_class_loaded | Class::MOP::
0 | 0 | 0 | 0s | 0s | load_first_existing_class | Class::MOP::
0 | 0 | 0 | 0s | 0s | remove_metaclass_by_name | Class::MOP::
0 | 0 | 0 | 0s | 0s | weaken_metaclass | Class::MOP::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | |||||
2 | package Class::MOP; | ||||
3 | # spent 7µs within Class::MOP::BEGIN@3 which was called:
# once (7µs+0s) by Moose::Exporter::BEGIN@13 at line 5 | ||||
4 | 1 | 4µs | $Class::MOP::AUTHORITY = 'cpan:STEVAN'; | ||
5 | 1 | 24µs | 1 | 7µs | } # spent 7µs making 1 call to Class::MOP::BEGIN@3 |
6 | { | ||||
7 | 2 | 1µs | $Class::MOP::VERSION = '2.1005'; | ||
8 | } | ||||
9 | |||||
10 | 2 | 18µs | 2 | 25µs | # spent 15µs (5+10) within Class::MOP::BEGIN@10 which was called:
# once (5µs+10µs) by Moose::Exporter::BEGIN@13 at line 10 # spent 15µs making 1 call to Class::MOP::BEGIN@10
# spent 10µs making 1 call to strict::import |
11 | 2 | 19µs | 2 | 14µs | # spent 11µs (8+3) within Class::MOP::BEGIN@11 which was called:
# once (8µs+3µs) by Moose::Exporter::BEGIN@13 at line 11 # spent 11µs making 1 call to Class::MOP::BEGIN@11
# spent 3µs making 1 call to warnings::import |
12 | |||||
13 | 2 | 37µs | 1 | 8µs | # spent 8µs within Class::MOP::BEGIN@13 which was called:
# once (8µs+0s) by Moose::Exporter::BEGIN@13 at line 13 # spent 8µs making 1 call to Class::MOP::BEGIN@13 |
14 | |||||
15 | 2 | 84µs | 1 | 1.37ms | # spent 1.37ms (1.26+110µs) within Class::MOP::BEGIN@15 which was called:
# once (1.26ms+110µs) by Moose::Exporter::BEGIN@13 at line 15 # spent 1.37ms making 1 call to Class::MOP::BEGIN@15 |
16 | |||||
17 | 2 | 21µs | 2 | 48µs | # spent 27µs (6+21) within Class::MOP::BEGIN@17 which was called:
# once (6µs+21µs) by Moose::Exporter::BEGIN@13 at line 17 # spent 27µs making 1 call to Class::MOP::BEGIN@17
# spent 21µs making 1 call to Exporter::import |
18 | 3 | 32µs | 2 | 20µs | # spent 14µs (7+7) within Class::MOP::BEGIN@18 which was called:
# once (7µs+7µs) by Moose::Exporter::BEGIN@13 at line 18 # spent 14µs making 1 call to Class::MOP::BEGIN@18
# spent 7µs making 1 call to UNIVERSAL::VERSION |
19 | 2 | 20µs | 2 | 63µs | # spent 34µs (5+29) within Class::MOP::BEGIN@19 which was called:
# once (5µs+29µs) by Moose::Exporter::BEGIN@13 at line 19 # spent 34µs making 1 call to Class::MOP::BEGIN@19
# spent 29µs making 1 call to Exporter::import |
20 | 2 | 17µs | 2 | 10µs | # spent 8µs (6+2) within Class::MOP::BEGIN@20 which was called:
# once (6µs+2µs) by Moose::Exporter::BEGIN@13 at line 20 # spent 8µs making 1 call to Class::MOP::BEGIN@20
# spent 2µs making 1 call to Sub::Install::__ANON__[Sub/Install.pm:284] |
21 | 2 | 18µs | 2 | 52µs | # spent 28µs (5+23) within Class::MOP::BEGIN@21 which was called:
# once (5µs+23µs) by Moose::Exporter::BEGIN@13 at line 21 # spent 28µs making 1 call to Class::MOP::BEGIN@21
# spent 23µs making 1 call to Exporter::import |
22 | |||||
23 | 2 | 88µs | 1 | 801µs | # spent 801µs (458+343) within Class::MOP::BEGIN@23 which was called:
# once (458µs+343µs) by Moose::Exporter::BEGIN@13 at line 23 # spent 801µs making 1 call to Class::MOP::BEGIN@23 |
24 | 2 | 82µs | 1 | 632µs | # spent 632µs (495+137) within Class::MOP::BEGIN@24 which was called:
# once (495µs+137µs) by Moose::Exporter::BEGIN@13 at line 24 # spent 632µs making 1 call to Class::MOP::BEGIN@24 |
25 | 2 | 87µs | 1 | 3.95ms | # spent 3.95ms (1.34+2.60) within Class::MOP::BEGIN@25 which was called:
# once (1.34ms+2.60ms) by Moose::Exporter::BEGIN@13 at line 25 # spent 3.95ms making 1 call to Class::MOP::BEGIN@25 |
26 | 2 | 99µs | 1 | 18.4ms | # spent 18.4ms (5.94+12.5) within Class::MOP::BEGIN@26 which was called:
# once (5.94ms+12.5ms) by Moose::Exporter::BEGIN@13 at line 26 # spent 18.4ms making 1 call to Class::MOP::BEGIN@26 |
27 | 2 | 100µs | 1 | 2.31ms | # spent 2.31ms (2.08+237µs) within Class::MOP::BEGIN@27 which was called:
# once (2.08ms+237µs) by Moose::Exporter::BEGIN@13 at line 27 # spent 2.31ms making 1 call to Class::MOP::BEGIN@27 |
28 | 2 | 61µs | 1 | 6µs | # spent 6µs within Class::MOP::BEGIN@28 which was called:
# once (6µs+0s) by Moose::Exporter::BEGIN@13 at line 28 # spent 6µs making 1 call to Class::MOP::BEGIN@28 |
29 | |||||
30 | # spent 5µs within Class::MOP::BEGIN@30 which was called:
# once (5µs+0s) by Moose::Exporter::BEGIN@13 at line 37 | ||||
31 | *IS_RUNNING_ON_5_10 = ($] < 5.009_005) | ||||
32 | ? sub () { 0 } | ||||
33 | 1 | 2µs | : sub () { 1 }; | ||
34 | |||||
35 | # this is either part of core or set up appropriately by MRO::Compat | ||||
36 | 1 | 4µs | *check_package_cache_flag = \&mro::get_pkg_gen; | ||
37 | 1 | 1.87ms | 1 | 5µs | } # spent 5µs making 1 call to Class::MOP::BEGIN@30 |
38 | |||||
39 | XSLoader::load( | ||||
40 | 'Moose', | ||||
41 | 1 | 83µs | 1 | 59µs | $Class::MOP::{VERSION} ? ${ $Class::MOP::{VERSION} } : () # spent 59µs making 1 call to XSLoader::load |
42 | ); | ||||
43 | |||||
44 | { | ||||
45 | # Metaclasses are singletons, so we cache them here. | ||||
46 | # there is no need to worry about destruction though | ||||
47 | # because they should die only when the program dies. | ||||
48 | # After all, do package definitions even get reaped? | ||||
49 | # Anonymous classes manage their own destruction. | ||||
50 | 2 | 500ns | my %METAS; | ||
51 | |||||
52 | sub get_all_metaclasses { %METAS } | ||||
53 | sub get_all_metaclass_instances { values %METAS } | ||||
54 | sub get_all_metaclass_names { keys %METAS } | ||||
55 | 2451 | 11.4ms | # spent 1.82ms within Class::MOP::get_metaclass_by_name which was called 2451 times, avg 744ns/call:
# 2135 times (1.62ms+0s) by Class::MOP::Class::initialize at line 47 of Class/MOP/Class.pm, avg 758ns/call
# 140 times (76µs+0s) by Class::MOP::Class::_single_metaclass_is_compatible at line 282 of Class/MOP/Class.pm, avg 544ns/call
# 79 times (49µs+0s) by Class::MOP::Class::_construct_class_instance at line 88 of Class/MOP/Class.pm, avg 625ns/call
# 22 times (15µs+0s) by Class::MOP::Package::initialize at line 32 of Class/MOP/Package.pm, avg 664ns/call
# 20 times (15µs+0s) by Class::MOP::Class::_class_metaclass_is_compatible at line 252 of Class/MOP/Class.pm, avg 740ns/call
# 19 times (21µs+0s) by Moose::Role::init_meta at line 129 of Moose/Role.pm, avg 1µs/call
# 19 times (12µs+0s) by Moose::Meta::Role::initialize at line 183 of Moose/Meta/Role.pm, avg 637ns/call
# 13 times (12µs+0s) by Moose::Meta::Class::initialize at line 79 of Moose/Meta/Class.pm, avg 938ns/call
# 4 times (4µs+0s) by Moose::init_meta at line 170 of Moose.pm, avg 1µs/call | ||
56 | 101 | 185µs | # spent 135µs within Class::MOP::store_metaclass_by_name which was called 101 times, avg 1µs/call:
# 79 times (113µs+0s) by Class::MOP::Class::_construct_class_instance at line 113 of Class/MOP/Class.pm, avg 1µs/call
# 22 times (22µs+0s) by Class::MOP::Package::initialize at line 39 of Class/MOP/Package.pm, avg 1µs/call | ||
57 | sub weaken_metaclass { weaken($METAS{$_[0]}) } | ||||
58 | 140 | 412µs | 140 | 56µs | # spent 368µs (312+56) within Class::MOP::metaclass_is_weak which was called 140 times, avg 3µs/call:
# 109 times (244µs+43µs) by Class::MOP::Class::_construct_instance at line 527 of Class/MOP/Class.pm, avg 3µs/call
# 31 times (68µs+12µs) by Class::MOP::Class::_inline_preserve_weak_metaclasses at line 691 of Class/MOP/Class.pm, avg 3µs/call # spent 56µs making 140 calls to Scalar::Util::isweak, avg 399ns/call |
59 | sub does_metaclass_exist { exists $METAS{$_[0]} && defined $METAS{$_[0]} } | ||||
60 | sub remove_metaclass_by_name { delete $METAS{$_[0]}; return } | ||||
61 | |||||
62 | # This handles instances as well as class names | ||||
63 | # spent 1.04ms (925µs+110µs) within Class::MOP::class_of which was called 347 times, avg 3µs/call:
# 132 times (288µs+30µs) by Moose::Meta::Class::excludes_role at line 268 of Moose/Meta/Class.pm, avg 2µs/call
# 60 times (190µs+22µs) by Moose::Exporter::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Moose/Exporter.pm:252] at line 252 of Moose/Exporter.pm, avg 4µs/call
# 52 times (152µs+18µs) by Moose::Exporter::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Moose/Exporter.pm:42] at line 42 of Moose/Exporter.pm, avg 3µs/call
# 51 times (148µs+23µs) by Moose::Util::find_meta at line 47 of Moose/Util.pm, avg 3µs/call
# 22 times (62µs+8µs) by Class::MOP::Class::_superclasses_updated at line 970 of Class/MOP/Class.pm, avg 3µs/call
# 20 times (58µs+7µs) by Moose::Meta::Class::superclasses at line 565 of Moose/Meta/Class.pm, avg 3µs/call
# 9 times (21µs+2µs) by Moose::Meta::Attribute::BEGIN@24 at line 712 of Moose/Util/TypeConstraints.pm, avg 3µs/call
# once (4µs+500ns) by Class::MOP::Object::_new at line 24 of Class/MOP/Object.pm | ||||
64 | 347 | 39µs | return unless defined $_[0]; | ||
65 | 347 | 629µs | 347 | 110µs | my $class = blessed($_[0]) || $_[0]; # spent 110µs making 347 calls to Scalar::Util::blessed, avg 318ns/call |
66 | 347 | 546µs | return $METAS{$class}; | ||
67 | } | ||||
68 | |||||
69 | # NOTE: | ||||
70 | # We only cache metaclasses, meaning instances of | ||||
71 | # Class::MOP::Class. We do not cache instance of | ||||
72 | # Class::MOP::Package or Class::MOP::Module. Mostly | ||||
73 | # because I don't yet see a good reason to do so. | ||||
74 | } | ||||
75 | |||||
76 | # spent 4µs within Class::MOP::load_class which was called 2 times, avg 2µs/call:
# 2 times (4µs+0s) by MooseX::Storage::_expand_role at line 58 of MooseX/Storage.pm, avg 2µs/call | ||||
77 | 2 | 7µs | 2 | 27.5ms | goto &Class::Load::load_class; # spent 27.5ms making 2 calls to Class::Load::load_class, avg 13.8ms/call |
78 | } | ||||
79 | |||||
80 | sub load_first_existing_class { | ||||
81 | goto &Class::Load::load_first_existing_class; | ||||
82 | } | ||||
83 | |||||
84 | sub is_class_loaded { | ||||
85 | goto &Class::Load::is_class_loaded; | ||||
86 | } | ||||
87 | |||||
88 | # spent 560µs within Class::MOP::_definition_context which was called 123 times, avg 5µs/call:
# 3 times (13µs+0s) by Moose::BEGIN@35 at line 309 of Moose/Meta/Role.pm, avg 4µs/call
# 2 times (9µs+0s) by Moose::BEGIN@35 at line 92 of Moose/Meta/Role.pm, avg 5µs/call
# once (13µs+0s) by Moose::Exporter::BEGIN@13 at line 572
# once (8µs+0s) by Moose::Exporter::BEGIN@13 at line 198
# once (6µs+0s) by Moose::BEGIN@27 at line 38 of Moose/Meta/Class.pm
# once (6µs+0s) by Moose::Exporter::BEGIN@13 at line 223
# once (5µs+0s) by Moose::Meta::TypeCoercion::BEGIN@14 at line 31 of Moose/Meta/Attribute.pm
# once (5µs+0s) by Moose::Exporter::BEGIN@13 at line 133
# once (5µs+0s) by Moose::BEGIN@39 at line 19 of Moose/Meta/Role/Application/ToClass.pm
# once (5µs+0s) by base::import at line 14 of Moose/Meta/Mixin/AttributeCore.pm
# once (5µs+0s) by Moose::BEGIN@29 at line 20 of Moose/Meta/TypeCoercion.pm
# once (5µs+0s) by Moose::BEGIN@28 at line 28 of Moose/Meta/TypeConstraint.pm
# once (5µs+0s) by Moose::Meta::Role::BEGIN@22 at line 17 of Moose/Meta/Role/Method/Conflicting.pm
# once (5µs+0s) by Moose::Util::TypeConstraints::BEGIN@38 at line 18 of Moose/Meta/TypeConstraint/Enum.pm
# once (5µs+0s) by Moose::Util::TypeConstraints::BEGIN@33 at line 24 of Moose/Meta/TypeConstraint/Union.pm
# once (5µs+0s) by Moose::Util::TypeConstraints::BEGIN@39 at line 22 of Moose/Meta/TypeConstraint/DuckType.pm
# once (5µs+0s) by Moose::BEGIN@36 at line 24 of Moose/Meta/Role/Composite.pm
# once (5µs+0s) by Moose::BEGIN@38 at line 22 of Moose/Meta/Role/Application/RoleSummation.pm
# once (5µs+0s) by Moose::BEGIN@41 at line 21 of Moose/Meta/Role/Application/ToInstance.pm
# once (5µs+0s) by Moose::Util::TypeConstraints::BEGIN@37 at line 19 of Moose/Meta/TypeConstraint/Role.pm
# once (5µs+0s) by Moose::Util::TypeConstraints::BEGIN@36 at line 19 of Moose/Meta/TypeConstraint/Class.pm
# once (5µs+0s) by Moose::BEGIN@28 at line 32 of Moose/Meta/TypeConstraint.pm
# once (5µs+0s) by Moose::BEGIN@37 at line 17 of Moose/Meta/Role/Application.pm
# once (5µs+0s) by Moose::Util::TypeConstraints::BEGIN@34 at line 19 of Moose/Meta/TypeConstraint/Parameterized.pm
# once (5µs+0s) by Moose::Util::TypeConstraints::BEGIN@42 at line 18 of Moose/Meta/TypeConstraint/Registry.pm
# once (5µs+0s) by Moose::BEGIN@28 at line 118 of Moose/Meta/TypeConstraint.pm
# once (5µs+0s) by Moose::Meta::Role::BEGIN@19 at line 18 of Moose/Meta/Role/Attribute.pm
# once (5µs+0s) by Moose::Util::TypeConstraints::BEGIN@38 at line 23 of Moose/Meta/TypeConstraint/Enum.pm
# once (5µs+0s) by Moose::Meta::TypeConstraint::Parameterized::BEGIN@15 at line 19 of Moose/Meta/TypeConstraint/Parameterizable.pm
# once (5µs+0s) by Moose::Util::TypeConstraints::BEGIN@42 at line 28 of Moose/Meta/TypeConstraint/Registry.pm
# once (5µs+0s) by Moose::BEGIN@36 at line 37 of Moose/Meta/Role/Composite.pm
# once (5µs+0s) by Moose::Meta::Role::BEGIN@21 at line 22 of Moose/Meta/Role/Method/Required.pm
# once (5µs+0s) by Moose::BEGIN@39 at line 24 of Moose/Meta/Role/Application/ToClass.pm
# once (5µs+0s) by Moose::BEGIN@29 at line 23 of Moose/Meta/TypeCoercion.pm
# once (5µs+0s) by Moose::BEGIN@29 at line 32 of Moose/Meta/TypeCoercion.pm
# once (5µs+0s) by Moose::BEGIN@28 at line 112 of Moose/Meta/TypeConstraint.pm
# once (5µs+0s) by Moose::Meta::TypeConstraint::Parameterized::BEGIN@15 at line 25 of Moose/Meta/TypeConstraint/Parameterizable.pm
# once (5µs+0s) by Moose::Exporter::BEGIN@13 at line 386
# once (5µs+0s) by Moose::BEGIN@35 at line 134 of Moose/Meta/Role.pm
# once (5µs+0s) by Moose::Meta::Role::BEGIN@19 at line 25 of Moose/Meta/Role/Attribute.pm
# once (5µs+0s) by Moose::BEGIN@37 at line 24 of Moose/Meta/Role/Application.pm
# once (5µs+0s) by Moose::Util::TypeConstraints::BEGIN@34 at line 25 of Moose/Meta/TypeConstraint/Parameterized.pm
# once (5µs+0s) by Moose::Exporter::BEGIN@13 at line 137
# once (5µs+0s) by Moose::Exporter::BEGIN@13 at line 250
# once (5µs+0s) by Moose::Exporter::BEGIN@13 at line 551
# once (4µs+0s) by Moose::BEGIN@36 at line 40 of Moose/Meta/Role/Composite.pm
# once (4µs+0s) by Moose::BEGIN@35 at line 141 of Moose/Meta/Role.pm
# once (4µs+0s) by Moose::BEGIN@35 at line 162 of Moose/Meta/Role.pm
# once (4µs+0s) by Moose::BEGIN@35 at line 128 of Moose/Meta/Role.pm
# once (4µs+0s) by Moose::BEGIN@35 at line 148 of Moose/Meta/Role.pm
# once (4µs+0s) by Moose::BEGIN@28 at line 43 of Moose/Meta/TypeConstraint.pm
# once (4µs+0s) by Moose::BEGIN@28 at line 52 of Moose/Meta/TypeConstraint.pm
# once (4µs+0s) by Moose::BEGIN@27 at line 44 of Moose/Meta/Class.pm
# once (4µs+0s) by Moose::BEGIN@27 at line 47 of Moose/Meta/Class.pm
# once (4µs+0s) by Moose::Exporter::BEGIN@13 at line 490
# once (4µs+0s) by Moose::Exporter::BEGIN@13 at line 178
# once (4µs+0s) by Moose::Exporter::BEGIN@13 at line 497
# once (4µs+0s) by Moose::BEGIN@35 at line 155 of Moose/Meta/Role.pm
# once (4µs+0s) by Moose::BEGIN@28 at line 46 of Moose/Meta/TypeConstraint.pm
# once (4µs+0s) by Moose::Meta::Role::BEGIN@19 at line 32 of Moose/Meta/Role/Attribute.pm
# once (4µs+0s) by Moose::Meta::Role::BEGIN@19 at line 46 of Moose/Meta/Role/Attribute.pm
# once (4µs+0s) by Moose::Meta::Role::BEGIN@19 at line 39 of Moose/Meta/Role/Attribute.pm
# once (4µs+0s) by Moose::Exporter::BEGIN@13 at line 150
# once (4µs+0s) by Moose::Exporter::BEGIN@13 at line 460
# once (4µs+0s) by Moose::Exporter::BEGIN@13 at line 504
# once (4µs+0s) by Moose::Exporter::BEGIN@13 at line 511
# once (4µs+0s) by Moose::Exporter::BEGIN@13 at line 479
# once (4µs+0s) by Moose::Exporter::BEGIN@13 at line 518
# once (4µs+0s) by Moose::Exporter::BEGIN@13 at line 534
# once (4µs+0s) by Moose::BEGIN@35 at line 169 of Moose/Meta/Role.pm
# once (4µs+0s) by Moose::BEGIN@35 at line 401 of Moose/Meta/Role.pm
# once (4µs+0s) by Moose::BEGIN@28 at line 102 of Moose/Meta/TypeConstraint.pm
# once (4µs+0s) by Moose::BEGIN@28 at line 78 of Moose/Meta/TypeConstraint.pm
# once (4µs+0s) by Moose::BEGIN@28 at line 84 of Moose/Meta/TypeConstraint.pm
# once (4µs+0s) by Moose::BEGIN@27 at line 55 of Moose/Meta/Class.pm
# once (4µs+0s) by Moose::BEGIN@27 at line 61 of Moose/Meta/Class.pm
# once (4µs+0s) by Moose::Exporter::BEGIN@13 at line 291
# once (4µs+0s) by Moose::Exporter::BEGIN@13 at line 562
# once (4µs+0s) by Moose::Exporter::BEGIN@13 at line 635
# once (4µs+0s) by Moose::Exporter::BEGIN@13 at line 287
# once (4µs+0s) by Moose::Exporter::BEGIN@13 at line 270
# once (4µs+0s) by Moose::Exporter::BEGIN@13 at line 182
# once (4µs+0s) by Moose::Exporter::BEGIN@13 at line 543
# once (4µs+0s) by Moose::Exporter::BEGIN@13 at line 355
# once (4µs+0s) by Moose::BEGIN@35 at line 355 of Moose/Meta/Role.pm
# once (4µs+0s) by Moose::BEGIN@28 at line 91 of Moose/Meta/TypeConstraint.pm
# once (4µs+0s) by Moose::BEGIN@27 at line 67 of Moose/Meta/Class.pm
# once (4µs+0s) by Moose::Exporter::BEGIN@13 at line 441
# once (4µs+0s) by Moose::Exporter::BEGIN@13 at line 425
# once (4µs+0s) by Moose::Exporter::BEGIN@13 at line 449
# once (4µs+0s) by Moose::Exporter::BEGIN@13 at line 317
# once (4µs+0s) by Moose::Exporter::BEGIN@13 at line 597
# once (4µs+0s) by Moose::Exporter::BEGIN@13 at line 378
# once (4µs+0s) by Moose::Exporter::BEGIN@13 at line 307
# once (4µs+0s) by Moose::Exporter::BEGIN@13 at line 433
# once (4µs+0s) by Moose::Exporter::BEGIN@13 at line 394
# once (4µs+0s) by Moose::Exporter::BEGIN@13 at line 370
# once (4µs+0s) by Moose::Exporter::BEGIN@13 at line 417
# once (4µs+0s) by Moose::Exporter::BEGIN@13 at line 327
# once (4µs+0s) by Moose::Exporter::BEGIN@13 at line 409
# once (4µs+0s) by Moose::Exporter::BEGIN@13 at line 649
# once (4µs+0s) by Moose::Exporter::BEGIN@13 at line 581
# once (4µs+0s) by Moose::Exporter::BEGIN@13 at line 618
# once (4µs+0s) by Moose::Exporter::BEGIN@13 at line 401
# once (4µs+0s) by Moose::Exporter::BEGIN@13 at line 601
# once (4µs+0s) by base::import at line 42 of Moose/Meta/Mixin/AttributeCore.pm
# once (4µs+0s) by Moose::Exporter::BEGIN@13 at line 338
# once (4µs+0s) by Moose::Exporter::BEGIN@13 at line 642
# once (4µs+0s) by Moose::Exporter::BEGIN@13 at line 625
# once (4µs+0s) by base::import at line 35 of Moose/Meta/Mixin/AttributeCore.pm
# once (4µs+0s) by base::import at line 62 of Moose/Meta/Mixin/AttributeCore.pm
# once (4µs+0s) by base::import at line 92 of Moose/Meta/Mixin/AttributeCore.pm
# once (4µs+0s) by base::import at line 28 of Moose/Meta/Mixin/AttributeCore.pm
# once (4µs+0s) by base::import at line 101 of Moose/Meta/Mixin/AttributeCore.pm
# once (4µs+0s) by base::import at line 21 of Moose/Meta/Mixin/AttributeCore.pm
# once (4µs+0s) by base::import at line 76 of Moose/Meta/Mixin/AttributeCore.pm
# once (4µs+0s) by base::import at line 48 of Moose/Meta/Mixin/AttributeCore.pm
# once (4µs+0s) by base::import at line 84 of Moose/Meta/Mixin/AttributeCore.pm
# once (4µs+0s) by base::import at line 55 of Moose/Meta/Mixin/AttributeCore.pm
# once (4µs+0s) by base::import at line 69 of Moose/Meta/Mixin/AttributeCore.pm | ||||
89 | 123 | 13µs | my %context; | ||
90 | 123 | 385µs | @context{qw(package file line)} = caller(1); | ||
91 | |||||
92 | return ( | ||||
93 | 123 | 341µs | definition_context => \%context, | ||
94 | ); | ||||
95 | } | ||||
96 | |||||
97 | ## ---------------------------------------------------------------------------- | ||||
98 | ## Setting up our environment ... | ||||
99 | ## ---------------------------------------------------------------------------- | ||||
100 | ## Class::MOP needs to have a few things in the global perl environment so | ||||
101 | ## that it can operate effectively. Those things are done here. | ||||
102 | ## ---------------------------------------------------------------------------- | ||||
103 | |||||
104 | # ... nothing yet actually ;) | ||||
105 | |||||
106 | ## ---------------------------------------------------------------------------- | ||||
107 | ## Bootstrapping | ||||
108 | ## ---------------------------------------------------------------------------- | ||||
109 | ## The code below here is to bootstrap our MOP with itself. This is also | ||||
110 | ## sometimes called "tying the knot". By doing this, we make it much easier | ||||
111 | ## to extend the MOP through subclassing and such since now you can use the | ||||
112 | ## MOP itself to extend itself. | ||||
113 | ## | ||||
114 | ## Yes, I know, that's weird and insane, but it's a good thing, trust me :) | ||||
115 | ## ---------------------------------------------------------------------------- | ||||
116 | |||||
117 | # We need to add in the meta-attributes here so that | ||||
118 | # any subclass of Class::MOP::* will be able to | ||||
119 | # inherit them using _construct_instance | ||||
120 | |||||
121 | ## -------------------------------------------------------- | ||||
122 | ## Class::MOP::Mixin::HasMethods | ||||
123 | |||||
124 | Class::MOP::Mixin::HasMethods->meta->add_attribute( | ||||
125 | Class::MOP::Attribute->new('_methods' => ( | ||||
126 | reader => { | ||||
127 | # NOTE: | ||||
128 | # we just alias the original method | ||||
129 | # rather than re-produce it here | ||||
130 | '_method_map' => \&Class::MOP::Mixin::HasMethods::_method_map | ||||
131 | }, | ||||
132 | 32 | 56µs | # spent 32µs within Class::MOP::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Class/MOP.pm:132] which was called 32 times, avg 994ns/call:
# 19 times (20µs+0s) by Moose::Meta::Role::_new at line 15 of (eval 74)[Eval/Closure.pm:135], avg 1µs/call
# 13 times (12µs+0s) by Class::MOP::Mixin::AttributeCore::default at line 45 of Class/MOP/Mixin/AttributeCore.pm, avg 908ns/call | ||
133 | 1 | 12µs | 4 | 1.12ms | _definition_context(), # spent 596µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 489µs making 1 call to Class::MOP::Mixin::meta
# spent 27µs making 1 call to Class::MOP::Attribute::new
# spent 5µs making 1 call to Class::MOP::_definition_context |
134 | )) | ||||
135 | ); | ||||
136 | |||||
137 | 1 | 7µs | 4 | 268µs | Class::MOP::Mixin::HasMethods->meta->add_attribute( # spent 239µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 15µs making 1 call to Class::MOP::Attribute::new
# spent 9µs making 1 call to Class::MOP::Mixin::meta
# spent 5µs making 1 call to Class::MOP::_definition_context |
138 | Class::MOP::Attribute->new('method_metaclass' => ( | ||||
139 | reader => { | ||||
140 | # NOTE: | ||||
141 | # we just alias the original method | ||||
142 | # rather than re-produce it here | ||||
143 | 'method_metaclass' => \&Class::MOP::Mixin::HasMethods::method_metaclass | ||||
144 | }, | ||||
145 | default => 'Class::MOP::Method', | ||||
146 | _definition_context(), | ||||
147 | )) | ||||
148 | ); | ||||
149 | |||||
150 | 1 | 7µs | 4 | 236µs | Class::MOP::Mixin::HasMethods->meta->add_attribute( # spent 208µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 15µs making 1 call to Class::MOP::Attribute::new
# spent 9µs making 1 call to Class::MOP::Mixin::meta
# spent 4µs making 1 call to Class::MOP::_definition_context |
151 | Class::MOP::Attribute->new('wrapped_method_metaclass' => ( | ||||
152 | reader => { | ||||
153 | # NOTE: | ||||
154 | # we just alias the original method | ||||
155 | # rather than re-produce it here | ||||
156 | 'wrapped_method_metaclass' => \&Class::MOP::Mixin::HasMethods::wrapped_method_metaclass | ||||
157 | }, | ||||
158 | default => 'Class::MOP::Method::Wrapped', | ||||
159 | _definition_context(), | ||||
160 | )) | ||||
161 | ); | ||||
162 | |||||
163 | ## -------------------------------------------------------- | ||||
164 | ## Class::MOP::Mixin::HasMethods | ||||
165 | |||||
166 | Class::MOP::Mixin::HasAttributes->meta->add_attribute( | ||||
167 | Class::MOP::Attribute->new('attributes' => ( | ||||
168 | reader => { | ||||
169 | # NOTE: we need to do this in order | ||||
170 | # for the instance meta-object to | ||||
171 | # not fall into meta-circular death | ||||
172 | # | ||||
173 | # we just alias the original method | ||||
174 | # rather than re-produce it here | ||||
175 | '_attribute_map' => \&Class::MOP::Mixin::HasAttributes::_attribute_map | ||||
176 | }, | ||||
177 | 35 | 58µs | # spent 30µs within Class::MOP::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Class/MOP.pm:177] which was called 35 times, avg 860ns/call:
# 19 times (17µs+0s) by Moose::Meta::Role::_new at line 63 of (eval 74)[Eval/Closure.pm:135], avg 874ns/call
# 13 times (11µs+0s) by Class::MOP::Mixin::AttributeCore::default at line 45 of Class/MOP/Mixin/AttributeCore.pm, avg 862ns/call
# 3 times (2µs+0s) by Moose::Meta::Role::Composite::_new at line 69 of (eval 74)[Eval/Closure.pm:135], avg 767ns/call | ||
178 | 1 | 10µs | 4 | 479µs | _definition_context(), # spent 232µs making 1 call to Class::MOP::Mixin::meta
# spent 218µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 24µs making 1 call to Class::MOP::Attribute::new
# spent 4µs making 1 call to Class::MOP::_definition_context |
179 | )) | ||||
180 | ); | ||||
181 | |||||
182 | 1 | 7µs | 4 | 232µs | Class::MOP::Mixin::HasAttributes->meta->add_attribute( # spent 205µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 14µs making 1 call to Class::MOP::Attribute::new
# spent 9µs making 1 call to Class::MOP::Mixin::meta
# spent 4µs making 1 call to Class::MOP::_definition_context |
183 | Class::MOP::Attribute->new('attribute_metaclass' => ( | ||||
184 | reader => { | ||||
185 | # NOTE: | ||||
186 | # we just alias the original method | ||||
187 | # rather than re-produce it here | ||||
188 | 'attribute_metaclass' => \&Class::MOP::Mixin::HasAttributes::attribute_metaclass | ||||
189 | }, | ||||
190 | default => 'Class::MOP::Attribute', | ||||
191 | _definition_context(), | ||||
192 | )) | ||||
193 | ); | ||||
194 | |||||
195 | ## -------------------------------------------------------- | ||||
196 | ## Class::MOP::Package | ||||
197 | |||||
198 | 1 | 11µs | 4 | 4.95ms | Class::MOP::Package->meta->add_attribute( # spent 4.65ms making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 274µs making 1 call to Class::MOP::Object::meta
# spent 16µs making 1 call to Class::MOP::Attribute::new
# spent 8µs making 1 call to Class::MOP::_definition_context |
199 | Class::MOP::Attribute->new('package' => ( | ||||
200 | reader => { | ||||
201 | # NOTE: we need to do this in order | ||||
202 | # for the instance meta-object to | ||||
203 | # not fall into meta-circular death | ||||
204 | # | ||||
205 | # we just alias the original method | ||||
206 | # rather than re-produce it here | ||||
207 | 'name' => \&Class::MOP::Package::name | ||||
208 | }, | ||||
209 | _definition_context(), | ||||
210 | )) | ||||
211 | ); | ||||
212 | |||||
213 | Class::MOP::Package->meta->add_attribute( | ||||
214 | Class::MOP::Attribute->new('namespace' => ( | ||||
215 | reader => { | ||||
216 | # NOTE: | ||||
217 | # we just alias the original method | ||||
218 | # rather than re-produce it here | ||||
219 | 'namespace' => \&Class::MOP::Package::namespace | ||||
220 | }, | ||||
221 | init_arg => undef, | ||||
222 | 35 | 59µs | # spent 26µs within Class::MOP::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Class/MOP.pm:222] which was called 35 times, avg 757ns/call:
# 19 times (13µs+0s) by Moose::Meta::Role::_new at line 93 of (eval 74)[Eval/Closure.pm:135], avg 668ns/call
# 13 times (12µs+0s) by Class::MOP::Mixin::AttributeCore::default at line 45 of Class/MOP/Mixin/AttributeCore.pm, avg 923ns/call
# 3 times (2µs+0s) by Moose::Meta::Role::Composite::_new at line 102 of (eval 74)[Eval/Closure.pm:135], avg 600ns/call | ||
223 | 1 | 12µs | 4 | 268µs | _definition_context(), # spent 228µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 22µs making 1 call to Class::MOP::Attribute::new
# spent 12µs making 1 call to Class::MOP::Object::meta
# spent 6µs making 1 call to Class::MOP::_definition_context |
224 | )) | ||||
225 | ); | ||||
226 | |||||
227 | ## -------------------------------------------------------- | ||||
228 | ## Class::MOP::Module | ||||
229 | |||||
230 | # NOTE: | ||||
231 | # yeah this is kind of stretching things a bit, | ||||
232 | # but truthfully the version should be an attribute | ||||
233 | # of the Module, the weirdness comes from having to | ||||
234 | # stick to Perl 5 convention and store it in the | ||||
235 | # $VERSION package variable. Basically if you just | ||||
236 | # squint at it, it will look how you want it to look. | ||||
237 | # Either as a package variable, or as a attribute of | ||||
238 | # the metaclass, isn't abstraction great :) | ||||
239 | |||||
240 | Class::MOP::Module->meta->add_attribute( | ||||
241 | Class::MOP::Attribute->new('version' => ( | ||||
242 | reader => { | ||||
243 | # NOTE: | ||||
244 | # we just alias the original method | ||||
245 | # rather than re-produce it here | ||||
246 | 'version' => \&Class::MOP::Module::version | ||||
247 | }, | ||||
248 | init_arg => undef, | ||||
249 | 35 | 63µs | # spent 25µs within Class::MOP::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Class/MOP.pm:249] which was called 35 times, avg 723ns/call:
# 19 times (13µs+0s) by Moose::Meta::Role::_new at line 123 of (eval 74)[Eval/Closure.pm:135], avg 663ns/call
# 13 times (11µs+0s) by Class::MOP::Mixin::AttributeCore::default at line 45 of Class/MOP/Mixin/AttributeCore.pm, avg 838ns/call
# 3 times (2µs+0s) by Moose::Meta::Role::Composite::_new at line 132 of (eval 74)[Eval/Closure.pm:135], avg 600ns/call | ||
250 | 1 | 12µs | 4 | 489µs | _definition_context(), # spent 258µs making 1 call to Class::MOP::Object::meta
# spent 209µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 18µs making 1 call to Class::MOP::Attribute::new
# spent 5µs making 1 call to Class::MOP::_definition_context |
251 | )) | ||||
252 | ); | ||||
253 | |||||
254 | # NOTE: | ||||
255 | # By following the same conventions as version here, | ||||
256 | # we are opening up the possibility that people can | ||||
257 | # use the $AUTHORITY in non-Class::MOP modules as | ||||
258 | # well. | ||||
259 | |||||
260 | Class::MOP::Module->meta->add_attribute( | ||||
261 | Class::MOP::Attribute->new('authority' => ( | ||||
262 | reader => { | ||||
263 | # NOTE: | ||||
264 | # we just alias the original method | ||||
265 | # rather than re-produce it here | ||||
266 | 'authority' => \&Class::MOP::Module::authority | ||||
267 | }, | ||||
268 | init_arg => undef, | ||||
269 | 35 | 57µs | # spent 28µs within Class::MOP::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Class/MOP.pm:269] which was called 35 times, avg 789ns/call:
# 19 times (15µs+0s) by Moose::Meta::Role::_new at line 66 of (eval 74)[Eval/Closure.pm:135], avg 789ns/call
# 13 times (10µs+0s) by Class::MOP::Mixin::AttributeCore::default at line 45 of Class/MOP/Mixin/AttributeCore.pm, avg 800ns/call
# 3 times (2µs+0s) by Moose::Meta::Role::Composite::_new at line 72 of (eval 74)[Eval/Closure.pm:135], avg 733ns/call | ||
270 | 1 | 8µs | 4 | 235µs | _definition_context(), # spent 204µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 18µs making 1 call to Class::MOP::Attribute::new
# spent 9µs making 1 call to Class::MOP::Object::meta
# spent 4µs making 1 call to Class::MOP::_definition_context |
271 | )) | ||||
272 | ); | ||||
273 | |||||
274 | ## -------------------------------------------------------- | ||||
275 | ## Class::MOP::Class | ||||
276 | |||||
277 | Class::MOP::Class->meta->add_attribute( | ||||
278 | Class::MOP::Attribute->new('superclasses' => ( | ||||
279 | accessor => { | ||||
280 | # NOTE: | ||||
281 | # we just alias the original method | ||||
282 | # rather than re-produce it here | ||||
283 | 'superclasses' => \&Class::MOP::Class::superclasses | ||||
284 | }, | ||||
285 | init_arg => undef, | ||||
286 | 13 | 23µs | # spent 13µs within Class::MOP::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Class/MOP.pm:286] which was called 13 times, avg 977ns/call:
# 13 times (13µs+0s) by Class::MOP::Mixin::AttributeCore::default at line 45 of Class/MOP/Mixin/AttributeCore.pm, avg 977ns/call | ||
287 | 1 | 11µs | 4 | 731µs | _definition_context(), # spent 446µs making 1 call to Class::MOP::Object::meta
# spent 262µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 18µs making 1 call to Class::MOP::Attribute::new
# spent 4µs making 1 call to Class::MOP::_definition_context |
288 | )) | ||||
289 | ); | ||||
290 | |||||
291 | 1 | 6µs | 4 | 215µs | Class::MOP::Class->meta->add_attribute( # spent 188µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 14µs making 1 call to Class::MOP::Attribute::new
# spent 9µs making 1 call to Class::MOP::Object::meta
# spent 4µs making 1 call to Class::MOP::_definition_context |
292 | Class::MOP::Attribute->new('instance_metaclass' => ( | ||||
293 | reader => { | ||||
294 | # NOTE: we need to do this in order | ||||
295 | # for the instance meta-object to | ||||
296 | # not fall into meta-circular death | ||||
297 | # | ||||
298 | # we just alias the original method | ||||
299 | # rather than re-produce it here | ||||
300 | 'instance_metaclass' => \&Class::MOP::Class::instance_metaclass | ||||
301 | }, | ||||
302 | default => 'Class::MOP::Instance', | ||||
303 | _definition_context(), | ||||
304 | )) | ||||
305 | ); | ||||
306 | |||||
307 | 1 | 5µs | 4 | 219µs | Class::MOP::Class->meta->add_attribute( # spent 192µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 14µs making 1 call to Class::MOP::Attribute::new
# spent 8µs making 1 call to Class::MOP::Object::meta
# spent 4µs making 1 call to Class::MOP::_definition_context |
308 | Class::MOP::Attribute->new('immutable_trait' => ( | ||||
309 | reader => { | ||||
310 | 'immutable_trait' => \&Class::MOP::Class::immutable_trait | ||||
311 | }, | ||||
312 | default => "Class::MOP::Class::Immutable::Trait", | ||||
313 | _definition_context(), | ||||
314 | )) | ||||
315 | ); | ||||
316 | |||||
317 | 1 | 5µs | 4 | 213µs | Class::MOP::Class->meta->add_attribute( # spent 187µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 14µs making 1 call to Class::MOP::Attribute::new
# spent 8µs making 1 call to Class::MOP::Object::meta
# spent 4µs making 1 call to Class::MOP::_definition_context |
318 | Class::MOP::Attribute->new('constructor_name' => ( | ||||
319 | reader => { | ||||
320 | 'constructor_name' => \&Class::MOP::Class::constructor_name, | ||||
321 | }, | ||||
322 | default => "new", | ||||
323 | _definition_context(), | ||||
324 | )) | ||||
325 | ); | ||||
326 | |||||
327 | 1 | 6µs | 4 | 211µs | Class::MOP::Class->meta->add_attribute( # spent 184µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 14µs making 1 call to Class::MOP::Attribute::new
# spent 8µs making 1 call to Class::MOP::Object::meta
# spent 4µs making 1 call to Class::MOP::_definition_context |
328 | Class::MOP::Attribute->new('constructor_class' => ( | ||||
329 | reader => { | ||||
330 | 'constructor_class' => \&Class::MOP::Class::constructor_class, | ||||
331 | }, | ||||
332 | default => "Class::MOP::Method::Constructor", | ||||
333 | _definition_context(), | ||||
334 | )) | ||||
335 | ); | ||||
336 | |||||
337 | |||||
338 | 1 | 6µs | 4 | 225µs | Class::MOP::Class->meta->add_attribute( # spent 197µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 16µs making 1 call to Class::MOP::Attribute::new
# spent 8µs making 1 call to Class::MOP::Object::meta
# spent 4µs making 1 call to Class::MOP::_definition_context |
339 | Class::MOP::Attribute->new('destructor_class' => ( | ||||
340 | reader => { | ||||
341 | 'destructor_class' => \&Class::MOP::Class::destructor_class, | ||||
342 | }, | ||||
343 | _definition_context(), | ||||
344 | )) | ||||
345 | ); | ||||
346 | |||||
347 | # NOTE: | ||||
348 | # we don't actually need to tie the knot with | ||||
349 | # Class::MOP::Class here, it is actually handled | ||||
350 | # within Class::MOP::Class itself in the | ||||
351 | # _construct_class_instance method. | ||||
352 | |||||
353 | ## -------------------------------------------------------- | ||||
354 | ## Class::MOP::Mixin::AttributeCore | ||||
355 | 1 | 8µs | 4 | 422µs | Class::MOP::Mixin::AttributeCore->meta->add_attribute( # spent 209µs making 1 call to Class::MOP::Mixin::meta
# spent 196µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 13µs making 1 call to Class::MOP::Attribute::new
# spent 4µs making 1 call to Class::MOP::_definition_context |
356 | Class::MOP::Attribute->new('name' => ( | ||||
357 | reader => { | ||||
358 | # NOTE: we need to do this in order | ||||
359 | # for the instance meta-object to | ||||
360 | # not fall into meta-circular death | ||||
361 | # | ||||
362 | # we just alias the original method | ||||
363 | # rather than re-produce it here | ||||
364 | 'name' => \&Class::MOP::Mixin::AttributeCore::name | ||||
365 | }, | ||||
366 | _definition_context(), | ||||
367 | )) | ||||
368 | ); | ||||
369 | |||||
370 | 1 | 6µs | 4 | 332µs | Class::MOP::Mixin::AttributeCore->meta->add_attribute( # spent 306µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 13µs making 1 call to Class::MOP::Attribute::new
# spent 8µs making 1 call to Class::MOP::Mixin::meta
# spent 4µs making 1 call to Class::MOP::_definition_context |
371 | Class::MOP::Attribute->new('accessor' => ( | ||||
372 | reader => { 'accessor' => \&Class::MOP::Mixin::AttributeCore::accessor }, | ||||
373 | predicate => { 'has_accessor' => \&Class::MOP::Mixin::AttributeCore::has_accessor }, | ||||
374 | _definition_context(), | ||||
375 | )) | ||||
376 | ); | ||||
377 | |||||
378 | 1 | 6µs | 4 | 340µs | Class::MOP::Mixin::AttributeCore->meta->add_attribute( # spent 314µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 13µs making 1 call to Class::MOP::Attribute::new
# spent 8µs making 1 call to Class::MOP::Mixin::meta
# spent 4µs making 1 call to Class::MOP::_definition_context |
379 | Class::MOP::Attribute->new('reader' => ( | ||||
380 | reader => { 'reader' => \&Class::MOP::Mixin::AttributeCore::reader }, | ||||
381 | predicate => { 'has_reader' => \&Class::MOP::Mixin::AttributeCore::has_reader }, | ||||
382 | _definition_context(), | ||||
383 | )) | ||||
384 | ); | ||||
385 | |||||
386 | 1 | 7µs | 4 | 330µs | Class::MOP::Mixin::AttributeCore->meta->add_attribute( # spent 302µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 14µs making 1 call to Class::MOP::Attribute::new
# spent 9µs making 1 call to Class::MOP::Mixin::meta
# spent 5µs making 1 call to Class::MOP::_definition_context |
387 | Class::MOP::Attribute->new('initializer' => ( | ||||
388 | reader => { 'initializer' => \&Class::MOP::Mixin::AttributeCore::initializer }, | ||||
389 | predicate => { 'has_initializer' => \&Class::MOP::Mixin::AttributeCore::has_initializer }, | ||||
390 | _definition_context(), | ||||
391 | )) | ||||
392 | ); | ||||
393 | |||||
394 | 1 | 6µs | 4 | 217µs | Class::MOP::Mixin::AttributeCore->meta->add_attribute( # spent 192µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 13µs making 1 call to Class::MOP::Attribute::new
# spent 9µs making 1 call to Class::MOP::Mixin::meta
# spent 4µs making 1 call to Class::MOP::_definition_context |
395 | Class::MOP::Attribute->new('definition_context' => ( | ||||
396 | reader => { 'definition_context' => \&Class::MOP::Mixin::AttributeCore::definition_context }, | ||||
397 | _definition_context(), | ||||
398 | )) | ||||
399 | ); | ||||
400 | |||||
401 | 1 | 6µs | 4 | 326µs | Class::MOP::Mixin::AttributeCore->meta->add_attribute( # spent 295µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 18µs making 1 call to Class::MOP::Attribute::new
# spent 8µs making 1 call to Class::MOP::Mixin::meta
# spent 4µs making 1 call to Class::MOP::_definition_context |
402 | Class::MOP::Attribute->new('writer' => ( | ||||
403 | reader => { 'writer' => \&Class::MOP::Mixin::AttributeCore::writer }, | ||||
404 | predicate => { 'has_writer' => \&Class::MOP::Mixin::AttributeCore::has_writer }, | ||||
405 | _definition_context(), | ||||
406 | )) | ||||
407 | ); | ||||
408 | |||||
409 | 1 | 6µs | 4 | 328µs | Class::MOP::Mixin::AttributeCore->meta->add_attribute( # spent 302µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 13µs making 1 call to Class::MOP::Attribute::new
# spent 8µs making 1 call to Class::MOP::Mixin::meta
# spent 4µs making 1 call to Class::MOP::_definition_context |
410 | Class::MOP::Attribute->new('predicate' => ( | ||||
411 | reader => { 'predicate' => \&Class::MOP::Mixin::AttributeCore::predicate }, | ||||
412 | predicate => { 'has_predicate' => \&Class::MOP::Mixin::AttributeCore::has_predicate }, | ||||
413 | _definition_context(), | ||||
414 | )) | ||||
415 | ); | ||||
416 | |||||
417 | 1 | 6µs | 4 | 320µs | Class::MOP::Mixin::AttributeCore->meta->add_attribute( # spent 294µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 13µs making 1 call to Class::MOP::Attribute::new
# spent 8µs making 1 call to Class::MOP::Mixin::meta
# spent 4µs making 1 call to Class::MOP::_definition_context |
418 | Class::MOP::Attribute->new('clearer' => ( | ||||
419 | reader => { 'clearer' => \&Class::MOP::Mixin::AttributeCore::clearer }, | ||||
420 | predicate => { 'has_clearer' => \&Class::MOP::Mixin::AttributeCore::has_clearer }, | ||||
421 | _definition_context(), | ||||
422 | )) | ||||
423 | ); | ||||
424 | |||||
425 | 1 | 6µs | 4 | 319µs | Class::MOP::Mixin::AttributeCore->meta->add_attribute( # spent 294µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 13µs making 1 call to Class::MOP::Attribute::new
# spent 8µs making 1 call to Class::MOP::Mixin::meta
# spent 4µs making 1 call to Class::MOP::_definition_context |
426 | Class::MOP::Attribute->new('builder' => ( | ||||
427 | reader => { 'builder' => \&Class::MOP::Mixin::AttributeCore::builder }, | ||||
428 | predicate => { 'has_builder' => \&Class::MOP::Mixin::AttributeCore::has_builder }, | ||||
429 | _definition_context(), | ||||
430 | )) | ||||
431 | ); | ||||
432 | |||||
433 | 1 | 6µs | 4 | 316µs | Class::MOP::Mixin::AttributeCore->meta->add_attribute( # spent 290µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 14µs making 1 call to Class::MOP::Attribute::new
# spent 9µs making 1 call to Class::MOP::Mixin::meta
# spent 4µs making 1 call to Class::MOP::_definition_context |
434 | Class::MOP::Attribute->new('init_arg' => ( | ||||
435 | reader => { 'init_arg' => \&Class::MOP::Mixin::AttributeCore::init_arg }, | ||||
436 | predicate => { 'has_init_arg' => \&Class::MOP::Mixin::AttributeCore::has_init_arg }, | ||||
437 | _definition_context(), | ||||
438 | )) | ||||
439 | ); | ||||
440 | |||||
441 | 1 | 5µs | 4 | 221µs | Class::MOP::Mixin::AttributeCore->meta->add_attribute( # spent 196µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 13µs making 1 call to Class::MOP::Attribute::new
# spent 8µs making 1 call to Class::MOP::Mixin::meta
# spent 4µs making 1 call to Class::MOP::_definition_context |
442 | Class::MOP::Attribute->new('default' => ( | ||||
443 | # default has a custom 'reader' method ... | ||||
444 | predicate => { 'has_default' => \&Class::MOP::Mixin::AttributeCore::has_default }, | ||||
445 | _definition_context(), | ||||
446 | )) | ||||
447 | ); | ||||
448 | |||||
449 | 1 | 7µs | 4 | 421µs | Class::MOP::Mixin::AttributeCore->meta->add_attribute( # spent 395µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 14µs making 1 call to Class::MOP::Attribute::new
# spent 9µs making 1 call to Class::MOP::Mixin::meta
# spent 4µs making 1 call to Class::MOP::_definition_context |
450 | Class::MOP::Attribute->new('insertion_order' => ( | ||||
451 | reader => { 'insertion_order' => \&Class::MOP::Mixin::AttributeCore::insertion_order }, | ||||
452 | writer => { '_set_insertion_order' => \&Class::MOP::Mixin::AttributeCore::_set_insertion_order }, | ||||
453 | predicate => { 'has_insertion_order' => \&Class::MOP::Mixin::AttributeCore::has_insertion_order }, | ||||
454 | _definition_context(), | ||||
455 | )) | ||||
456 | ); | ||||
457 | |||||
458 | ## -------------------------------------------------------- | ||||
459 | ## Class::MOP::Attribute | ||||
460 | 1 | 7µs | 4 | 598µs | Class::MOP::Attribute->meta->add_attribute( # spent 326µs making 1 call to Class::MOP::Object::meta
# spent 248µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 21µs making 1 call to Class::MOP::Attribute::new
# spent 4µs making 1 call to Class::MOP::_definition_context |
461 | Class::MOP::Attribute->new('associated_class' => ( | ||||
462 | reader => { | ||||
463 | # NOTE: we need to do this in order | ||||
464 | # for the instance meta-object to | ||||
465 | # not fall into meta-circular death | ||||
466 | # | ||||
467 | # we just alias the original method | ||||
468 | # rather than re-produce it here | ||||
469 | 'associated_class' => \&Class::MOP::Attribute::associated_class | ||||
470 | }, | ||||
471 | _definition_context(), | ||||
472 | )) | ||||
473 | ); | ||||
474 | |||||
475 | Class::MOP::Attribute->meta->add_attribute( | ||||
476 | Class::MOP::Attribute->new('associated_methods' => ( | ||||
477 | reader => { 'associated_methods' => \&Class::MOP::Attribute::associated_methods }, | ||||
478 | 29 | 56µs | # spent 32µs within Class::MOP::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Class/MOP.pm:478] which was called 29 times, avg 1µs/call:
# 24 times (26µs+0s) by Moose::Meta::Attribute::_new at line 21 of (eval 74)[Eval/Closure.pm:135], avg 1µs/call
# 5 times (6µs+0s) by Class::MOP::Mixin::AttributeCore::default at line 45 of Class/MOP/Mixin/AttributeCore.pm, avg 1µs/call | ||
479 | 1 | 8µs | 4 | 216µs | _definition_context(), # spent 184µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 19µs making 1 call to Class::MOP::Attribute::new
# spent 9µs making 1 call to Class::MOP::Object::meta
# spent 4µs making 1 call to Class::MOP::_definition_context |
480 | )) | ||||
481 | ); | ||||
482 | |||||
483 | Class::MOP::Attribute->meta->add_method('clone' => sub { | ||||
484 | my $self = shift; | ||||
485 | $self->meta->clone_object($self, @_); | ||||
486 | 1 | 4µs | 2 | 56µs | }); # spent 47µs making 1 call to Class::MOP::Mixin::HasMethods::add_method
# spent 8µs making 1 call to Class::MOP::Object::meta |
487 | |||||
488 | ## -------------------------------------------------------- | ||||
489 | ## Class::MOP::Method | ||||
490 | 1 | 7µs | 4 | 2.85ms | Class::MOP::Method->meta->add_attribute( # spent 2.61ms making 1 call to Class::MOP::Object::meta
# spent 221µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 14µs making 1 call to Class::MOP::Attribute::new
# spent 4µs making 1 call to Class::MOP::_definition_context |
491 | Class::MOP::Attribute->new('body' => ( | ||||
492 | reader => { 'body' => \&Class::MOP::Method::body }, | ||||
493 | _definition_context(), | ||||
494 | )) | ||||
495 | ); | ||||
496 | |||||
497 | 1 | 6µs | 4 | 284µs | Class::MOP::Method->meta->add_attribute( # spent 257µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 14µs making 1 call to Class::MOP::Attribute::new
# spent 9µs making 1 call to Class::MOP::Object::meta
# spent 4µs making 1 call to Class::MOP::_definition_context |
498 | Class::MOP::Attribute->new('associated_metaclass' => ( | ||||
499 | reader => { 'associated_metaclass' => \&Class::MOP::Method::associated_metaclass }, | ||||
500 | _definition_context(), | ||||
501 | )) | ||||
502 | ); | ||||
503 | |||||
504 | 1 | 6µs | 4 | 284µs | Class::MOP::Method->meta->add_attribute( # spent 258µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 13µs making 1 call to Class::MOP::Attribute::new
# spent 9µs making 1 call to Class::MOP::Object::meta
# spent 4µs making 1 call to Class::MOP::_definition_context |
505 | Class::MOP::Attribute->new('package_name' => ( | ||||
506 | reader => { 'package_name' => \&Class::MOP::Method::package_name }, | ||||
507 | _definition_context(), | ||||
508 | )) | ||||
509 | ); | ||||
510 | |||||
511 | 1 | 6µs | 4 | 283µs | Class::MOP::Method->meta->add_attribute( # spent 257µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 13µs making 1 call to Class::MOP::Attribute::new
# spent 9µs making 1 call to Class::MOP::Object::meta
# spent 4µs making 1 call to Class::MOP::_definition_context |
512 | Class::MOP::Attribute->new('name' => ( | ||||
513 | reader => { 'name' => \&Class::MOP::Method::name }, | ||||
514 | _definition_context(), | ||||
515 | )) | ||||
516 | ); | ||||
517 | |||||
518 | 1 | 6µs | 4 | 441µs | Class::MOP::Method->meta->add_attribute( # spent 414µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 13µs making 1 call to Class::MOP::Attribute::new
# spent 9µs making 1 call to Class::MOP::Object::meta
# spent 4µs making 1 call to Class::MOP::_definition_context |
519 | Class::MOP::Attribute->new('original_method' => ( | ||||
520 | reader => { 'original_method' => \&Class::MOP::Method::original_method }, | ||||
521 | writer => { '_set_original_method' => \&Class::MOP::Method::_set_original_method }, | ||||
522 | _definition_context(), | ||||
523 | )) | ||||
524 | ); | ||||
525 | |||||
526 | ## -------------------------------------------------------- | ||||
527 | ## Class::MOP::Method::Wrapped | ||||
528 | |||||
529 | # NOTE: | ||||
530 | # the way this item is initialized, this | ||||
531 | # really does not follow the standard | ||||
532 | # practices of attributes, but we put | ||||
533 | # it here for completeness | ||||
534 | 1 | 7µs | 4 | 326µs | Class::MOP::Method::Wrapped->meta->add_attribute( # spent 217µs making 1 call to Class::MOP::Object::meta
# spent 92µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 13µs making 1 call to Class::MOP::Attribute::new
# spent 4µs making 1 call to Class::MOP::_definition_context |
535 | Class::MOP::Attribute->new('modifier_table' => ( | ||||
536 | _definition_context(), | ||||
537 | )) | ||||
538 | ); | ||||
539 | |||||
540 | ## -------------------------------------------------------- | ||||
541 | ## Class::MOP::Method::Generated | ||||
542 | |||||
543 | 1 | 9µs | 4 | 505µs | Class::MOP::Method::Generated->meta->add_attribute( # spent 275µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 208µs making 1 call to Class::MOP::Object::meta
# spent 17µs making 1 call to Class::MOP::Attribute::new
# spent 4µs making 1 call to Class::MOP::_definition_context |
544 | Class::MOP::Attribute->new('is_inline' => ( | ||||
545 | reader => { 'is_inline' => \&Class::MOP::Method::Generated::is_inline }, | ||||
546 | default => 0, | ||||
547 | _definition_context(), | ||||
548 | )) | ||||
549 | ); | ||||
550 | |||||
551 | 1 | 7µs | 4 | 299µs | Class::MOP::Method::Generated->meta->add_attribute( # spent 272µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 14µs making 1 call to Class::MOP::Attribute::new
# spent 9µs making 1 call to Class::MOP::Object::meta
# spent 5µs making 1 call to Class::MOP::_definition_context |
552 | Class::MOP::Attribute->new('definition_context' => ( | ||||
553 | reader => { 'definition_context' => \&Class::MOP::Method::Generated::definition_context }, | ||||
554 | _definition_context(), | ||||
555 | )) | ||||
556 | ); | ||||
557 | |||||
558 | |||||
559 | ## -------------------------------------------------------- | ||||
560 | ## Class::MOP::Method::Inlined | ||||
561 | |||||
562 | 1 | 9µs | 4 | 478µs | Class::MOP::Method::Inlined->meta->add_attribute( # spent 249µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 209µs making 1 call to Class::MOP::Object::meta
# spent 16µs making 1 call to Class::MOP::Attribute::new
# spent 4µs making 1 call to Class::MOP::_definition_context |
563 | Class::MOP::Attribute->new('_expected_method_class' => ( | ||||
564 | reader => { '_expected_method_class' => \&Class::MOP::Method::Inlined::_expected_method_class }, | ||||
565 | _definition_context(), | ||||
566 | )) | ||||
567 | ); | ||||
568 | |||||
569 | ## -------------------------------------------------------- | ||||
570 | ## Class::MOP::Method::Accessor | ||||
571 | |||||
572 | 1 | 8µs | 4 | 449µs | Class::MOP::Method::Accessor->meta->add_attribute( # spent 214µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 208µs making 1 call to Class::MOP::Object::meta
# spent 13µs making 1 call to Class::MOP::Attribute::new
# spent 13µs making 1 call to Class::MOP::_definition_context |
573 | Class::MOP::Attribute->new('attribute' => ( | ||||
574 | reader => { | ||||
575 | 'associated_attribute' => \&Class::MOP::Method::Accessor::associated_attribute | ||||
576 | }, | ||||
577 | _definition_context(), | ||||
578 | )) | ||||
579 | ); | ||||
580 | |||||
581 | 1 | 6µs | 4 | 261µs | Class::MOP::Method::Accessor->meta->add_attribute( # spent 236µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 13µs making 1 call to Class::MOP::Attribute::new
# spent 8µs making 1 call to Class::MOP::Object::meta
# spent 4µs making 1 call to Class::MOP::_definition_context |
582 | Class::MOP::Attribute->new('accessor_type' => ( | ||||
583 | reader => { 'accessor_type' => \&Class::MOP::Method::Accessor::accessor_type }, | ||||
584 | _definition_context(), | ||||
585 | )) | ||||
586 | ); | ||||
587 | |||||
588 | ## -------------------------------------------------------- | ||||
589 | ## Class::MOP::Method::Constructor | ||||
590 | |||||
591 | Class::MOP::Method::Constructor->meta->add_attribute( | ||||
592 | Class::MOP::Attribute->new('options' => ( | ||||
593 | reader => { | ||||
594 | 'options' => \&Class::MOP::Method::Constructor::options | ||||
595 | }, | ||||
596 | default => sub { +{} }, | ||||
597 | 1 | 10µs | 4 | 492µs | _definition_context(), # spent 270µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 200µs making 1 call to Class::MOP::Object::meta
# spent 18µs making 1 call to Class::MOP::Attribute::new
# spent 4µs making 1 call to Class::MOP::_definition_context |
598 | )) | ||||
599 | ); | ||||
600 | |||||
601 | 1 | 6µs | 4 | 208µs | Class::MOP::Method::Constructor->meta->add_attribute( # spent 182µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 13µs making 1 call to Class::MOP::Attribute::new
# spent 8µs making 1 call to Class::MOP::Object::meta
# spent 4µs making 1 call to Class::MOP::_definition_context |
602 | Class::MOP::Attribute->new('associated_metaclass' => ( | ||||
603 | init_arg => "metaclass", # FIXME alias and rename | ||||
604 | reader => { | ||||
605 | 'associated_metaclass' => \&Class::MOP::Method::Constructor::associated_metaclass | ||||
606 | }, | ||||
607 | _definition_context(), | ||||
608 | )) | ||||
609 | ); | ||||
610 | |||||
611 | ## -------------------------------------------------------- | ||||
612 | ## Class::MOP::Instance | ||||
613 | |||||
614 | # NOTE: | ||||
615 | # these don't yet do much of anything, but are just | ||||
616 | # included for completeness | ||||
617 | |||||
618 | 1 | 8µs | 4 | 427µs | Class::MOP::Instance->meta->add_attribute( # spent 206µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 204µs making 1 call to Class::MOP::Object::meta
# spent 13µs making 1 call to Class::MOP::Attribute::new
# spent 4µs making 1 call to Class::MOP::_definition_context |
619 | Class::MOP::Attribute->new('associated_metaclass', | ||||
620 | reader => { associated_metaclass => \&Class::MOP::Instance::associated_metaclass }, | ||||
621 | _definition_context(), | ||||
622 | ), | ||||
623 | ); | ||||
624 | |||||
625 | 1 | 6µs | 4 | 210µs | Class::MOP::Instance->meta->add_attribute( # spent 185µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 12µs making 1 call to Class::MOP::Attribute::new
# spent 8µs making 1 call to Class::MOP::Object::meta
# spent 4µs making 1 call to Class::MOP::_definition_context |
626 | Class::MOP::Attribute->new('_class_name', | ||||
627 | init_arg => undef, | ||||
628 | reader => { _class_name => \&Class::MOP::Instance::_class_name }, | ||||
629 | #lazy => 1, # not yet supported by Class::MOP but out our version does it anyway | ||||
630 | #default => sub { $_[0]->associated_metaclass->name }, | ||||
631 | _definition_context(), | ||||
632 | ), | ||||
633 | ); | ||||
634 | |||||
635 | 1 | 6µs | 4 | 228µs | Class::MOP::Instance->meta->add_attribute( # spent 203µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 13µs making 1 call to Class::MOP::Attribute::new
# spent 9µs making 1 call to Class::MOP::Object::meta
# spent 4µs making 1 call to Class::MOP::_definition_context |
636 | Class::MOP::Attribute->new('attributes', | ||||
637 | reader => { attributes => \&Class::MOP::Instance::get_all_attributes }, | ||||
638 | _definition_context(), | ||||
639 | ), | ||||
640 | ); | ||||
641 | |||||
642 | 1 | 7µs | 4 | 266µs | Class::MOP::Instance->meta->add_attribute( # spent 238µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 16µs making 1 call to Class::MOP::Attribute::new
# spent 8µs making 1 call to Class::MOP::Object::meta
# spent 4µs making 1 call to Class::MOP::_definition_context |
643 | Class::MOP::Attribute->new('slots', | ||||
644 | reader => { slots => \&Class::MOP::Instance::slots }, | ||||
645 | _definition_context(), | ||||
646 | ), | ||||
647 | ); | ||||
648 | |||||
649 | 1 | 7µs | 4 | 239µs | Class::MOP::Instance->meta->add_attribute( # spent 214µs making 1 call to Class::MOP::Mixin::HasAttributes::add_attribute
# spent 13µs making 1 call to Class::MOP::Attribute::new
# spent 9µs making 1 call to Class::MOP::Object::meta
# spent 4µs making 1 call to Class::MOP::_definition_context |
650 | Class::MOP::Attribute->new('slot_hash', | ||||
651 | reader => { slot_hash => \&Class::MOP::Instance::slot_hash }, | ||||
652 | _definition_context(), | ||||
653 | ), | ||||
654 | ); | ||||
655 | |||||
656 | ## -------------------------------------------------------- | ||||
657 | ## Class::MOP::Object | ||||
658 | |||||
659 | # need to replace the meta method there with a real meta method object | ||||
660 | 1 | 8µs | 2 | 953µs | Class::MOP::Object->meta->_add_meta_method('meta'); # spent 943µs making 1 call to Class::MOP::Mixin::HasMethods::_add_meta_method
# spent 9µs making 1 call to Class::MOP::Object::meta |
661 | |||||
662 | ## -------------------------------------------------------- | ||||
663 | ## Class::MOP::Mixin | ||||
664 | |||||
665 | # need to replace the meta method there with a real meta method object | ||||
666 | 1 | 6µs | 2 | 445µs | Class::MOP::Mixin->meta->_add_meta_method('meta'); # spent 436µs making 1 call to Class::MOP::Mixin::HasMethods::_add_meta_method
# spent 9µs making 1 call to Class::MOP::Mixin::meta |
667 | |||||
668 | 1 | 123µs | require Class::MOP::Deprecated unless our $no_deprecated; | ||
669 | |||||
670 | # we need the meta instance of the meta instance to be created now, in order | ||||
671 | # for the constructor to be able to use it | ||||
672 | 1 | 4µs | 2 | 106µs | Class::MOP::Instance->meta->get_meta_instance; # spent 94µs making 1 call to Class::MOP::Class::get_meta_instance
# spent 12µs making 1 call to Class::MOP::Object::meta |
673 | |||||
674 | # pretend the add_method never happened. it hasn't yet affected anything | ||||
675 | 1 | 2µs | 1 | 8µs | undef Class::MOP::Instance->meta->{_package_cache_flag}; # spent 8µs making 1 call to Class::MOP::Object::meta |
676 | |||||
677 | ## -------------------------------------------------------- | ||||
678 | ## Now close all the Class::MOP::* classes | ||||
679 | |||||
680 | # NOTE: we don't need to inline the accessors this only lengthens the compile | ||||
681 | # time of the MOP, and gives us no actual benefits. | ||||
682 | |||||
683 | $_->meta->make_immutable( | ||||
684 | inline_constructor => 0, | ||||
685 | constructor_name => "_new", | ||||
686 | inline_accessors => 0, | ||||
687 | 1 | 50µs | 28 | 18.0ms | ) for qw/ # spent 17.6ms making 14 calls to Class::MOP::Class::make_immutable, avg 1.26ms/call
# spent 362µs making 14 calls to Class::MOP::Object::meta, avg 26µs/call |
688 | Class::MOP::Package | ||||
689 | Class::MOP::Module | ||||
690 | Class::MOP::Class | ||||
691 | |||||
692 | Class::MOP::Attribute | ||||
693 | Class::MOP::Method | ||||
694 | Class::MOP::Instance | ||||
695 | |||||
696 | Class::MOP::Object | ||||
697 | |||||
698 | Class::MOP::Method::Generated | ||||
699 | Class::MOP::Method::Inlined | ||||
700 | |||||
701 | Class::MOP::Method::Accessor | ||||
702 | Class::MOP::Method::Constructor | ||||
703 | Class::MOP::Method::Wrapped | ||||
704 | |||||
705 | Class::MOP::Method::Meta | ||||
706 | Class::MOP::Method::Overload | ||||
707 | /; | ||||
708 | |||||
709 | $_->meta->make_immutable( | ||||
710 | inline_constructor => 0, | ||||
711 | constructor_name => undef, | ||||
712 | inline_accessors => 0, | ||||
713 | 1 | 17µs | 8 | 332µs | ) for qw/ # spent 299µs making 4 calls to Class::MOP::Class::make_immutable, avg 75µs/call
# spent 32µs making 4 calls to Class::MOP::Mixin::meta, avg 8µs/call |
714 | Class::MOP::Mixin | ||||
715 | Class::MOP::Mixin::AttributeCore | ||||
716 | Class::MOP::Mixin::HasAttributes | ||||
717 | Class::MOP::Mixin::HasMethods | ||||
718 | /; | ||||
719 | |||||
720 | 1 | 119µs | 1; | ||
721 | |||||
722 | # ABSTRACT: A Meta Object Protocol for Perl 5 | ||||
723 | |||||
724 | __END__ | ||||
# spent 9µs within Class::MOP::__ANON__ which was called 23 times, avg 404ns/call:
# 23 times (9µs+0s) by Class::MOP::Class::class_precedence_list at line 1006 of Class/MOP/Class.pm, avg 404ns/call | |||||
# spent 1.06ms within Class::MOP::get_code_info which was called 1243 times, avg 855ns/call:
# 913 times (812µs+0s) by Class::MOP::Mixin::HasMethods::add_method at line 81 of Class/MOP/Mixin/HasMethods.pm, avg 889ns/call
# 305 times (224µs+0s) by Class::MOP::Mixin::HasMethods::_code_is_mine at line 95 of Class/MOP/Mixin/HasMethods.pm, avg 733ns/call
# 21 times (24µs+0s) by Moose::Meta::Role::Application::ToClass::apply_override_method_modifiers at line 216 of Moose/Meta/Role/Application/ToClass.pm, avg 1µs/call
# 4 times (4µs+0s) by Moose::Exporter::_make_sub_exporter_params at line 291 of Moose/Exporter.pm, avg 1µs/call |