From: gfx Date: Wed, 22 Jul 2009 00:55:29 +0000 (+0900) Subject: Pure Perl accessors into XS X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=51499350804c43498c99f5542dd0f07219c115d3;p=gitmo%2FClass-MOP.git Pure Perl accessors into XS --- diff --git a/lib/Class/MOP/Method/Constructor.pm b/lib/Class/MOP/Method/Constructor.pm index 38b31d5..9e2d7dc 100644 --- a/lib/Class/MOP/Method/Constructor.pm +++ b/lib/Class/MOP/Method/Constructor.pm @@ -54,8 +54,8 @@ sub _new { ## accessors -sub options { (shift)->{'options'} } -sub associated_metaclass { (shift)->{'associated_metaclass'} } +#sub options { (shift)->{'options'} } +#sub associated_metaclass { (shift)->{'associated_metaclass'} } ## cached values ... diff --git a/lib/Class/MOP/Method/Generated.pm b/lib/Class/MOP/Method/Generated.pm index a1e9632..c89ba04 100644 --- a/lib/Class/MOP/Method/Generated.pm +++ b/lib/Class/MOP/Method/Generated.pm @@ -18,9 +18,8 @@ sub new { confess __PACKAGE__ . " is an abstract base class, you must provide a constructor."; } -sub is_inline { $_[0]{is_inline} } - -sub definition_context { $_[0]{definition_context} } +#sub is_inline { $_[0]{is_inline} } +#sub definition_context { $_[0]{definition_context} } sub _initialize_body { confess "No body to initialize, " . __PACKAGE__ . " is an abstract base class"; diff --git a/lib/Class/MOP/Method/Inlined.pm b/lib/Class/MOP/Method/Inlined.pm index 26b4887..ed89239 100644 --- a/lib/Class/MOP/Method/Inlined.pm +++ b/lib/Class/MOP/Method/Inlined.pm @@ -12,7 +12,7 @@ our $AUTHORITY = 'cpan:STEVAN'; use base 'Class::MOP::Method::Generated'; -sub _expected_method_class { $_[0]{_expected_method_class} } +#sub _expected_method_class { $_[0]{_expected_method_class} } sub _uninlined_body { my $self = shift; diff --git a/xs/Method.xs b/xs/Method.xs index 02a5f5c..90c3e9f 100644 --- a/xs/Method.xs +++ b/xs/Method.xs @@ -12,3 +12,20 @@ BOOT: INSTALL_SIMPLE_READER(Method, original_method); INSTALL_SIMPLE_WRITER_WITH_KEY(Method, _set_original_method, original_method); + +MODULE = Class::MOP::Method PACKAGE = Class::MOP::Method::Constructor + +BOOT: + INSTALL_SIMPLE_READER(Method::Constructor, options); + INSTALL_SIMPLE_READER(Method::Constructor, associated_metaclass); + +MODULE = Class::MOP::Method PACKAGE = Class::MOP::Method::Generated + +BOOT: + INSTALL_SIMPLE_READER(Method::Generated, is_inline); + INSTALL_SIMPLE_READER(Method::Generated, definition_context); + +MODULE = Class::MOP::Method PACKAGE = Class::MOP::Method::Inlined + +BOOT: + INSTALL_SIMPLE_READER(Method::Inlined, _expected_method_class);