This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Use PL_parser->lex_shared instead of Sv[IN]VX(PL_linestr)
authorFather Chrysostomos <sprout@cpan.org>
Tue, 28 Aug 2012 08:11:30 +0000 (01:11 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 28 Aug 2012 08:13:17 +0000 (01:13 -0700)
commit60f40a389519ab4482a60df44e5e9a03c8710752
tree3655689f6491d244b0fa3b5aa0806206490e5fef
parent473015163cb5f5f4cc6ef07c71f34b9d6c8608f1
Use PL_parser->lex_shared instead of Sv[IN]VX(PL_linestr)

Unfortunately, PL_parser->linestr and PL_parser->bufptr are both
part of the API, so we can’t just move them to PL_parser->lex_shared.
Instead, we have to copy them in sublex_push, to make them visible to
inner lexing scopes.

This allows the SvIVX(PL_linestr) and SvNVX(PL_linestr) hack to
be removed.

It should also speed things up slightly.  We are already allocating
PL_parser->lex_shared in sublex_push, so there should be no need to
upgrade PL_linestr to SvNVX as well.

I was pleasantly surprised to see how the here-doc code seemed to
shrink all by itself when modified to account.

PL_sublex_info.super_bufptr is also superseded by the addition of
->ls_bufptr to the LEXSHARED struct.  Its old values when localised
were not visible, being stashed away on the savestack, so it was
harder to use.
parser.h
perl.h
toke.c