| Filename | /Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Class/MOP/Instance.pm |
| Statements | Executed 6759 statements in 12.8ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 128 | 1 | 1 | 3.29ms | 3.52ms | Class::MOP::Instance::inline_get_slot_value |
| 75 | 1 | 1 | 2.16ms | 3.81ms | Class::MOP::Instance::BUILDARGS |
| 753 | 1 | 1 | 1.49ms | 1.49ms | Class::MOP::Instance::set_slot_value |
| 484 | 1 | 1 | 1.44ms | 2.17ms | Class::MOP::Instance::inline_set_slot_value |
| 692 | 4 | 1 | 1.10ms | 1.10ms | Class::MOP::Instance::inline_slot_access |
| 75 | 1 | 1 | 627µs | 4.97ms | Class::MOP::Instance::new |
| 109 | 1 | 1 | 339µs | 485µs | Class::MOP::Instance::create_instance |
| 47 | 1 | 1 | 230µs | 230µs | Class::MOP::Instance::_new |
| 67 | 1 | 1 | 213µs | 331µs | Class::MOP::Instance::inline_is_slot_initialized |
| 194 | 2 | 2 | 129µs | 129µs | Class::MOP::Instance::is_inlinable |
| 75 | 1 | 1 | 50µs | 50µs | Class::MOP::Instance::is_dependent_on_superclasses |
| 13 | 1 | 1 | 44µs | 62µs | Class::MOP::Instance::inline_weaken_slot_value |
| 31 | 1 | 1 | 38µs | 38µs | Class::MOP::Instance::inline_create_instance |
| 12 | 1 | 1 | 17µs | 17µs | Class::MOP::Instance::is_slot_initialized |
| 12 | 1 | 1 | 14µs | 14µs | Class::MOP::Instance::get_slot_value |
| 13 | 1 | 1 | 8µs | 8µs | Class::MOP::Instance::inline_get_is_lvalue |
| 1 | 1 | 1 | 7µs | 7µs | Class::MOP::Instance::BEGIN@3 |
| 1 | 1 | 1 | 6µs | 33µs | Class::MOP::Instance::BEGIN@13 |
| 1 | 1 | 1 | 5µs | 8µs | Class::MOP::Instance::BEGIN@11 |
| 1 | 1 | 1 | 5µs | 54µs | Class::MOP::Instance::BEGIN@15 |
| 1 | 1 | 1 | 5µs | 15µs | Class::MOP::Instance::BEGIN@10 |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::Instance::_clear_mop_slot |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::Instance::_get_mop_slot |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::Instance::_has_mop_slot |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::Instance::_inline_clear_mop_slot |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::Instance::_inline_get_mop_slot |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::Instance::_inline_set_mop_slot |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::Instance::_set_mop_slot |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::Instance::clone_instance |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::Instance::deinitialize_all_slots |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::Instance::deinitialize_slot |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::Instance::get_all_attributes |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::Instance::get_all_slots |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::Instance::initialize_all_slots |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::Instance::initialize_slot |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::Instance::inline_deinitialize_slot |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::Instance::inline_initialize_slot |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::Instance::inline_rebless_instance_structure |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::Instance::inline_strengthen_slot_value |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::Instance::is_valid_slot |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::Instance::rebless_instance_structure |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::Instance::slot_value_is_weak |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::Instance::strengthen_slot_value |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::Instance::weaken_slot_value |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | |||||
| 2 | package Class::MOP::Instance; | ||||
| 3 | # spent 7µs within Class::MOP::Instance::BEGIN@3 which was called:
# once (7µs+0s) by Class::MOP::Class::BEGIN@13 at line 5 | ||||
| 4 | 1 | 4µs | $Class::MOP::Instance::AUTHORITY = 'cpan:STEVAN'; | ||
| 5 | 1 | 25µs | 1 | 7µs | } # spent 7µs making 1 call to Class::MOP::Instance::BEGIN@3 |
| 6 | { | ||||
| 7 | 2 | 800ns | $Class::MOP::Instance::VERSION = '2.1005'; | ||
| 8 | } | ||||
| 9 | |||||
| 10 | 2 | 18µs | 2 | 25µs | # spent 15µs (5+10) within Class::MOP::Instance::BEGIN@10 which was called:
# once (5µs+10µs) by Class::MOP::Class::BEGIN@13 at line 10 # spent 15µs making 1 call to Class::MOP::Instance::BEGIN@10
# spent 10µs making 1 call to strict::import |
| 11 | 2 | 23µs | 2 | 11µs | # spent 8µs (5+3) within Class::MOP::Instance::BEGIN@11 which was called:
# once (5µs+3µs) by Class::MOP::Class::BEGIN@13 at line 11 # spent 8µs making 1 call to Class::MOP::Instance::BEGIN@11
# spent 3µs making 1 call to warnings::import |
| 12 | |||||
| 13 | 2 | 27µs | 2 | 60µs | # spent 33µs (6+27) within Class::MOP::Instance::BEGIN@13 which was called:
# once (6µs+27µs) by Class::MOP::Class::BEGIN@13 at line 13 # spent 33µs making 1 call to Class::MOP::Instance::BEGIN@13
# spent 27µs making 1 call to Exporter::import |
| 14 | |||||
| 15 | 2 | 1.13ms | 2 | 103µs | # spent 54µs (5+49) within Class::MOP::Instance::BEGIN@15 which was called:
# once (5µs+49µs) by Class::MOP::Class::BEGIN@13 at line 15 # spent 54µs making 1 call to Class::MOP::Instance::BEGIN@15
# spent 49µs making 1 call to base::import |
| 16 | |||||
| 17 | # make this not a valid method name, to avoid (most) attribute conflicts | ||||
| 18 | 1 | 200ns | my $RESERVED_MOP_SLOT = '<<MOP>>'; | ||
| 19 | |||||
| 20 | # spent 3.81ms (2.16+1.64) within Class::MOP::Instance::BUILDARGS which was called 75 times, avg 51µs/call:
# 75 times (2.16ms+1.64ms) by Class::MOP::Instance::new at line 41, avg 51µs/call | ||||
| 21 | 75 | 57µs | my ($class, @args) = @_; | ||
| 22 | |||||
| 23 | 75 | 180µs | 75 | 32µs | if ( @args == 1 ) { # spent 32µs making 75 calls to Scalar::Util::blessed, avg 427ns/call |
| 24 | unshift @args, "associated_metaclass"; | ||||
| 25 | } elsif ( @args >= 2 && blessed($args[0]) && $args[0]->isa("Class::MOP::Class") ) { | ||||
| 26 | # compat mode | ||||
| 27 | my ( $meta, @attrs ) = @args; | ||||
| 28 | @args = ( associated_metaclass => $meta, attributes => \@attrs ); | ||||
| 29 | } | ||||
| 30 | |||||
| 31 | 75 | 72µs | my %options = @args; | ||
| 32 | # FIXME lazy_build | ||||
| 33 | 815 | 780µs | 740 | 1.61ms | $options{slots} ||= [ map { $_->slots } @{ $options{attributes} || [] } ]; # spent 1.61ms making 740 calls to Class::MOP::Attribute::slots, avg 2µs/call |
| 34 | 75 | 441µs | $options{slot_hash} = { map { $_ => undef } @{ $options{slots} } }; # FIXME lazy_build | ||
| 35 | |||||
| 36 | 75 | 156µs | return \%options; | ||
| 37 | } | ||||
| 38 | |||||
| 39 | # spent 4.97ms (627µs+4.34) within Class::MOP::Instance::new which was called 75 times, avg 66µs/call:
# 75 times (627µs+4.34ms) by Class::MOP::Class::_create_meta_instance at line 726 of Class/MOP/Class.pm, avg 66µs/call | ||||
| 40 | 75 | 11µs | my $class = shift; | ||
| 41 | 75 | 72µs | 75 | 3.81ms | my $options = $class->BUILDARGS(@_); # spent 3.81ms making 75 calls to Class::MOP::Instance::BUILDARGS, avg 51µs/call |
| 42 | |||||
| 43 | # FIXME replace with a proper constructor | ||||
| 44 | 75 | 156µs | 75 | 479µs | my $instance = $class->_new(%$options); # spent 250µs making 28 calls to Moose::Meta::Instance::_new, avg 9µs/call
# spent 230µs making 47 calls to Class::MOP::Instance::_new, avg 5µs/call |
| 45 | |||||
| 46 | # FIXME weak_ref => 1, | ||||
| 47 | 75 | 164µs | 75 | 51µs | weaken($instance->{'associated_metaclass'}); # spent 51µs making 75 calls to Scalar::Util::weaken, avg 684ns/call |
| 48 | |||||
| 49 | 75 | 140µs | return $instance; | ||
| 50 | } | ||||
| 51 | |||||
| 52 | # spent 230µs within Class::MOP::Instance::_new which was called 47 times, avg 5µs/call:
# 47 times (230µs+0s) by Class::MOP::Instance::new at line 44, avg 5µs/call | ||||
| 53 | 47 | 7µs | my $class = shift; | ||
| 54 | 47 | 10µs | return Class::MOP::Class->initialize($class)->new_object(@_) | ||
| 55 | if $class ne __PACKAGE__; | ||||
| 56 | |||||
| 57 | 47 | 56µs | my $params = @_ == 1 ? $_[0] : {@_}; | ||
| 58 | 47 | 186µs | return bless { | ||
| 59 | # NOTE: | ||||
| 60 | # I am not sure that it makes | ||||
| 61 | # sense to pass in the meta | ||||
| 62 | # The ideal would be to just | ||||
| 63 | # pass in the class name, but | ||||
| 64 | # that is placing too much of | ||||
| 65 | # an assumption on bless(), | ||||
| 66 | # which is *probably* a safe | ||||
| 67 | # assumption,.. but you can | ||||
| 68 | # never tell <:) | ||||
| 69 | 'associated_metaclass' => $params->{associated_metaclass}, | ||||
| 70 | 'attributes' => $params->{attributes}, | ||||
| 71 | 'slots' => $params->{slots}, | ||||
| 72 | 'slot_hash' => $params->{slot_hash}, | ||||
| 73 | } => $class; | ||||
| 74 | } | ||||
| 75 | |||||
| 76 | 109 | 225µs | 14 | 8µs | sub _class_name { $_[0]->{_class_name} ||= $_[0]->associated_metaclass->name } # spent 4µs making 7 calls to Class::MOP::Instance::associated_metaclass, avg 629ns/call
# spent 3µs making 7 calls to Class::MOP::Package::name, avg 457ns/call |
| 77 | |||||
| 78 | # spent 485µs (339+146) within Class::MOP::Instance::create_instance which was called 109 times, avg 4µs/call:
# 109 times (339µs+146µs) by Class::MOP::Class::_construct_instance at line 522 of Class/MOP/Class.pm, avg 4µs/call | ||||
| 79 | 109 | 12µs | my $self = shift; | ||
| 80 | 109 | 283µs | 109 | 146µs | bless {}, $self->_class_name; # spent 146µs making 109 calls to Class::MOP::Instance::_class_name, avg 1µs/call |
| 81 | } | ||||
| 82 | |||||
| 83 | sub clone_instance { | ||||
| 84 | my ($self, $instance) = @_; | ||||
| 85 | |||||
| 86 | my $clone = $self->create_instance; | ||||
| 87 | for my $attr ($self->get_all_attributes) { | ||||
| 88 | next unless $attr->has_value($instance); | ||||
| 89 | for my $slot ($attr->slots) { | ||||
| 90 | my $val = $self->get_slot_value($instance, $slot); | ||||
| 91 | $self->set_slot_value($clone, $slot, $val); | ||||
| 92 | $self->weaken_slot_value($clone, $slot) | ||||
| 93 | if $self->slot_value_is_weak($instance, $slot); | ||||
| 94 | } | ||||
| 95 | } | ||||
| 96 | |||||
| 97 | $self->_set_mop_slot($clone, $self->_get_mop_slot($instance)) | ||||
| 98 | if $self->_has_mop_slot($instance); | ||||
| 99 | |||||
| 100 | return $clone; | ||||
| 101 | } | ||||
| 102 | |||||
| 103 | # operations on meta instance | ||||
| 104 | |||||
| 105 | sub get_all_slots { | ||||
| 106 | my $self = shift; | ||||
| 107 | return @{$self->{'slots'}}; | ||||
| 108 | } | ||||
| 109 | |||||
| 110 | sub get_all_attributes { | ||||
| 111 | my $self = shift; | ||||
| 112 | return @{$self->{attributes}}; | ||||
| 113 | } | ||||
| 114 | |||||
| 115 | sub is_valid_slot { | ||||
| 116 | my ($self, $slot_name) = @_; | ||||
| 117 | exists $self->{'slot_hash'}->{$slot_name}; | ||||
| 118 | } | ||||
| 119 | |||||
| 120 | # operations on created instances | ||||
| 121 | |||||
| 122 | # spent 14µs within Class::MOP::Instance::get_slot_value which was called 12 times, avg 1µs/call:
# 12 times (14µs+0s) by Class::MOP::Attribute::get_raw_value at line 298 of Class/MOP/Attribute.pm, avg 1µs/call | ||||
| 123 | 12 | 3µs | my ($self, $instance, $slot_name) = @_; | ||
| 124 | 12 | 17µs | $instance->{$slot_name}; | ||
| 125 | } | ||||
| 126 | |||||
| 127 | # spent 1.49ms within Class::MOP::Instance::set_slot_value which was called 753 times, avg 2µs/call:
# 753 times (1.49ms+0s) by Class::MOP::Attribute::_set_initial_slot_value at line 150 of Class/MOP/Attribute.pm, avg 2µs/call | ||||
| 128 | 753 | 199µs | my ($self, $instance, $slot_name, $value) = @_; | ||
| 129 | 753 | 1.75ms | $instance->{$slot_name} = $value; | ||
| 130 | } | ||||
| 131 | |||||
| 132 | sub initialize_slot { | ||||
| 133 | my ($self, $instance, $slot_name) = @_; | ||||
| 134 | return; | ||||
| 135 | } | ||||
| 136 | |||||
| 137 | sub deinitialize_slot { | ||||
| 138 | my ( $self, $instance, $slot_name ) = @_; | ||||
| 139 | delete $instance->{$slot_name}; | ||||
| 140 | } | ||||
| 141 | |||||
| 142 | sub initialize_all_slots { | ||||
| 143 | my ($self, $instance) = @_; | ||||
| 144 | foreach my $slot_name ($self->get_all_slots) { | ||||
| 145 | $self->initialize_slot($instance, $slot_name); | ||||
| 146 | } | ||||
| 147 | } | ||||
| 148 | |||||
| 149 | sub deinitialize_all_slots { | ||||
| 150 | my ($self, $instance) = @_; | ||||
| 151 | foreach my $slot_name ($self->get_all_slots) { | ||||
| 152 | $self->deinitialize_slot($instance, $slot_name); | ||||
| 153 | } | ||||
| 154 | } | ||||
| 155 | |||||
| 156 | # spent 17µs within Class::MOP::Instance::is_slot_initialized which was called 12 times, avg 1µs/call:
# 12 times (17µs+0s) by Class::MOP::Attribute::has_value at line 319 of Class/MOP/Attribute.pm, avg 1µs/call | ||||
| 157 | 12 | 4µs | my ($self, $instance, $slot_name, $value) = @_; | ||
| 158 | 12 | 19µs | exists $instance->{$slot_name}; | ||
| 159 | } | ||||
| 160 | |||||
| 161 | sub weaken_slot_value { | ||||
| 162 | my ($self, $instance, $slot_name) = @_; | ||||
| 163 | weaken $instance->{$slot_name}; | ||||
| 164 | } | ||||
| 165 | |||||
| 166 | sub slot_value_is_weak { | ||||
| 167 | my ($self, $instance, $slot_name) = @_; | ||||
| 168 | isweak $instance->{$slot_name}; | ||||
| 169 | } | ||||
| 170 | |||||
| 171 | sub strengthen_slot_value { | ||||
| 172 | my ($self, $instance, $slot_name) = @_; | ||||
| 173 | $self->set_slot_value($instance, $slot_name, $self->get_slot_value($instance, $slot_name)); | ||||
| 174 | } | ||||
| 175 | |||||
| 176 | sub rebless_instance_structure { | ||||
| 177 | my ($self, $instance, $metaclass) = @_; | ||||
| 178 | |||||
| 179 | # we use $_[1] here because of t/cmop/rebless_overload.t regressions | ||||
| 180 | # on 5.8.8 | ||||
| 181 | bless $_[1], $metaclass->name; | ||||
| 182 | } | ||||
| 183 | |||||
| 184 | # spent 50µs within Class::MOP::Instance::is_dependent_on_superclasses which was called 75 times, avg 672ns/call:
# 75 times (50µs+0s) by Class::MOP::Class::_create_meta_instance at line 731 of Class/MOP/Class.pm, avg 672ns/call | ||||
| 185 | 75 | 95µs | return; # for meta instances that require updates on inherited slot changes | ||
| 186 | } | ||||
| 187 | |||||
| 188 | sub _get_mop_slot { | ||||
| 189 | my ($self, $instance) = @_; | ||||
| 190 | $self->get_slot_value($instance, $RESERVED_MOP_SLOT); | ||||
| 191 | } | ||||
| 192 | |||||
| 193 | sub _has_mop_slot { | ||||
| 194 | my ($self, $instance) = @_; | ||||
| 195 | $self->is_slot_initialized($instance, $RESERVED_MOP_SLOT); | ||||
| 196 | } | ||||
| 197 | |||||
| 198 | sub _set_mop_slot { | ||||
| 199 | my ($self, $instance, $value) = @_; | ||||
| 200 | $self->set_slot_value($instance, $RESERVED_MOP_SLOT, $value); | ||||
| 201 | } | ||||
| 202 | |||||
| 203 | sub _clear_mop_slot { | ||||
| 204 | my ($self, $instance) = @_; | ||||
| 205 | $self->deinitialize_slot($instance, $RESERVED_MOP_SLOT); | ||||
| 206 | } | ||||
| 207 | |||||
| 208 | # inlinable operation snippets | ||||
| 209 | |||||
| 210 | 194 | 258µs | # spent 129µs within Class::MOP::Instance::is_inlinable which was called 194 times, avg 666ns/call:
# 99 times (69µs+0s) by Moose::Meta::Method::Accessor::_instance_is_inlinable at line 57 of Moose/Meta/Method/Accessor.pm, avg 696ns/call
# 95 times (60µs+0s) by Class::MOP::Attribute::_process_accessors at line 384 of Class/MOP/Attribute.pm, avg 635ns/call | ||
| 211 | |||||
| 212 | # spent 38µs within Class::MOP::Instance::inline_create_instance which was called 31 times, avg 1µs/call:
# 31 times (38µs+0s) by Class::MOP::Class::_inline_create_instance at line 583 of Class/MOP/Class.pm, avg 1µs/call | ||||
| 213 | 31 | 6µs | my ($self, $class_variable) = @_; | ||
| 214 | 31 | 50µs | 'bless {} => ' . $class_variable; | ||
| 215 | } | ||||
| 216 | |||||
| 217 | # spent 1.10ms within Class::MOP::Instance::inline_slot_access which was called 692 times, avg 2µs/call:
# 484 times (734µs+0s) by Class::MOP::Instance::inline_set_slot_value at line 231, avg 2µs/call
# 128 times (232µs+0s) by Class::MOP::Instance::inline_get_slot_value at line 226, avg 2µs/call
# 67 times (118µs+0s) by Class::MOP::Instance::inline_is_slot_initialized at line 245, avg 2µs/call
# 13 times (17µs+0s) by Class::MOP::Instance::inline_weaken_slot_value at line 250, avg 1µs/call | ||||
| 218 | 692 | 91µs | my ($self, $instance, $slot_name) = @_; | ||
| 219 | 692 | 4.54ms | sprintf q[%s->{"%s"}], $instance, quotemeta($slot_name); | ||
| 220 | } | ||||
| 221 | |||||
| 222 | 13 | 16µs | # spent 8µs within Class::MOP::Instance::inline_get_is_lvalue which was called 13 times, avg 631ns/call:
# 13 times (8µs+0s) by Moose::Meta::Method::Accessor::Native::Writer::_get_is_lvalue at line 160 of Moose/Meta/Method/Accessor/Native/Writer.pm, avg 631ns/call | ||
| 223 | |||||
| 224 | # spent 3.52ms (3.29+232µs) within Class::MOP::Instance::inline_get_slot_value which was called 128 times, avg 28µs/call:
# 128 times (3.29ms+232µs) by Class::MOP::Attribute::_inline_instance_get at line 311 of Class/MOP/Attribute.pm, avg 28µs/call | ||||
| 225 | 128 | 34µs | my ($self, $instance, $slot_name) = @_; | ||
| 226 | 128 | 223µs | 128 | 232µs | $self->inline_slot_access($instance, $slot_name); # spent 232µs making 128 calls to Class::MOP::Instance::inline_slot_access, avg 2µs/call |
| 227 | } | ||||
| 228 | |||||
| 229 | # spent 2.17ms (1.44+734µs) within Class::MOP::Instance::inline_set_slot_value which was called 484 times, avg 4µs/call:
# 484 times (1.44ms+734µs) by Class::MOP::Attribute::_inline_instance_set at line 288 of Class/MOP/Attribute.pm, avg 4µs/call | ||||
| 230 | 484 | 123µs | my ($self, $instance, $slot_name, $value) = @_; | ||
| 231 | 484 | 960µs | 484 | 734µs | $self->inline_slot_access($instance, $slot_name) . " = $value", # spent 734µs making 484 calls to Class::MOP::Instance::inline_slot_access, avg 2µs/call |
| 232 | } | ||||
| 233 | |||||
| 234 | sub inline_initialize_slot { | ||||
| 235 | my ($self, $instance, $slot_name) = @_; | ||||
| 236 | return ''; | ||||
| 237 | } | ||||
| 238 | |||||
| 239 | sub inline_deinitialize_slot { | ||||
| 240 | my ($self, $instance, $slot_name) = @_; | ||||
| 241 | "delete " . $self->inline_slot_access($instance, $slot_name); | ||||
| 242 | } | ||||
| 243 | # spent 331µs (213+118) within Class::MOP::Instance::inline_is_slot_initialized which was called 67 times, avg 5µs/call:
# 67 times (213µs+118µs) by Class::MOP::Attribute::_inline_instance_has at line 332 of Class/MOP/Attribute.pm, avg 5µs/call | ||||
| 244 | 67 | 17µs | my ($self, $instance, $slot_name) = @_; | ||
| 245 | 67 | 138µs | 67 | 118µs | "exists " . $self->inline_slot_access($instance, $slot_name); # spent 118µs making 67 calls to Class::MOP::Instance::inline_slot_access, avg 2µs/call |
| 246 | } | ||||
| 247 | |||||
| 248 | # spent 62µs (44+17) within Class::MOP::Instance::inline_weaken_slot_value which was called 13 times, avg 5µs/call:
# 13 times (44µs+17µs) by Moose::Meta::Attribute::_inline_weaken_value at line 762 of Moose/Meta/Attribute.pm, avg 5µs/call | ||||
| 249 | 13 | 3µs | my ($self, $instance, $slot_name) = @_; | ||
| 250 | 13 | 33µs | 13 | 17µs | sprintf "Scalar::Util::weaken( %s )", $self->inline_slot_access($instance, $slot_name); # spent 17µs making 13 calls to Class::MOP::Instance::inline_slot_access, avg 1µs/call |
| 251 | } | ||||
| 252 | |||||
| 253 | sub inline_strengthen_slot_value { | ||||
| 254 | my ($self, $instance, $slot_name) = @_; | ||||
| 255 | $self->inline_set_slot_value($instance, $slot_name, $self->inline_slot_access($instance, $slot_name)); | ||||
| 256 | } | ||||
| 257 | |||||
| 258 | sub inline_rebless_instance_structure { | ||||
| 259 | my ($self, $instance, $class_variable) = @_; | ||||
| 260 | "bless $instance => $class_variable"; | ||||
| 261 | } | ||||
| 262 | |||||
| 263 | sub _inline_get_mop_slot { | ||||
| 264 | my ($self, $instance) = @_; | ||||
| 265 | $self->inline_get_slot_value($instance, $RESERVED_MOP_SLOT); | ||||
| 266 | } | ||||
| 267 | |||||
| 268 | sub _inline_set_mop_slot { | ||||
| 269 | my ($self, $instance, $value) = @_; | ||||
| 270 | $self->inline_set_slot_value($instance, $RESERVED_MOP_SLOT, $value); | ||||
| 271 | } | ||||
| 272 | |||||
| 273 | sub _inline_clear_mop_slot { | ||||
| 274 | my ($self, $instance) = @_; | ||||
| 275 | $self->inline_deinitialize_slot($instance, $RESERVED_MOP_SLOT); | ||||
| 276 | } | ||||
| 277 | |||||
| 278 | 1 | 3µs | 1; | ||
| 279 | |||||
| 280 | # ABSTRACT: Instance Meta Object | ||||
| 281 | |||||
| 282 | __END__ |