develooper Front page | perl.perl5.porters | Postings from November 2008

Re: Perl_linklist (was Re: modules on CPAN defining PERL_CORE)

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
November 26, 2008 03:41
Subject:
Re: Perl_linklist (was Re: modules on CPAN defining PERL_CORE)
Message ID:
20081126114147.GT49335@plum.flirble.org
On Wed, Nov 26, 2008 at 12:34:13PM +0100, Rafael Garcia-Suarez wrote:
> 2008/11/26 Nicholas Clark <nick@ccl4.org>:

> Hmm. After compilation, that only returns op_next, the next op to be
> executed. During compilation, if op_next isn't set yet, it figures out
> which op comes next and stores it in op_next.
> 
> > Which then makes me wonder whether any of these *should* also be declared
> > public:
> >
> > p       |OP*    |sawparens      |NULLOK OP* o
> > p       |OP*    |scalar         |NULLOK OP* o
> > p       |OP*    |scalarkids     |NULLOK OP* o
> > p       |OP*    |scalarseq      |NULLOK OP* o
> > p       |OP*    |scalarvoid     |NN OP* o
> >
> > And all the rest can be made static, which may cause the trivial ones to be
> > inlined. (Which isn't terrible)
> 
> sawparens is really really short. It could be made static in the hope
> the compiler will inline it.

It's also used in perly.y, and it's called with a parameters that have side
effects. (Yes, I'd been trying this before I got your message)
I can't see a way to either make it static, or to make a macro that does it.

> The various Perl_scalar* functions manipulate the optree being
> constructed. I think they should go static too. They certainly should
> not be made public.

OK

Nicholas Clark

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About