From: Stevan Little Date: Tue, 5 Sep 2006 06:27:34 +0000 (+0000) Subject: better MOP stuff X-Git-Tag: 0_35~10 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0b9372a2c3df0ea2a3fd528c6c1f6fd7f303b471;p=gitmo%2FClass-MOP.git better MOP stuff --- diff --git a/Changes b/Changes index 018d631..6f163f0 100644 --- a/Changes +++ b/Changes @@ -9,6 +9,8 @@ Revision history for Perl extension Class-MOP. - added Class::MOP::Method (and its subclasses) to the bootstrap - adjusted tests for this + - bootstrap no longer re-compiles accessors + so as to keep the MOP compile-time fast * Class::MOP::Method *** API CHANGE *** diff --git a/lib/Class/MOP.pm b/lib/Class/MOP.pm index 9b713f3..71656f9 100644 --- a/lib/Class/MOP.pm +++ b/lib/Class/MOP.pm @@ -359,17 +359,28 @@ Class::MOP::Method::Wrapped->meta->add_attribute( ## -------------------------------------------------------- ## Now close all the Class::MOP::* classes -Class::MOP::Package ->meta->make_immutable(inline_constructor => 0); -Class::MOP::Module ->meta->make_immutable(inline_constructor => 0); -Class::MOP::Class ->meta->make_immutable(inline_constructor => 0); -Class::MOP::Attribute->meta->make_immutable(inline_constructor => 0); -Class::MOP::Method ->meta->make_immutable(inline_constructor => 0); -Class::MOP::Instance ->meta->make_immutable(inline_constructor => 0); -Class::MOP::Object ->meta->make_immutable(inline_constructor => 0); - -# Class::MOP::Method subclasses -Class::MOP::Attribute::Accessor->meta->make_immutable(inline_constructor => 0); -Class::MOP::Method::Wrapped ->meta->make_immutable(inline_constructor => 0); +# NOTE: +# we don't need to inline the +# constructors or the accessors +# this only lengthens the compile +# time of the MOP, and gives us +# no actual benefits. + +$_->meta->make_immutable( + inline_constructor => 0, + inline_accessors => 0, +) for qw/ + Class::MOP::Package + Class::MOP::Module + Class::MOP::Class + Class::MOP::Attribute + Class::MOP::Method + Class::MOP::Instance + Class::MOP::Object + + Class::MOP::Attribute::Accessor + Class::MOP::Method::Wrapped +/; 1;