| Filename | /usr/local/lib/perl/5.18.2/Class/MOP/Instance.pm |
| Statements | Executed 13794 statements in 32.8ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 680 | 1 | 1 | 5.36ms | 6.50ms | Class::MOP::Instance::inline_set_slot_value |
| 236 | 1 | 1 | 4.84ms | 5.51ms | Class::MOP::Instance::inline_get_slot_value |
| 2478 | 1 | 1 | 4.18ms | 4.18ms | Class::MOP::Instance::set_slot_value |
| 160 | 1 | 1 | 3.92ms | 11.3ms | Class::MOP::Instance::BUILDARGS |
| 1012 | 4 | 1 | 1.99ms | 1.99ms | Class::MOP::Instance::inline_slot_access |
| 160 | 1 | 1 | 1.59ms | 14.7ms | Class::MOP::Instance::new |
| 317 | 1 | 1 | 1.22ms | 1.74ms | Class::MOP::Instance::create_instance |
| 87 | 1 | 1 | 338µs | 518µs | Class::MOP::Instance::inline_is_slot_initialized |
| 346 | 2 | 2 | 268µs | 268µs | Class::MOP::Instance::is_inlinable |
| 48 | 1 | 1 | 268µs | 268µs | Class::MOP::Instance::_new |
| 160 | 1 | 1 | 154µs | 154µs | Class::MOP::Instance::is_dependent_on_superclasses |
| 58 | 1 | 1 | 118µs | 118µs | Class::MOP::Instance::inline_create_instance |
| 40 | 1 | 1 | 52µs | 52µs | Class::MOP::Instance::is_slot_initialized |
| 9 | 1 | 1 | 45µs | 57µs | Class::MOP::Instance::inline_weaken_slot_value |
| 23 | 1 | 1 | 28µs | 28µs | Class::MOP::Instance::get_slot_value |
| 1 | 1 | 1 | 9µs | 19µs | Class::MOP::Instance::BEGIN@4 |
| 1 | 1 | 1 | 8µs | 52µs | Class::MOP::Instance::BEGIN@7 |
| 1 | 1 | 1 | 8µs | 12µs | Class::MOP::Instance::BEGIN@5 |
| 7 | 1 | 1 | 7µs | 7µs | Class::MOP::Instance::inline_get_is_lvalue |
| 1 | 1 | 1 | 6µs | 24µs | Class::MOP::Instance::BEGIN@9 |
| 1 | 1 | 1 | 5µs | 6µs | Class::MOP::Instance::weaken_slot_value |
| 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 |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package Class::MOP::Instance; | ||||
| 2 | 1 | 400ns | our $VERSION = '2.1604'; | ||
| 3 | |||||
| 4 | 2 | 19µs | 2 | 28µs | # spent 19µs (9+9) within Class::MOP::Instance::BEGIN@4 which was called:
# once (9µs+9µs) by Class::MOP::Class::BEGIN@7 at line 4 # spent 19µs making 1 call to Class::MOP::Instance::BEGIN@4
# spent 10µs making 1 call to strict::import |
| 5 | 2 | 45µs | 2 | 17µs | # spent 12µs (8+4) within Class::MOP::Instance::BEGIN@5 which was called:
# once (8µs+4µs) by Class::MOP::Class::BEGIN@7 at line 5 # spent 12µs making 1 call to Class::MOP::Instance::BEGIN@5
# spent 4µs making 1 call to warnings::import |
| 6 | |||||
| 7 | 2 | 23µs | 2 | 96µs | # spent 52µs (8+44) within Class::MOP::Instance::BEGIN@7 which was called:
# once (8µs+44µs) by Class::MOP::Class::BEGIN@7 at line 7 # spent 52µs making 1 call to Class::MOP::Instance::BEGIN@7
# spent 44µs making 1 call to Exporter::import |
| 8 | |||||
| 9 | 2 | 1.01ms | 2 | 41µs | # spent 24µs (6+17) within Class::MOP::Instance::BEGIN@9 which was called:
# once (6µs+17µs) by Class::MOP::Class::BEGIN@7 at line 9 # spent 24µs making 1 call to Class::MOP::Instance::BEGIN@9
# spent 17µs making 1 call to parent::import |
| 10 | |||||
| 11 | # make this not a valid method name, to avoid (most) attribute conflicts | ||||
| 12 | 1 | 300ns | my $RESERVED_MOP_SLOT = '<<MOP>>'; | ||
| 13 | |||||
| 14 | # spent 11.3ms (3.92+7.41) within Class::MOP::Instance::BUILDARGS which was called 160 times, avg 71µs/call:
# 160 times (3.92ms+7.41ms) by Class::MOP::Instance::new at line 35, avg 71µs/call | ||||
| 15 | 160 | 141µs | my ($class, @args) = @_; | ||
| 16 | |||||
| 17 | 160 | 546µs | 160 | 78µs | if ( @args == 1 ) { # spent 78µs making 160 calls to Scalar::Util::blessed, avg 485ns/call |
| 18 | unshift @args, "associated_metaclass"; | ||||
| 19 | } elsif ( @args >= 2 && blessed($args[0]) && $args[0]->isa("Class::MOP::Class") ) { | ||||
| 20 | # compat mode | ||||
| 21 | my ( $meta, @attrs ) = @args; | ||||
| 22 | @args = ( associated_metaclass => $meta, attributes => \@attrs ); | ||||
| 23 | } | ||||
| 24 | |||||
| 25 | 160 | 190µs | my %options = @args; | ||
| 26 | # FIXME lazy_build | ||||
| 27 | 1279 | 1.44ms | 1119 | 7.33ms | $options{slots} ||= [ map { $_->slots } @{ $options{attributes} || [] } ]; # spent 7.33ms making 1119 calls to Class::MOP::Attribute::slots, avg 7µs/call |
| 28 | 160 | 725µs | $options{slot_hash} = { map { $_ => undef } @{ $options{slots} } }; # FIXME lazy_build | ||
| 29 | |||||
| 30 | 160 | 382µs | return \%options; | ||
| 31 | } | ||||
| 32 | |||||
| 33 | # spent 14.7ms (1.59+13.1) within Class::MOP::Instance::new which was called 160 times, avg 92µs/call:
# 160 times (1.59ms+13.1ms) by Class::MOP::Class::_create_meta_instance at line 727 of Class/MOP/Class.pm, avg 92µs/call | ||||
| 34 | 160 | 57µs | my $class = shift; | ||
| 35 | 160 | 290µs | 160 | 11.3ms | my $options = $class->BUILDARGS(@_); # spent 11.3ms making 160 calls to Class::MOP::Instance::BUILDARGS, avg 71µs/call |
| 36 | |||||
| 37 | # FIXME replace with a proper constructor | ||||
| 38 | 160 | 444µs | 160 | 1.60ms | my $instance = $class->_new(%$options); # spent 1.33ms making 112 calls to Moose::Meta::Instance::_new, avg 12µs/call
# spent 268µs making 48 calls to Class::MOP::Instance::_new, avg 6µs/call |
| 39 | |||||
| 40 | # FIXME weak_ref => 1, | ||||
| 41 | 160 | 421µs | 160 | 133µs | weaken($instance->{'associated_metaclass'}); # spent 133µs making 160 calls to Scalar::Util::weaken, avg 829ns/call |
| 42 | |||||
| 43 | 160 | 368µs | return $instance; | ||
| 44 | } | ||||
| 45 | |||||
| 46 | # spent 268µs within Class::MOP::Instance::_new which was called 48 times, avg 6µs/call:
# 48 times (268µs+0s) by Class::MOP::Instance::new at line 38, avg 6µs/call | ||||
| 47 | 48 | 18µs | my $class = shift; | ||
| 48 | 48 | 14µs | return Class::MOP::Class->initialize($class)->new_object(@_) | ||
| 49 | if $class ne __PACKAGE__; | ||||
| 50 | |||||
| 51 | 48 | 65µs | my $params = @_ == 1 ? $_[0] : {@_}; | ||
| 52 | 48 | 210µs | return bless { | ||
| 53 | # NOTE: | ||||
| 54 | # I am not sure that it makes | ||||
| 55 | # sense to pass in the meta | ||||
| 56 | # The ideal would be to just | ||||
| 57 | # pass in the class name, but | ||||
| 58 | # that is placing too much of | ||||
| 59 | # an assumption on bless(), | ||||
| 60 | # which is *probably* a safe | ||||
| 61 | # assumption,.. but you can | ||||
| 62 | # never tell <:) | ||||
| 63 | 'associated_metaclass' => $params->{associated_metaclass}, | ||||
| 64 | 'attributes' => $params->{attributes}, | ||||
| 65 | 'slots' => $params->{slots}, | ||||
| 66 | 'slot_hash' => $params->{slot_hash}, | ||||
| 67 | } => $class; | ||||
| 68 | } | ||||
| 69 | |||||
| 70 | 317 | 773µs | 18 | 10µs | sub _class_name { $_[0]->{_class_name} ||= $_[0]->associated_metaclass->name } # spent 6µs making 9 calls to Class::MOP::Instance::associated_metaclass, avg 700ns/call
# spent 3µs making 9 calls to Class::MOP::Package::name, avg 367ns/call |
| 71 | |||||
| 72 | # spent 1.74ms (1.22+522µs) within Class::MOP::Instance::create_instance which was called 317 times, avg 5µs/call:
# 317 times (1.22ms+522µs) by Class::MOP::Class::_construct_instance at line 523 of Class/MOP/Class.pm, avg 5µs/call | ||||
| 73 | 317 | 75µs | my $self = shift; | ||
| 74 | 317 | 1.14ms | 317 | 522µs | bless {}, $self->_class_name; # spent 522µs making 317 calls to Class::MOP::Instance::_class_name, avg 2µs/call |
| 75 | } | ||||
| 76 | |||||
| 77 | sub clone_instance { | ||||
| 78 | my ($self, $instance) = @_; | ||||
| 79 | |||||
| 80 | my $clone = $self->create_instance; | ||||
| 81 | for my $attr ($self->get_all_attributes) { | ||||
| 82 | next unless $attr->has_value($instance); | ||||
| 83 | for my $slot ($attr->slots) { | ||||
| 84 | my $val = $self->get_slot_value($instance, $slot); | ||||
| 85 | $self->set_slot_value($clone, $slot, $val); | ||||
| 86 | $self->weaken_slot_value($clone, $slot) | ||||
| 87 | if $self->slot_value_is_weak($instance, $slot); | ||||
| 88 | } | ||||
| 89 | } | ||||
| 90 | |||||
| 91 | $self->_set_mop_slot($clone, $self->_get_mop_slot($instance)) | ||||
| 92 | if $self->_has_mop_slot($instance); | ||||
| 93 | |||||
| 94 | return $clone; | ||||
| 95 | } | ||||
| 96 | |||||
| 97 | # operations on meta instance | ||||
| 98 | |||||
| 99 | sub get_all_slots { | ||||
| 100 | my $self = shift; | ||||
| 101 | return @{$self->{'slots'}}; | ||||
| 102 | } | ||||
| 103 | |||||
| 104 | sub get_all_attributes { | ||||
| 105 | my $self = shift; | ||||
| 106 | return @{$self->{attributes}}; | ||||
| 107 | } | ||||
| 108 | |||||
| 109 | sub is_valid_slot { | ||||
| 110 | my ($self, $slot_name) = @_; | ||||
| 111 | exists $self->{'slot_hash'}->{$slot_name}; | ||||
| 112 | } | ||||
| 113 | |||||
| 114 | # operations on created instances | ||||
| 115 | |||||
| 116 | # spent 28µs within Class::MOP::Instance::get_slot_value which was called 23 times, avg 1µs/call:
# 23 times (28µs+0s) by Class::MOP::Attribute::get_raw_value at line 312 of Class/MOP/Attribute.pm, avg 1µs/call | ||||
| 117 | 23 | 8µs | my ($self, $instance, $slot_name) = @_; | ||
| 118 | 23 | 37µs | $instance->{$slot_name}; | ||
| 119 | } | ||||
| 120 | |||||
| 121 | # spent 4.18ms within Class::MOP::Instance::set_slot_value which was called 2478 times, avg 2µs/call:
# 2478 times (4.18ms+0s) by Class::MOP::Attribute::_set_initial_slot_value at line 162 of Class/MOP/Attribute.pm, avg 2µs/call | ||||
| 122 | 2478 | 762µs | my ($self, $instance, $slot_name, $value) = @_; | ||
| 123 | 2478 | 9.18ms | $instance->{$slot_name} = $value; | ||
| 124 | } | ||||
| 125 | |||||
| 126 | sub initialize_slot { | ||||
| 127 | my ($self, $instance, $slot_name) = @_; | ||||
| 128 | return; | ||||
| 129 | } | ||||
| 130 | |||||
| 131 | sub deinitialize_slot { | ||||
| 132 | my ( $self, $instance, $slot_name ) = @_; | ||||
| 133 | delete $instance->{$slot_name}; | ||||
| 134 | } | ||||
| 135 | |||||
| 136 | sub initialize_all_slots { | ||||
| 137 | my ($self, $instance) = @_; | ||||
| 138 | foreach my $slot_name ($self->get_all_slots) { | ||||
| 139 | $self->initialize_slot($instance, $slot_name); | ||||
| 140 | } | ||||
| 141 | } | ||||
| 142 | |||||
| 143 | sub deinitialize_all_slots { | ||||
| 144 | my ($self, $instance) = @_; | ||||
| 145 | foreach my $slot_name ($self->get_all_slots) { | ||||
| 146 | $self->deinitialize_slot($instance, $slot_name); | ||||
| 147 | } | ||||
| 148 | } | ||||
| 149 | |||||
| 150 | # spent 52µs within Class::MOP::Instance::is_slot_initialized which was called 40 times, avg 1µs/call:
# 40 times (52µs+0s) by Class::MOP::Attribute::has_value at line 333 of Class/MOP/Attribute.pm, avg 1µs/call | ||||
| 151 | 40 | 17µs | my ($self, $instance, $slot_name, $value) = @_; | ||
| 152 | 40 | 66µs | exists $instance->{$slot_name}; | ||
| 153 | } | ||||
| 154 | |||||
| 155 | # spent 6µs (5+2) within Class::MOP::Instance::weaken_slot_value which was called:
# once (5µs+2µs) by Moose::Meta::Attribute::_weaken_value at line 799 of Moose/Meta/Attribute.pm | ||||
| 156 | 1 | 900ns | my ($self, $instance, $slot_name) = @_; | ||
| 157 | 1 | 7µs | 1 | 2µs | weaken $instance->{$slot_name}; # spent 2µs making 1 call to Scalar::Util::weaken |
| 158 | } | ||||
| 159 | |||||
| 160 | sub slot_value_is_weak { | ||||
| 161 | my ($self, $instance, $slot_name) = @_; | ||||
| 162 | isweak $instance->{$slot_name}; | ||||
| 163 | } | ||||
| 164 | |||||
| 165 | sub strengthen_slot_value { | ||||
| 166 | my ($self, $instance, $slot_name) = @_; | ||||
| 167 | $self->set_slot_value($instance, $slot_name, $self->get_slot_value($instance, $slot_name)); | ||||
| 168 | } | ||||
| 169 | |||||
| 170 | sub rebless_instance_structure { | ||||
| 171 | my ($self, $instance, $metaclass) = @_; | ||||
| 172 | |||||
| 173 | # we use $_[1] here because of t/cmop/rebless_overload.t regressions | ||||
| 174 | # on 5.8.8 | ||||
| 175 | bless $_[1], $metaclass->name; | ||||
| 176 | } | ||||
| 177 | |||||
| 178 | # spent 154µs within Class::MOP::Instance::is_dependent_on_superclasses which was called 160 times, avg 966ns/call:
# 160 times (154µs+0s) by Class::MOP::Class::_create_meta_instance at line 732 of Class/MOP/Class.pm, avg 966ns/call | ||||
| 179 | 160 | 262µs | return; # for meta instances that require updates on inherited slot changes | ||
| 180 | } | ||||
| 181 | |||||
| 182 | sub _get_mop_slot { | ||||
| 183 | my ($self, $instance) = @_; | ||||
| 184 | $self->get_slot_value($instance, $RESERVED_MOP_SLOT); | ||||
| 185 | } | ||||
| 186 | |||||
| 187 | sub _has_mop_slot { | ||||
| 188 | my ($self, $instance) = @_; | ||||
| 189 | $self->is_slot_initialized($instance, $RESERVED_MOP_SLOT); | ||||
| 190 | } | ||||
| 191 | |||||
| 192 | sub _set_mop_slot { | ||||
| 193 | my ($self, $instance, $value) = @_; | ||||
| 194 | $self->set_slot_value($instance, $RESERVED_MOP_SLOT, $value); | ||||
| 195 | } | ||||
| 196 | |||||
| 197 | sub _clear_mop_slot { | ||||
| 198 | my ($self, $instance) = @_; | ||||
| 199 | $self->deinitialize_slot($instance, $RESERVED_MOP_SLOT); | ||||
| 200 | } | ||||
| 201 | |||||
| 202 | # inlinable operation snippets | ||||
| 203 | |||||
| 204 | 346 | 545µs | # spent 268µs within Class::MOP::Instance::is_inlinable which was called 346 times, avg 775ns/call:
# 252 times (220µs+0s) by Moose::Meta::Method::Accessor::_instance_is_inlinable at line 51 of Moose/Meta/Method/Accessor.pm, avg 872ns/call
# 94 times (48µs+0s) by Class::MOP::Attribute::_process_accessors at line 402 of Class/MOP/Attribute.pm, avg 516ns/call | ||
| 205 | |||||
| 206 | # spent 118µs within Class::MOP::Instance::inline_create_instance which was called 58 times, avg 2µs/call:
# 58 times (118µs+0s) by Class::MOP::Class::_inline_create_instance at line 584 of Class/MOP/Class.pm, avg 2µs/call | ||||
| 207 | 58 | 24µs | my ($self, $class_variable) = @_; | ||
| 208 | 58 | 120µs | 'bless {} => ' . $class_variable; | ||
| 209 | } | ||||
| 210 | |||||
| 211 | # spent 1.99ms within Class::MOP::Instance::inline_slot_access which was called 1012 times, avg 2µs/call:
# 680 times (1.13ms+0s) by Class::MOP::Instance::inline_set_slot_value at line 225, avg 2µs/call
# 236 times (672µs+0s) by Class::MOP::Instance::inline_get_slot_value at line 220, avg 3µs/call
# 87 times (180µs+0s) by Class::MOP::Instance::inline_is_slot_initialized at line 239, avg 2µs/call
# 9 times (12µs+0s) by Class::MOP::Instance::inline_weaken_slot_value at line 244, avg 1µs/call | ||||
| 212 | 1012 | 266µs | my ($self, $instance, $slot_name) = @_; | ||
| 213 | 1012 | 10.2ms | sprintf q[%s->{"%s"}], $instance, quotemeta($slot_name); | ||
| 214 | } | ||||
| 215 | |||||
| 216 | 7 | 16µs | # spent 7µs within Class::MOP::Instance::inline_get_is_lvalue which was called 7 times, avg 1µs/call:
# 7 times (7µs+0s) by Moose::Meta::Method::Accessor::Native::Writer::_get_is_lvalue at line 156 of Moose/Meta/Method/Accessor/Native/Writer.pm, avg 1µs/call | ||
| 217 | |||||
| 218 | # spent 5.51ms (4.84+672µs) within Class::MOP::Instance::inline_get_slot_value which was called 236 times, avg 23µs/call:
# 236 times (4.84ms+672µs) by Class::MOP::Attribute::_inline_instance_get at line 325 of Class/MOP/Attribute.pm, avg 23µs/call | ||||
| 219 | 236 | 112µs | my ($self, $instance, $slot_name) = @_; | ||
| 220 | 236 | 610µs | 236 | 672µs | $self->inline_slot_access($instance, $slot_name); # spent 672µs making 236 calls to Class::MOP::Instance::inline_slot_access, avg 3µs/call |
| 221 | } | ||||
| 222 | |||||
| 223 | # spent 6.50ms (5.36+1.13) within Class::MOP::Instance::inline_set_slot_value which was called 680 times, avg 10µs/call:
# 680 times (5.36ms+1.13ms) by Class::MOP::Attribute::_inline_instance_set at line 302 of Class/MOP/Attribute.pm, avg 10µs/call | ||||
| 224 | 680 | 249µs | my ($self, $instance, $slot_name, $value) = @_; | ||
| 225 | 680 | 1.56ms | 680 | 1.13ms | $self->inline_slot_access($instance, $slot_name) . " = $value", # spent 1.13ms making 680 calls to Class::MOP::Instance::inline_slot_access, avg 2µs/call |
| 226 | } | ||||
| 227 | |||||
| 228 | sub inline_initialize_slot { | ||||
| 229 | my ($self, $instance, $slot_name) = @_; | ||||
| 230 | return ''; | ||||
| 231 | } | ||||
| 232 | |||||
| 233 | sub inline_deinitialize_slot { | ||||
| 234 | my ($self, $instance, $slot_name) = @_; | ||||
| 235 | "delete " . $self->inline_slot_access($instance, $slot_name); | ||||
| 236 | } | ||||
| 237 | # spent 518µs (338+180) within Class::MOP::Instance::inline_is_slot_initialized which was called 87 times, avg 6µs/call:
# 87 times (338µs+180µs) by Class::MOP::Attribute::_inline_instance_has at line 346 of Class/MOP/Attribute.pm, avg 6µs/call | ||||
| 238 | 87 | 45µs | my ($self, $instance, $slot_name) = @_; | ||
| 239 | 87 | 252µs | 87 | 180µs | "exists " . $self->inline_slot_access($instance, $slot_name); # spent 180µs making 87 calls to Class::MOP::Instance::inline_slot_access, avg 2µs/call |
| 240 | } | ||||
| 241 | |||||
| 242 | # spent 57µs (45+12) within Class::MOP::Instance::inline_weaken_slot_value which was called 9 times, avg 6µs/call:
# 9 times (45µs+12µs) by Moose::Meta::Attribute::_inline_weaken_value at line 739 of Moose/Meta/Attribute.pm, avg 6µs/call | ||||
| 243 | 9 | 6µs | my ($self, $instance, $slot_name) = @_; | ||
| 244 | 9 | 31µs | 9 | 12µs | sprintf "Scalar::Util::weaken( %s )", $self->inline_slot_access($instance, $slot_name); # spent 12µs making 9 calls to Class::MOP::Instance::inline_slot_access, avg 1µs/call |
| 245 | } | ||||
| 246 | |||||
| 247 | sub inline_strengthen_slot_value { | ||||
| 248 | my ($self, $instance, $slot_name) = @_; | ||||
| 249 | $self->inline_set_slot_value($instance, $slot_name, $self->inline_slot_access($instance, $slot_name)); | ||||
| 250 | } | ||||
| 251 | |||||
| 252 | sub inline_rebless_instance_structure { | ||||
| 253 | my ($self, $instance, $class_variable) = @_; | ||||
| 254 | "bless $instance => $class_variable"; | ||||
| 255 | } | ||||
| 256 | |||||
| 257 | sub _inline_get_mop_slot { | ||||
| 258 | my ($self, $instance) = @_; | ||||
| 259 | $self->inline_get_slot_value($instance, $RESERVED_MOP_SLOT); | ||||
| 260 | } | ||||
| 261 | |||||
| 262 | sub _inline_set_mop_slot { | ||||
| 263 | my ($self, $instance, $value) = @_; | ||||
| 264 | $self->inline_set_slot_value($instance, $RESERVED_MOP_SLOT, $value); | ||||
| 265 | } | ||||
| 266 | |||||
| 267 | sub _inline_clear_mop_slot { | ||||
| 268 | my ($self, $instance) = @_; | ||||
| 269 | $self->inline_deinitialize_slot($instance, $RESERVED_MOP_SLOT); | ||||
| 270 | } | ||||
| 271 | |||||
| 272 | 1 | 2µs | 1; | ||
| 273 | |||||
| 274 | # ABSTRACT: Instance Meta Object | ||||
| 275 | |||||
| 276 | __END__ |