This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Avoid duplicate GV lookup for barewords
authorFather Chrysostomos <sprout@cpan.org>
Thu, 4 Sep 2014 02:03:20 +0000 (19:03 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Thu, 4 Sep 2014 02:07:54 +0000 (19:07 -0700)
commit10c25cd94120c0e509e5ce54480c24d08281e090
treea36e9ac4ec2f20f04431f4dd37044a2542b3764f
parentd484d78941e5be45f7c13c93622be0687ef90863
Avoid duplicate GV lookup for barewords

Since commit f74617600 (5.12), the GV lookup that this commit removes
from yylex has only been used to see whether the bareword could be a
filehandle.  The result is used by intuit_method to decide whether we
have a method call for ‘foo bar’ or ‘foo $bar’.

Doing this lookup for every bareword we encounter even when we are not
going to call intuit_method is wasteful.

The previous commit ensured that intuit_method is called only once
for each bareword, so we can put that gv lookup directly inside
intuit_method.
embed.fnc
proto.h
toke.c