← Index
NYTProf Performance Profile   « block view • line view • sub view »
For /usr/bin/epoll_server.pl
  Run on Wed Jan 5 05:34:33 2011
Reported on Wed Jan 5 05:36:12 2011

File /usr/lib/perl5/vendor_perl/5.10.1/i386-linux-thread-multi/Class/MOP/Instance.pm
Statements Executed 13160
Statement Execution Time 145ms
Subroutines — ordered by exclusive time
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
24243229.2ms29.2msClass::MOP::Instance::::set_slot_valueClass::MOP::Instance::set_slot_value
1581124.1ms44.6msClass::MOP::Instance::::BUILDARGSClass::MOP::Instance::BUILDARGS
6135417.2ms25.8msClass::MOP::Instance::::inline_set_slot_valueClass::MOP::Instance::inline_set_slot_value
2061114.4ms16.5msClass::MOP::Instance::::create_instanceClass::MOP::Instance::create_instance
8425111.5ms11.5msClass::MOP::Instance::::inline_slot_accessClass::MOP::Instance::inline_slot_access
214119.71ms11.5msClass::MOP::Instance::::clone_instanceClass::MOP::Instance::clone_instance
158118.19ms60.5msClass::MOP::Instance::::newClass::MOP::Instance::new
171323.95ms5.98msClass::MOP::Instance::::inline_get_slot_valueClass::MOP::Instance::inline_get_slot_value
420213.60ms3.88msClass::MOP::Instance::::_class_nameClass::MOP::Instance::_class_name
34111.50ms1.50msClass::MOP::Instance::::_newClass::MOP::Instance::_new
44221.37ms1.98msClass::MOP::Instance::::inline_is_slot_initializedClass::MOP::Instance::inline_is_slot_initialized
115111.02ms1.02msClass::MOP::Instance::::get_slot_valueClass::MOP::Instance::get_slot_value
15811854µs854µsClass::MOP::Instance::::is_dependent_on_superclassesClass::MOP::Instance::is_dependent_on_superclasses
5622729µs729µsClass::MOP::Instance::::inline_create_instanceClass::MOP::Instance::inline_create_instance
8411686µs686µsClass::MOP::Instance::::is_inlinableClass::MOP::Instance::is_inlinable
6011313µs313µsClass::MOP::Instance::::is_slot_initializedClass::MOP::Instance::is_slot_initialized
622232µs339µsClass::MOP::Instance::::inline_weaken_slot_valueClass::MOP::Instance::inline_weaken_slot_value
811223µs318µsClass::MOP::Instance::::inline_deinitialize_slotClass::MOP::Instance::inline_deinitialize_slot
2611179µs179µsClass::MOP::Instance::::associated_metaclassClass::MOP::Instance::associated_metaclass
11150µs61µsClass::MOP::Instance::::BEGIN@4Class::MOP::Instance::BEGIN@4
11130µs142µsClass::MOP::Instance::::BEGIN@5Class::MOP::Instance::BEGIN@5
11129µs158µsClass::MOP::Instance::::BEGIN@7Class::MOP::Instance::BEGIN@7
11129µs1.69msClass::MOP::Instance::::BEGIN@13Class::MOP::Instance::BEGIN@13
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_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::::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
4379µs273µs
# spent 61µs (50+11) within Class::MOP::Instance::BEGIN@4 which was called # once (50µs+11µs) by Class::MOP::Class::BEGIN@7 at line 4
use strict;
# spent 61µs making 1 call to Class::MOP::Instance::BEGIN@4 # spent 11µs making 1 call to strict::import
5392µs2253µs
# spent 142µs (30+112) within Class::MOP::Instance::BEGIN@5 which was called # once (30µs+112µs) by Class::MOP::Class::BEGIN@7 at line 5
use warnings;
# spent 142µs making 1 call to Class::MOP::Instance::BEGIN@5 # spent 112µs making 1 call to warnings::import
6
73160µs2287µs
# spent 158µs (29+129) within Class::MOP::Instance::BEGIN@7 which was called # once (29µs+129µs) by Class::MOP::Class::BEGIN@7 at line 7
use Scalar::Util 'weaken', 'blessed';
# spent 158µs making 1 call to Class::MOP::Instance::BEGIN@7 # spent 129µs making 1 call to Exporter::import
8
913µsour $VERSION = '1.00';
101156µs$VERSION = eval $VERSION;
1112µsour $AUTHORITY = 'cpan:STEVAN';
12
1333.73ms23.35ms
# spent 1.69ms (29µs+1.66) within Class::MOP::Instance::BEGIN@13 which was called # once (29µs+1.66ms) by Class::MOP::Class::BEGIN@7 at line 13
use base 'Class::MOP::Object';
# spent 1.69ms making 1 call to Class::MOP::Instance::BEGIN@13 # spent 1.66ms making 1 call to base::import
14
15
# spent 44.6ms (24.1+20.5) within Class::MOP::Instance::BUILDARGS which was called 158 times, avg 283µs/call: # 158 times (24.1ms+20.5ms) by Class::MOP::Instance::new at line 36, avg 283µs/call
sub BUILDARGS {
16201224.6ms my ($class, @args) = @_;
17
18 if ( @args == 1 ) {
# spent 1.10ms making 158 calls to Scalar::Util::blessed, avg 7µs/call
19 unshift @args, "associated_metaclass";
20 } elsif ( @args >= 2 && blessed($args[0]) && $args[0]->isa("Class::MOP::Class") ) {
21 # compat mode
22 my ( $meta, @attrs ) = @args;
23 @args = ( associated_metaclass => $meta, attributes => \@attrs );
24 }
25
26 my %options = @args;
27 # FIXME lazy_build
28 $options{slots} ||= [ map { $_->slots } @{ $options{attributes} || [] } ];
# spent 19.4ms making 1064 calls to Class::MOP::Attribute::slots, avg 18µs/call
29 $options{slot_hash} = { map { $_ => undef } @{ $options{slots} } }; # FIXME lazy_build
30
31 return \%options;
32}
33
34
# spent 60.5ms (8.19+52.3) within Class::MOP::Instance::new which was called 158 times, avg 383µs/call: # 158 times (8.19ms+52.3ms) by Class::MOP::Class::_create_meta_instance at line 390 of Class/MOP/Class.pm, avg 383µs/call
sub new {
357908.56ms my $class = shift;
36 my $options = $class->BUILDARGS(@_);
# spent 44.6ms making 158 calls to Class::MOP::Instance::BUILDARGS, avg 283µs/call
37
38 # FIXME replace with a proper constructor
39 my $instance = $class->_new(%$options);
# spent 5.34ms making 124 calls to Moose::Meta::Instance::_new, avg 43µs/call # spent 1.50ms making 34 calls to Class::MOP::Instance::_new, avg 44µs/call
40
41 # FIXME weak_ref => 1,
42 weaken($instance->{'associated_metaclass'});
# spent 810µs making 158 calls to Scalar::Util::weaken, avg 5µs/call
43
44 return $instance;
45}
46
47
# spent 1.50ms within Class::MOP::Instance::_new which was called 34 times, avg 44µs/call: # 34 times (1.50ms+0s) by Class::MOP::Instance::new at line 39, avg 44µs/call
sub _new {
481361.58ms my $class = shift;
49 return Class::MOP::Class->initialize($class)->new_object(@_)
50 if $class ne __PACKAGE__;
51
52 my $params = @_ == 1 ? $_[0] : {@_};
53 return bless {
54 # NOTE:
55 # I am not sure that it makes
56 # sense to pass in the meta
57 # The ideal would be to just
58 # pass in the class name, but
59 # that is placing too much of
60 # an assumption on bless(),
61 # which is *probably* a safe
62 # assumption,.. but you can
63 # never tell <:)
64 'associated_metaclass' => $params->{associated_metaclass},
65 'attributes' => $params->{attributes},
66 'slots' => $params->{slots},
67 'slot_hash' => $params->{slot_hash},
68 } => $class;
69}
70
714205.24ms52271µs
# spent 3.88ms (3.60+271µs) within Class::MOP::Instance::_class_name which was called 420 times, avg 9µs/call: # 214 times (1.82ms+16µs) by Class::MOP::Instance::clone_instance at line 82, avg 9µs/call # 206 times (1.79ms+255µs) by Class::MOP::Instance::create_instance at line 77, avg 10µs/call
sub _class_name { $_[0]->{_class_name} ||= $_[0]->associated_metaclass->name }
# spent 179µs making 26 calls to Class::MOP::Instance::associated_metaclass, avg 7µs/call # spent 92µs making 26 calls to Class::MOP::Package::name, avg 4µs/call
72
7326329µs
# spent 179µs within Class::MOP::Instance::associated_metaclass which was called 26 times, avg 7µs/call: # 26 times (179µs+0s) by Class::MOP::Instance::_class_name at line 71, avg 7µs/call
sub associated_metaclass { $_[0]{'associated_metaclass'} }
74
75
# spent 16.5ms (14.4+2.04) within Class::MOP::Instance::create_instance which was called 206 times, avg 80µs/call: # 206 times (14.4ms+2.04ms) by Class::MOP::Class::_construct_instance at line 362 of Class/MOP/Class.pm, avg 80µs/call
sub create_instance {
7641214.3ms my $self = shift;
77 bless {}, $self->_class_name;
# spent 2.04ms making 206 calls to Class::MOP::Instance::_class_name, avg 10µs/call
78}
79
80
# spent 11.5ms (9.71+1.83) within Class::MOP::Instance::clone_instance which was called 214 times, avg 54µs/call: # 214 times (9.71ms+1.83ms) by Class::MOP::Class::_clone_instance at line 420 of Class/MOP/Class.pm, avg 54µs/call
sub clone_instance {
814289.21ms my ($self, $instance) = @_;
82 bless { %$instance }, $self->_class_name;
# spent 1.83ms making 214 calls to Class::MOP::Instance::_class_name, avg 9µs/call
83}
84
85# operations on meta instance
86
87sub get_all_slots {
88 my $self = shift;
89 return @{$self->{'slots'}};
90}
91
92sub get_all_attributes {
93 my $self = shift;
94 return @{$self->{attributes}};
95}
96
97sub is_valid_slot {
98 my ($self, $slot_name) = @_;
99 exists $self->{'slot_hash'}->{$slot_name};
100}
101
102# operations on created instances
103
104
# spent 1.02ms within Class::MOP::Instance::get_slot_value which was called 115 times, avg 9µs/call: # 115 times (1.02ms+0s) by Class::MOP::Attribute::get_raw_value at line 272 of Class/MOP/Attribute.pm, avg 9µs/call
sub get_slot_value {
1052302.02ms my ($self, $instance, $slot_name) = @_;
106 $instance->{$slot_name};
107}
108
109
# spent 29.2ms within Class::MOP::Instance::set_slot_value which was called 2424 times, avg 12µs/call: # 1960 times (23.9ms+0s) by Class::MOP::Attribute::_set_initial_slot_value at line 146 of Class/MOP/Attribute.pm, avg 12µs/call # 441 times (5.01ms+0s) by Class::MOP::Attribute::set_raw_value at line 264 of Class/MOP/Attribute.pm, avg 11µs/call # 23 times (203µs+0s) by Moose::Meta::Attribute::_set_initial_slot_value at line 437 of Moose/Meta/Attribute.pm, avg 9µs/call
sub set_slot_value {
110484837.2ms my ($self, $instance, $slot_name, $value) = @_;
111 $instance->{$slot_name} = $value;
112}
113
114sub initialize_slot {
115 my ($self, $instance, $slot_name) = @_;
116 return;
117}
118
119sub deinitialize_slot {
120 my ( $self, $instance, $slot_name ) = @_;
121 delete $instance->{$slot_name};
122}
123
124sub initialize_all_slots {
125 my ($self, $instance) = @_;
126 foreach my $slot_name ($self->get_all_slots) {
127 $self->initialize_slot($instance, $slot_name);
128 }
129}
130
131sub deinitialize_all_slots {
132 my ($self, $instance) = @_;
133 foreach my $slot_name ($self->get_all_slots) {
134 $self->deinitialize_slot($instance, $slot_name);
135 }
136}
137
138
# spent 313µs within Class::MOP::Instance::is_slot_initialized which was called 60 times, avg 5µs/call: # 60 times (313µs+0s) by Class::MOP::Attribute::has_value at line 280 of Class/MOP/Attribute.pm, avg 5µs/call
sub is_slot_initialized {
139120428µs my ($self, $instance, $slot_name, $value) = @_;
140 exists $instance->{$slot_name};
141}
142
143sub weaken_slot_value {
144 my ($self, $instance, $slot_name) = @_;
145 weaken $instance->{$slot_name};
146}
147
148sub strengthen_slot_value {
149 my ($self, $instance, $slot_name) = @_;
150 $self->set_slot_value($instance, $slot_name, $self->get_slot_value($instance, $slot_name));
151}
152
153sub rebless_instance_structure {
154 my ($self, $instance, $metaclass) = @_;
155
156 # we use $_[1] here because of t/306_rebless_overload.t regressions on 5.8.8
157 bless $_[1], $metaclass->name;
158}
159
160
# spent 854µs within Class::MOP::Instance::is_dependent_on_superclasses which was called 158 times, avg 5µs/call: # 158 times (854µs+0s) by Class::MOP::Class::_create_meta_instance at line 395 of Class/MOP/Class.pm, avg 5µs/call
sub is_dependent_on_superclasses {
1611581.22ms return; # for meta instances that require updates on inherited slot changes
162}
163
164# inlinable operation snippets
165
16684675µs
# spent 686µs within Class::MOP::Instance::is_inlinable which was called 84 times, avg 8µs/call: # 84 times (686µs+0s) by Class::MOP::Attribute::_process_accessors at line 320 of Class/MOP/Attribute.pm, avg 8µs/call
sub is_inlinable { 1 }
167
168
# spent 729µs within Class::MOP::Instance::inline_create_instance which was called 56 times, avg 13µs/call: # 31 times (461µs+0s) by Class::MOP::Method::Constructor::_generate_constructor_method_inline at line 113 of Class/MOP/Method/Constructor.pm, avg 15µs/call # 25 times (268µs+0s) by Moose::Meta::Method::Constructor::_generate_instance at line 121 of Moose/Meta/Method/Constructor.pm, avg 11µs/call
sub inline_create_instance {
169112844µs my ($self, $class_variable) = @_;
170 'bless {} => ' . $class_variable;
171}
172
173
# spent 11.5ms within Class::MOP::Instance::inline_slot_access which was called 842 times, avg 14µs/call: # 613 times (8.63ms+0s) by Class::MOP::Instance::inline_set_slot_value at line 185, avg 14µs/call # 171 times (2.03ms+0s) by Class::MOP::Instance::inline_get_slot_value at line 180, avg 12µs/call # 44 times (604µs+0s) by Class::MOP::Instance::inline_is_slot_initialized at line 199, avg 14µs/call # 8 times (95µs+0s) by Class::MOP::Instance::inline_deinitialize_slot at line 195, avg 12µs/call # 6 times (107µs+0s) by Class::MOP::Instance::inline_weaken_slot_value at line 204, avg 18µs/call
sub inline_slot_access {
174168415.9ms my ($self, $instance, $slot_name) = @_;
175 sprintf q[%s->{"%s"}], $instance, quotemeta($slot_name);
176}
177
178
# spent 5.98ms (3.95+2.03) within Class::MOP::Instance::inline_get_slot_value which was called 171 times, avg 35µs/call: # 104 times (2.11ms+1.20ms) by Moose::Meta::Method::Accessor::_inline_get at line 254 of Moose/Meta/Method/Accessor.pm, avg 32µs/call # 52 times (1.28ms+663µs) by Class::MOP::Method::Accessor::_generate_reader_method_inline at line 157 of Class/MOP/Method/Accessor.pm, avg 37µs/call # 15 times (560µs+166µs) by Class::MOP::Method::Accessor::_generate_accessor_method_inline at line 138 of Class/MOP/Method/Accessor.pm, avg 48µs/call
sub inline_get_slot_value {
1793423.41ms my ($self, $instance, $slot_name) = @_;
180 $self->inline_slot_access($instance, $slot_name);
# spent 2.03ms making 171 calls to Class::MOP::Instance::inline_slot_access, avg 12µs/call
181}
182
183
# spent 25.8ms (17.2+8.63) within Class::MOP::Instance::inline_set_slot_value which was called 613 times, avg 42µs/call: # 341 times (8.83ms+4.91ms) by Class::MOP::Method::Constructor::_generate_slot_initializer at line 159 of Class/MOP/Method/Constructor.pm, avg 40µs/call # 149 times (3.04ms+1.71ms) by Moose::Meta::Method::Constructor::_generate_slot_assignment at line 272 of Moose/Meta/Method/Constructor.pm, avg 32µs/call # 105 times (4.84ms+1.65ms) by Moose::Meta::Method::Accessor::_inline_store at line 220 of Moose/Meta/Method/Accessor.pm, avg 62µs/call # 15 times (403µs+333µs) by Class::MOP::Method::Accessor::_generate_accessor_method_inline at line 138 of Class/MOP/Method/Accessor.pm, avg 49µs/call # 3 times (63µs+35µs) by Class::MOP::Method::Accessor::_generate_writer_method_inline at line 175 of Class/MOP/Method/Accessor.pm, avg 33µs/call
sub inline_set_slot_value {
184122613.3ms my ($self, $instance, $slot_name, $value) = @_;
185 $self->inline_slot_access($instance, $slot_name) . " = $value",
# spent 8.63ms making 613 calls to Class::MOP::Instance::inline_slot_access, avg 14µs/call
186}
187
188sub inline_initialize_slot {
189 my ($self, $instance, $slot_name) = @_;
190 return '';
191}
192
193
# spent 318µs (223+95) within Class::MOP::Instance::inline_deinitialize_slot which was called 8 times, avg 40µs/call: # 8 times (223µs+95µs) by Class::MOP::Method::Accessor::_generate_clearer_method_inline at line 209 of Class/MOP/Method/Accessor.pm, avg 40µs/call
sub inline_deinitialize_slot {
19416149µs my ($self, $instance, $slot_name) = @_;
195 "delete " . $self->inline_slot_access($instance, $slot_name);
# spent 95µs making 8 calls to Class::MOP::Instance::inline_slot_access, avg 12µs/call
196}
197
# spent 1.98ms (1.37+604µs) within Class::MOP::Instance::inline_is_slot_initialized which was called 44 times, avg 45µs/call: # 23 times (470µs+380µs) by Class::MOP::Method::Accessor::_generate_predicate_method_inline at line 192 of Class/MOP/Method/Accessor.pm, avg 37µs/call # 21 times (905µs+224µs) by Moose::Meta::Method::Accessor::_inline_has at line 272 of Moose/Meta/Method/Accessor.pm, avg 54µs/call
sub inline_is_slot_initialized {
198881.21ms my ($self, $instance, $slot_name) = @_;
199 "exists " . $self->inline_slot_access($instance, $slot_name);
# spent 604µs making 44 calls to Class::MOP::Instance::inline_slot_access, avg 14µs/call
200}
201
202
# spent 339µs (232+107) within Class::MOP::Instance::inline_weaken_slot_value which was called 6 times, avg 56µs/call: # 4 times (195µs+92µs) by Moose::Meta::Method::Constructor::_generate_slot_assignment at line 283 of Moose/Meta/Method/Constructor.pm, avg 72µs/call # 2 times (37µs+15µs) by Moose::Meta::Method::Accessor::_inline_store at line 221 of Moose/Meta/Method/Accessor.pm, avg 26µs/call
sub inline_weaken_slot_value {
20312208µs my ($self, $instance, $slot_name) = @_;
204 sprintf "Scalar::Util::weaken( %s )", $self->inline_slot_access($instance, $slot_name);
# spent 107µs making 6 calls to Class::MOP::Instance::inline_slot_access, avg 18µs/call
205}
206
207sub inline_strengthen_slot_value {
208 my ($self, $instance, $slot_name) = @_;
209 $self->inline_set_slot_value($instance, $slot_name, $self->inline_slot_access($instance, $slot_name));
210}
211
212sub inline_rebless_instance_structure {
213 my ($self, $instance, $class_variable) = @_;
214 "bless $instance => $class_variable";
215}
216
217110µs1;
218
219__END__
220
221=pod
222
223=head1 NAME
224
225Class::MOP::Instance - Instance Meta Object
226
227=head1 DESCRIPTION
228
229The Instance Protocol controls the creation of object instances, and
230the storage of attribute values in those instances.
231
232Using this API directly in your own code violates encapsulation, and
233we recommend that you use the appropriate APIs in L<Class::MOP::Class>
234and L<Class::MOP::Attribute> instead. Those APIs in turn call the
235methods in this class as appropriate.
236
237This class also participates in generating inlined code by providing
238snippets of code to access an object instance.
239
240=head1 METHODS
241
242=head2 Object construction
243
244=over 4
245
246=item B<< Class::MOP::Instance->new(%options) >>
247
248This method creates a new meta-instance object.
249
250It accepts the following keys in C<%options>:
251
252=over 8
253
254=item * associated_metaclass
255
256The L<Class::MOP::Class> object for which instances will be created.
257
258=item * attributes
259
260An array reference of L<Class::MOP::Attribute> objects. These are the
261attributes which can be stored in each instance.
262
263=back
264
265=back
266
267=head2 Creating and altering instances
268
269=over 4
270
271=item B<< $metainstance->create_instance >>
272
273This method returns a reference blessed into the associated
274metaclass's class.
275
276The default is to use a hash reference. Subclasses can override this.
277
278=item B<< $metainstance->clone_instance($instance) >>
279
280Given an instance, this method creates a new object by making
281I<shallow> clone of the original.
282
283=back
284
285=head2 Introspection
286
287=over 4
288
289=item B<< $metainstance->associated_metaclass >>
290
291This returns the L<Class::MOP::Class> object associated with the
292meta-instance object.
293
294=item B<< $metainstance->get_all_slots >>
295
296This returns a list of slot names stored in object instances. In
297almost all cases, slot names correspond directly attribute names.
298
299=item B<< $metainstance->is_valid_slot($slot_name) >>
300
301This will return true if C<$slot_name> is a valid slot name.
302
303=item B<< $metainstance->get_all_attributes >>
304
305This returns a list of attributes corresponding to the attributes
306passed to the constructor.
307
308=back
309
310=head2 Operations on Instance Structures
311
312It's important to understand that the meta-instance object is a
313different entity from the actual instances it creates. For this
314reason, any operations on the C<$instance_structure> always require
315that the object instance be passed to the method.
316
317=over 4
318
319=item B<< $metainstance->get_slot_value($instance_structure, $slot_name) >>
320
321=item B<< $metainstance->set_slot_value($instance_structure, $slot_name, $value) >>
322
323=item B<< $metainstance->initialize_slot($instance_structure, $slot_name) >>
324
325=item B<< $metainstance->deinitialize_slot($instance_structure, $slot_name) >>
326
327=item B<< $metainstance->initialize_all_slots($instance_structure) >>
328
329=item B<< $metainstance->deinitialize_all_slots($instance_structure) >>
330
331=item B<< $metainstance->is_slot_initialized($instance_structure, $slot_name) >>
332
333=item B<< $metainstance->weaken_slot_value($instance_structure, $slot_name) >>
334
335=item B<< $metainstance->strengthen_slot_value($instance_structure, $slot_name) >>
336
337=item B<< $metainstance->rebless_instance_structure($instance_structure, $new_metaclass) >>
338
339The exact details of what each method does should be fairly obvious
340from the method name.
341
342=back
343
344=head2 Inlinable Instance Operations
345
346=over 4
347
348=item B<< $metainstance->is_inlinable >>
349
350This is a boolean that indicates whether or not slot access operations
351can be inlined. By default it is true, but subclasses can override
352this.
353
354=item B<< $metainstance->inline_create_instance($class_variable) >>
355
356This method expects a string that, I<when inlined>, will become a
357class name. This would literally be something like C<'$class'>, not an
358actual class name.
359
360It returns a snippet of code that creates a new object for the
361class. This is something like C< bless {}, $class_name >.
362
363=item B<< $metainstance->inline_slot_access($instance_variable, $slot_name) >>
364
365=item B<< $metainstance->inline_get_slot_value($instance_variable, $slot_name) >>
366
367=item B<< $metainstance->inline_set_slot_value($instance_variable, $slot_name, $value) >>
368
369=item B<< $metainstance->inline_initialize_slot($instance_variable, $slot_name) >>
370
371=item B<< $metainstance->inline_deinitialize_slot($instance_variable, $slot_name) >>
372
373=item B<< $metainstance->inline_is_slot_initialized($instance_variable, $slot_name) >>
374
375=item B<< $metainstance->inline_weaken_slot_value($instance_variable, $slot_name) >>
376
377=item B<< $metainstance->inline_strengthen_slot_value($instance_variable, $slot_name) >>
378
379These methods all expect two arguments. The first is the name of a
380variable, than when inlined, will represent the object
381instance. Typically this will be a literal string like C<'$_[0]'>.
382
383The second argument is a slot name.
384
385The method returns a snippet of code that, when inlined, performs some
386operation on the instance.
387
388=item B<< $metainstance->inline_rebless_instance_structure($instance_variable, $class_variable) >>
389
390This takes the name of a variable that will, when inlined, represent the object
391instance, and the name of a variable that will represent the class to rebless
392into, and returns code to rebless an instance into a class.
393
394=back
395
396=head2 Introspection
397
398=over 4
399
400=item B<< Class::MOP::Instance->meta >>
401
402This will return a L<Class::MOP::Class> instance for this class.
403
404It should also be noted that L<Class::MOP> will actually bootstrap
405this module by installing a number of attribute meta-objects into its
406metaclass.
407
408=back
409
410=head1 AUTHORS
411
412Yuval Kogman E<lt>nothingmuch@woobling.comE<gt>
413
414Stevan Little E<lt>stevan@iinteractive.comE<gt>
415
416=head1 COPYRIGHT AND LICENSE
417
418Copyright 2006-2010 by Infinity Interactive, Inc.
419
420L<http://www.iinteractive.com>
421
422This library is free software; you can redistribute it and/or modify
423it under the same terms as Perl itself.
424
425=cut
426