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

Filename/2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/x86_64-linux/Class/MOP/Instance.pm
StatementsExecuted 4480 statements in 12.7ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
58113.27ms3.45msClass::MOP::Instance::::create_instanceClass::MOP::Instance::create_instance
56111.82ms3.17msClass::MOP::Instance::::BUILDARGSClass::MOP::Instance::BUILDARGS
403111.61ms2.47msClass::MOP::Instance::::inline_set_slot_valueClass::MOP::Instance::inline_set_slot_value
506411.15ms1.15msClass::MOP::Instance::::inline_slot_accessClass::MOP::Instance::inline_slot_access
37611998µs998µsClass::MOP::Instance::::set_slot_valueClass::MOP::Instance::set_slot_value
5611667µs4.44msClass::MOP::Instance::::newClass::MOP::Instance::new
4711376µs376µsClass::MOP::Instance::::_newClass::MOP::Instance::_new
8411340µs572µsClass::MOP::Instance::::inline_get_slot_valueClass::MOP::Instance::inline_get_slot_value
10322106µs106µsClass::MOP::Instance::::is_inlinableClass::MOP::Instance::is_inlinable
171180µs125µsClass::MOP::Instance::::inline_is_slot_initializedClass::MOP::Instance::inline_is_slot_initialized
561172µs72µsClass::MOP::Instance::::is_dependent_on_superclassesClass::MOP::Instance::is_dependent_on_superclasses
301171µs71µsClass::MOP::Instance::::inline_create_instanceClass::MOP::Instance::inline_create_instance
121125µs25µsClass::MOP::Instance::::is_slot_initializedClass::MOP::Instance::is_slot_initialized
121123µs23µsClass::MOP::Instance::::get_slot_valueClass::MOP::Instance::get_slot_value
21112µs16µsClass::MOP::Instance::::inline_weaken_slot_valueClass::MOP::Instance::inline_weaken_slot_value
1118µs8µsClass::MOP::Instance::::BEGIN@3Class::MOP::Instance::BEGIN@3
1118µs51µsClass::MOP::Instance::::BEGIN@13Class::MOP::Instance::BEGIN@13
1116µs69µsClass::MOP::Instance::::BEGIN@15Class::MOP::Instance::BEGIN@15
1116µs8µsClass::MOP::Instance::::BEGIN@10Class::MOP::Instance::BEGIN@10
1116µs14µsClass::MOP::Instance::::BEGIN@11Class::MOP::Instance::BEGIN@11
0000s0sClass::MOP::Instance::::_clear_mop_slotClass::MOP::Instance::_clear_mop_slot
0000s0sClass::MOP::Instance::::_get_mop_slotClass::MOP::Instance::_get_mop_slot
0000s0sClass::MOP::Instance::::_has_mop_slotClass::MOP::Instance::_has_mop_slot
0000s0sClass::MOP::Instance::::_inline_clear_mop_slotClass::MOP::Instance::_inline_clear_mop_slot
0000s0sClass::MOP::Instance::::_inline_get_mop_slotClass::MOP::Instance::_inline_get_mop_slot
0000s0sClass::MOP::Instance::::_inline_set_mop_slotClass::MOP::Instance::_inline_set_mop_slot
0000s0sClass::MOP::Instance::::_set_mop_slotClass::MOP::Instance::_set_mop_slot
0000s0sClass::MOP::Instance::::clone_instanceClass::MOP::Instance::clone_instance
0000s0sClass::MOP::Instance::::deinitialize_all_slotsClass::MOP::Instance::deinitialize_all_slots
0000s0sClass::MOP::Instance::::deinitialize_slotClass::MOP::Instance::deinitialize_slot
0000s0sClass::MOP::Instance::::get_all_attributesClass::MOP::Instance::get_all_attributes
0000s0sClass::MOP::Instance::::get_all_slotsClass::MOP::Instance::get_all_slots
0000s0sClass::MOP::Instance::::initialize_all_slotsClass::MOP::Instance::initialize_all_slots
0000s0sClass::MOP::Instance::::initialize_slotClass::MOP::Instance::initialize_slot
0000s0sClass::MOP::Instance::::inline_deinitialize_slotClass::MOP::Instance::inline_deinitialize_slot
0000s0sClass::MOP::Instance::::inline_get_is_lvalueClass::MOP::Instance::inline_get_is_lvalue
0000s0sClass::MOP::Instance::::inline_initialize_slotClass::MOP::Instance::inline_initialize_slot
0000s0sClass::MOP::Instance::::inline_rebless_instance_structureClass::MOP::Instance::inline_rebless_instance_structure
0000s0sClass::MOP::Instance::::inline_strengthen_slot_valueClass::MOP::Instance::inline_strengthen_slot_value
0000s0sClass::MOP::Instance::::is_valid_slotClass::MOP::Instance::is_valid_slot
0000s0sClass::MOP::Instance::::rebless_instance_structureClass::MOP::Instance::rebless_instance_structure
0000s0sClass::MOP::Instance::::slot_value_is_weakClass::MOP::Instance::slot_value_is_weak
0000s0sClass::MOP::Instance::::strengthen_slot_valueClass::MOP::Instance::strengthen_slot_value
0000s0sClass::MOP::Instance::::weaken_slot_valueClass::MOP::Instance::weaken_slot_value
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1
2package Class::MOP::Instance;
3
# spent 8µs within Class::MOP::Instance::BEGIN@3 which was called: # once (8µs+0s) by Class::MOP::Class::BEGIN@13 at line 5
BEGIN {
417µs $Class::MOP::Instance::AUTHORITY = 'cpan:STEVAN';
5122µs18µs}
# spent 8µs making 1 call to Class::MOP::Instance::BEGIN@3
6{
721µs $Class::MOP::Instance::VERSION = '2.0602';
8}
9
10315µs210µs
# spent 8µs (6+2) within Class::MOP::Instance::BEGIN@10 which was called: # once (6µs+2µs) by Class::MOP::Class::BEGIN@13 at line 10
use strict;
# spent 8µs making 1 call to Class::MOP::Instance::BEGIN@10 # spent 2µs making 1 call to strict::import
11319µs222µs
# spent 14µs (6+8) within Class::MOP::Instance::BEGIN@11 which was called: # once (6µs+8µs) by Class::MOP::Class::BEGIN@13 at line 11
use warnings;
# spent 14µs making 1 call to Class::MOP::Instance::BEGIN@11 # spent 8µs making 1 call to warnings::import
12
13320µs295µs
# spent 51µs (8+44) within Class::MOP::Instance::BEGIN@13 which was called: # once (8µs+44µs) by Class::MOP::Class::BEGIN@13 at line 13
use Scalar::Util 'isweak', 'weaken', 'blessed';
# spent 51µs making 1 call to Class::MOP::Instance::BEGIN@13 # spent 44µs making 1 call to Exporter::import
14
1531.17ms2131µs
# spent 69µs (6+62) within Class::MOP::Instance::BEGIN@15 which was called: # once (6µs+62µs) by Class::MOP::Class::BEGIN@13 at line 15
use base 'Class::MOP::Object';
# spent 69µs making 1 call to Class::MOP::Instance::BEGIN@15 # spent 62µs making 1 call to base::import
16
17# make this not a valid method name, to avoid (most) attribute conflicts
181400nsmy $RESERVED_MOP_SLOT = '<<MOP>>';
19
20
# spent 3.17ms (1.82+1.35) within Class::MOP::Instance::BUILDARGS which was called 56 times, avg 57µs/call: # 56 times (1.82ms+1.35ms) by Class::MOP::Instance::new at line 41, avg 57µs/call
sub BUILDARGS {
217781.61ms my ($class, @args) = @_;
22
235642µs if ( @args == 1 ) {
# spent 42µs making 56 calls to Scalar::Util::blessed, avg 746ns/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 my %options = @args;
32 # FIXME lazy_build
334421.31ms $options{slots} ||= [ map { $_->slots } @{ $options{attributes} || [] } ];
# spent 1.31ms making 442 calls to Class::MOP::Attribute::slots, avg 3µs/call
34 $options{slot_hash} = { map { $_ => undef } @{ $options{slots} } }; # FIXME lazy_build
35
36 return \%options;
37}
38
39
# spent 4.44ms (667µs+3.78) within Class::MOP::Instance::new which was called 56 times, avg 79µs/call: # 56 times (667µs+3.78ms) by Class::MOP::Class::_create_meta_instance at line 726 of Class/MOP/Class.pm, avg 79µs/call
sub new {
40280673µs my $class = shift;
41563.17ms my $options = $class->BUILDARGS(@_);
# spent 3.17ms making 56 calls to Class::MOP::Instance::BUILDARGS, avg 57µs/call
42
43 # FIXME replace with a proper constructor
4456545µs my $instance = $class->_new(%$options);
# spent 376µs making 47 calls to Class::MOP::Instance::_new, avg 8µs/call # spent 168µs making 9 calls to Moose::Meta::Instance::_new, avg 19µs/call
45
46 # FIXME weak_ref => 1,
475661µs weaken($instance->{'associated_metaclass'});
# spent 61µs making 56 calls to Scalar::Util::weaken, avg 1µs/call
48
49 return $instance;
50}
51
52
# spent 376µs within Class::MOP::Instance::_new which was called 47 times, avg 8µs/call: # 47 times (376µs+0s) by Class::MOP::Instance::new at line 44, avg 8µs/call
sub _new {
53188409µs my $class = shift;
54 return Class::MOP::Class->initialize($class)->new_object(@_)
55 if $class ne __PACKAGE__;
56
57 my $params = @_ == 1 ? $_[0] : {@_};
58 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
7658241µs1815µssub _class_name { $_[0]->{_class_name} ||= $_[0]->associated_metaclass->name }
# spent 10µs making 9 calls to Class::MOP::Instance::associated_metaclass, avg 1µs/call # spent 5µs making 9 calls to Class::MOP::Package::name, avg 567ns/call
77
78
# spent 3.45ms (3.27+183µs) within Class::MOP::Instance::create_instance which was called 58 times, avg 60µs/call: # 58 times (3.27ms+183µs) by Class::MOP::Class::_construct_instance at line 522 of Class/MOP/Class.pm, avg 60µs/call
sub create_instance {
791163.25ms my $self = shift;
8058182µs bless {}, $self->_class_name;
# spent 182µs making 58 calls to Class::MOP::Instance::_class_name, avg 3µs/call
81}
82
83sub 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
105sub get_all_slots {
106 my $self = shift;
107 return @{$self->{'slots'}};
108}
109
110sub get_all_attributes {
111 my $self = shift;
112 return @{$self->{attributes}};
113}
114
115sub 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 23µs within Class::MOP::Instance::get_slot_value which was called 12 times, avg 2µs/call: # 12 times (23µs+0s) by Class::MOP::Attribute::get_raw_value at line 298 of Class/MOP/Attribute.pm, avg 2µs/call
sub get_slot_value {
1232431µs my ($self, $instance, $slot_name) = @_;
124 $instance->{$slot_name};
125}
126
127
# spent 998µs within Class::MOP::Instance::set_slot_value which was called 376 times, avg 3µs/call: # 376 times (998µs+0s) by Class::MOP::Attribute::_set_initial_slot_value at line 150 of Class/MOP/Attribute.pm, avg 3µs/call
sub set_slot_value {
1287521.34ms my ($self, $instance, $slot_name, $value) = @_;
129 $instance->{$slot_name} = $value;
130}
131
132sub initialize_slot {
133 my ($self, $instance, $slot_name) = @_;
134 return;
135}
136
137sub deinitialize_slot {
138 my ( $self, $instance, $slot_name ) = @_;
139 delete $instance->{$slot_name};
140}
141
142sub 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
149sub 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 25µs within Class::MOP::Instance::is_slot_initialized which was called 12 times, avg 2µs/call: # 12 times (25µs+0s) by Class::MOP::Attribute::has_value at line 319 of Class/MOP/Attribute.pm, avg 2µs/call
sub is_slot_initialized {
1572434µs my ($self, $instance, $slot_name, $value) = @_;
158 exists $instance->{$slot_name};
159}
160
161sub weaken_slot_value {
162 my ($self, $instance, $slot_name) = @_;
163 weaken $instance->{$slot_name};
164}
165
166sub slot_value_is_weak {
167 my ($self, $instance, $slot_name) = @_;
168 isweak $instance->{$slot_name};
169}
170
171sub 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
176sub 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 72µs within Class::MOP::Instance::is_dependent_on_superclasses which was called 56 times, avg 1µs/call: # 56 times (72µs+0s) by Class::MOP::Class::_create_meta_instance at line 731 of Class/MOP/Class.pm, avg 1µs/call
sub is_dependent_on_superclasses {
18556109µs return; # for meta instances that require updates on inherited slot changes
186}
187
188sub _get_mop_slot {
189 my ($self, $instance) = @_;
190 $self->get_slot_value($instance, $RESERVED_MOP_SLOT);
191}
192
193sub _has_mop_slot {
194 my ($self, $instance) = @_;
195 $self->is_slot_initialized($instance, $RESERVED_MOP_SLOT);
196}
197
198sub _set_mop_slot {
199 my ($self, $instance, $value) = @_;
200 $self->set_slot_value($instance, $RESERVED_MOP_SLOT, $value);
201}
202
203sub _clear_mop_slot {
204 my ($self, $instance) = @_;
205 $self->deinitialize_slot($instance, $RESERVED_MOP_SLOT);
206}
207
208# inlinable operation snippets
209
210103185µs
# spent 106µs within Class::MOP::Instance::is_inlinable which was called 103 times, avg 1µs/call: # 95 times (94µs+0s) by Class::MOP::Attribute::_process_accessors at line 384 of Class/MOP/Attribute.pm, avg 992ns/call # 8 times (12µs+0s) by Moose::Meta::Method::Accessor::_instance_is_inlinable at line 57 of Moose/Meta/Method/Accessor.pm, avg 1µs/call
sub is_inlinable { 1 }
211
212
# spent 71µs within Class::MOP::Instance::inline_create_instance which was called 30 times, avg 2µs/call: # 30 times (71µs+0s) by Class::MOP::Class::_inline_create_instance at line 583 of Class/MOP/Class.pm, avg 2µs/call
sub inline_create_instance {
2136099µs my ($self, $class_variable) = @_;
214 'bless {} => ' . $class_variable;
215}
216
217
# spent 1.15ms within Class::MOP::Instance::inline_slot_access which was called 506 times, avg 2µs/call: # 403 times (868µs+0s) by Class::MOP::Instance::inline_set_slot_value at line 231, avg 2µs/call # 84 times (231µs+0s) by Class::MOP::Instance::inline_get_slot_value at line 226, avg 3µs/call # 17 times (44µs+0s) by Class::MOP::Instance::inline_is_slot_initialized at line 245, avg 3µs/call # 2 times (4µs+0s) by Class::MOP::Instance::inline_weaken_slot_value at line 250, avg 2µs/call
sub inline_slot_access {
21810121.67ms my ($self, $instance, $slot_name) = @_;
219 sprintf q[%s->{"%s"}], $instance, quotemeta($slot_name);
220}
221
222sub inline_get_is_lvalue { 1 }
223
224
# spent 572µs (340+231) within Class::MOP::Instance::inline_get_slot_value which was called 84 times, avg 7µs/call: # 84 times (340µs+231µs) by Class::MOP::Attribute::_inline_instance_get at line 311 of Class/MOP/Attribute.pm, avg 7µs/call
sub inline_get_slot_value {
225168292µs my ($self, $instance, $slot_name) = @_;
22684231µs $self->inline_slot_access($instance, $slot_name);
# spent 231µs making 84 calls to Class::MOP::Instance::inline_slot_access, avg 3µs/call
227}
228
229
# spent 2.47ms (1.61+868µs) within Class::MOP::Instance::inline_set_slot_value which was called 403 times, avg 6µs/call: # 403 times (1.61ms+868µs) by Class::MOP::Attribute::_inline_instance_set at line 288 of Class/MOP/Attribute.pm, avg 6µs/call
sub inline_set_slot_value {
2308061.42ms my ($self, $instance, $slot_name, $value) = @_;
231403868µs $self->inline_slot_access($instance, $slot_name) . " = $value",
# spent 868µs making 403 calls to Class::MOP::Instance::inline_slot_access, avg 2µs/call
232}
233
234sub inline_initialize_slot {
235 my ($self, $instance, $slot_name) = @_;
236 return '';
237}
238
239sub inline_deinitialize_slot {
240 my ($self, $instance, $slot_name) = @_;
241 "delete " . $self->inline_slot_access($instance, $slot_name);
242}
243
# spent 125µs (80+44) within Class::MOP::Instance::inline_is_slot_initialized which was called 17 times, avg 7µs/call: # 17 times (80µs+44µs) by Class::MOP::Attribute::_inline_instance_has at line 332 of Class/MOP/Attribute.pm, avg 7µs/call
sub inline_is_slot_initialized {
2443478µs my ($self, $instance, $slot_name) = @_;
2451744µs "exists " . $self->inline_slot_access($instance, $slot_name);
# spent 44µs making 17 calls to Class::MOP::Instance::inline_slot_access, avg 3µs/call
246}
247
248
# spent 16µs (12+4) within Class::MOP::Instance::inline_weaken_slot_value which was called 2 times, avg 8µs/call: # 2 times (12µs+4µs) by Moose::Meta::Attribute::_inline_weaken_value at line 758 of Moose/Meta/Attribute.pm, avg 8µs/call
sub inline_weaken_slot_value {
249410µs my ($self, $instance, $slot_name) = @_;
25024µs sprintf "Scalar::Util::weaken( %s )", $self->inline_slot_access($instance, $slot_name);
# spent 4µs making 2 calls to Class::MOP::Instance::inline_slot_access, avg 2µs/call
251}
252
253sub 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
258sub inline_rebless_instance_structure {
259 my ($self, $instance, $class_variable) = @_;
260 "bless $instance => $class_variable";
261}
262
263sub _inline_get_mop_slot {
264 my ($self, $instance) = @_;
265 $self->inline_get_slot_value($instance, $RESERVED_MOP_SLOT);
266}
267
268sub _inline_set_mop_slot {
269 my ($self, $instance, $value) = @_;
270 $self->inline_set_slot_value($instance, $RESERVED_MOP_SLOT, $value);
271}
272
273sub _inline_clear_mop_slot {
274 my ($self, $instance) = @_;
275 $self->inline_deinitialize_slot($instance, $RESERVED_MOP_SLOT);
276}
277
27813µs1;
279
280# ABSTRACT: Instance Meta Object
281
- -
284=pod
285
286=head1 NAME
287
288Class::MOP::Instance - Instance Meta Object
289
290=head1 VERSION
291
292version 2.0602
293
294=head1 DESCRIPTION
295
296The Instance Protocol controls the creation of object instances, and
297the storage of attribute values in those instances.
298
299Using this API directly in your own code violates encapsulation, and
300we recommend that you use the appropriate APIs in L<Class::MOP::Class>
301and L<Class::MOP::Attribute> instead. Those APIs in turn call the
302methods in this class as appropriate.
303
304This class also participates in generating inlined code by providing
305snippets of code to access an object instance.
306
307=head1 METHODS
308
309=head2 Object construction
310
311=over 4
312
313=item B<< Class::MOP::Instance->new(%options) >>
314
315This method creates a new meta-instance object.
316
317It accepts the following keys in C<%options>:
318
319=over 8
320
321=item * associated_metaclass
322
323The L<Class::MOP::Class> object for which instances will be created.
324
325=item * attributes
326
327An array reference of L<Class::MOP::Attribute> objects. These are the
328attributes which can be stored in each instance.
329
330=back
331
332=back
333
334=head2 Creating and altering instances
335
336=over 4
337
338=item B<< $metainstance->create_instance >>
339
340This method returns a reference blessed into the associated
341metaclass's class.
342
343The default is to use a hash reference. Subclasses can override this.
344
345=item B<< $metainstance->clone_instance($instance) >>
346
347Given an instance, this method creates a new object by making
348I<shallow> clone of the original.
349
350=back
351
352=head2 Introspection
353
354=over 4
355
356=item B<< $metainstance->associated_metaclass >>
357
358This returns the L<Class::MOP::Class> object associated with the
359meta-instance object.
360
361=item B<< $metainstance->get_all_slots >>
362
363This returns a list of slot names stored in object instances. In
364almost all cases, slot names correspond directly attribute names.
365
366=item B<< $metainstance->is_valid_slot($slot_name) >>
367
368This will return true if C<$slot_name> is a valid slot name.
369
370=item B<< $metainstance->get_all_attributes >>
371
372This returns a list of attributes corresponding to the attributes
373passed to the constructor.
374
375=back
376
377=head2 Operations on Instance Structures
378
379It's important to understand that the meta-instance object is a
380different entity from the actual instances it creates. For this
381reason, any operations on the C<$instance_structure> always require
382that the object instance be passed to the method.
383
384=over 4
385
386=item B<< $metainstance->get_slot_value($instance_structure, $slot_name) >>
387
388=item B<< $metainstance->set_slot_value($instance_structure, $slot_name, $value) >>
389
390=item B<< $metainstance->initialize_slot($instance_structure, $slot_name) >>
391
392=item B<< $metainstance->deinitialize_slot($instance_structure, $slot_name) >>
393
394=item B<< $metainstance->initialize_all_slots($instance_structure) >>
395
396=item B<< $metainstance->deinitialize_all_slots($instance_structure) >>
397
398=item B<< $metainstance->is_slot_initialized($instance_structure, $slot_name) >>
399
400=item B<< $metainstance->weaken_slot_value($instance_structure, $slot_name) >>
401
402=item B<< $metainstance->slot_value_is_weak($instance_structure, $slot_name) >>
403
404=item B<< $metainstance->strengthen_slot_value($instance_structure, $slot_name) >>
405
406=item B<< $metainstance->rebless_instance_structure($instance_structure, $new_metaclass) >>
407
408The exact details of what each method does should be fairly obvious
409from the method name.
410
411=back
412
413=head2 Inlinable Instance Operations
414
415=over 4
416
417=item B<< $metainstance->is_inlinable >>
418
419This is a boolean that indicates whether or not slot access operations
420can be inlined. By default it is true, but subclasses can override
421this.
422
423=item B<< $metainstance->inline_create_instance($class_variable) >>
424
425This method expects a string that, I<when inlined>, will become a
426class name. This would literally be something like C<'$class'>, not an
427actual class name.
428
429It returns a snippet of code that creates a new object for the
430class. This is something like C< bless {}, $class_name >.
431
432=item B<< $metainstance->inline_get_is_lvalue >>
433
434Returns whether or not C<inline_get_slot_value> is a valid lvalue. This can be
435used to do extra optimizations when generating inlined methods.
436
437=item B<< $metainstance->inline_slot_access($instance_variable, $slot_name) >>
438
439=item B<< $metainstance->inline_get_slot_value($instance_variable, $slot_name) >>
440
441=item B<< $metainstance->inline_set_slot_value($instance_variable, $slot_name, $value) >>
442
443=item B<< $metainstance->inline_initialize_slot($instance_variable, $slot_name) >>
444
445=item B<< $metainstance->inline_deinitialize_slot($instance_variable, $slot_name) >>
446
447=item B<< $metainstance->inline_is_slot_initialized($instance_variable, $slot_name) >>
448
449=item B<< $metainstance->inline_weaken_slot_value($instance_variable, $slot_name) >>
450
451=item B<< $metainstance->inline_strengthen_slot_value($instance_variable, $slot_name) >>
452
453These methods all expect two arguments. The first is the name of a
454variable, than when inlined, will represent the object
455instance. Typically this will be a literal string like C<'$_[0]'>.
456
457The second argument is a slot name.
458
459The method returns a snippet of code that, when inlined, performs some
460operation on the instance.
461
462=item B<< $metainstance->inline_rebless_instance_structure($instance_variable, $class_variable) >>
463
464This takes the name of a variable that will, when inlined, represent the object
465instance, and the name of a variable that will represent the class to rebless
466into, and returns code to rebless an instance into a class.
467
468=back
469
470=head2 Introspection
471
472=over 4
473
474=item B<< Class::MOP::Instance->meta >>
475
476This will return a L<Class::MOP::Class> instance for this class.
477
478It should also be noted that L<Class::MOP> will actually bootstrap
479this module by installing a number of attribute meta-objects into its
480metaclass.
481
482=back
483
484=head1 AUTHOR
485
486Moose is maintained by the Moose Cabal, along with the help of many contributors. See L<Moose/CABAL> and L<Moose/CONTRIBUTORS> for details.
487
488=head1 COPYRIGHT AND LICENSE
489
490This software is copyright (c) 2012 by Infinity Interactive, Inc..
491
492This is free software; you can redistribute it and/or modify it under
493the same terms as the Perl 5 programming language system itself.
494
495=cut
496
497
498__END__