From: Jesse Luehrs Date: Fri, 15 Oct 2010 22:08:37 +0000 (-0500) Subject: add inline_get_is_lvalue X-Git-Tag: 1.10~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4dcd42721e336748f33f0226cfd32d2109d481c8;p=gitmo%2FClass-MOP.git add inline_get_is_lvalue --- diff --git a/lib/Class/MOP/Instance.pm b/lib/Class/MOP/Instance.pm index e2fb127..cc0fdea 100644 --- a/lib/Class/MOP/Instance.pm +++ b/lib/Class/MOP/Instance.pm @@ -175,6 +175,8 @@ sub inline_slot_access { sprintf q[%s->{"%s"}], $instance, quotemeta($slot_name); } +sub inline_get_is_lvalue { 1 } + sub inline_get_slot_value { my ($self, $instance, $slot_name) = @_; $self->inline_slot_access($instance, $slot_name); @@ -360,6 +362,11 @@ actual class name. It returns a snippet of code that creates a new object for the class. This is something like C< bless {}, $class_name >. +=item B<< $metainstance->inline_get_is_lvalue >> + +Returns whether or not C is a valid lvalue. This can be +used to do extra optimizations when generating inlined methods. + =item B<< $metainstance->inline_slot_access($instance_variable, $slot_name) >> =item B<< $metainstance->inline_get_slot_value($instance_variable, $slot_name) >>