microoptimize Class::MOP::Class::initialize since it's called so often
[gitmo/Class-MOP.git] / lib / Class / MOP / Instance.pm
index 2d3079a..8b70fdd 100644 (file)
@@ -47,8 +47,9 @@ sub new {
         # assumption,.. but you can
         # never tell <:)
         'associated_metaclass' => $options->{associated_metaclass},
-        'slots'     => $options->{slots},
-        'slot_hash' => $options->{slot_hash},
+        'attributes' => $options->{attributes},
+        'slots'      => $options->{slots},
+        'slot_hash'  => $options->{slot_hash},
     } => $class;
 
     # FIXME weak_ref => 1,
@@ -142,6 +143,10 @@ sub rebless_instance_structure {
     bless $instance, $metaclass->name;
 }
 
+sub is_dependent_on_superclasses {
+    return; # for meta instances that require updates on inherited slot changes
+}
+
 # inlinable operation snippets
 
 sub is_inlinable { 1 }
@@ -276,6 +281,13 @@ given to this object in C<new>.
 
 This will return true if C<$slot_name> is a valid slot name.
 
+=item B<is_dependent_on_superclasses>
+
+This method returns true when the meta instance must be recreated on any
+superclass changes.
+
+Defaults to false.
+
 =back
 
 =head2 Operations on Instance Structures