develooper Front page | perl.perl5.porters | Postings from October 2016

Re: I'd like to get rid of "use UNIVERSAL;"

Thread Previous | Thread Next
From:
Aristotle Pagaltzis
Date:
October 12, 2016 03:48
Subject:
Re: I'd like to get rid of "use UNIVERSAL;"
Message ID:
20161012034753.GA20356@plasmasturm.org
* Ævar Arnfjörð Bjarmason <avarab@gmail.com> [2016-10-12 01:12]:
> On Tue, Sep 27, 2016 at 3:47 PM, Aristotle Pagaltzis <pagaltzis@gmx.de> wrote:
> >     $ perl -MO=Concise -e'Foo->import(1)'
> >     8  <@> leave[1 ref] vKP/REFC ->(end)
> >     1     <0> enter ->2
> >     2     <;> nextstate(main 1 -e:1) v:{ ->3
> >     7     <1> entersub[t1] vKS/TARG ->8
> >     3        <0> pushmark s ->4
> >     4        <$> const(PV "Foo") sM/BARE ->5
> >     5        <$> const(IV 1) sM ->6
> >     6        <$> method_named(PV "import") ->7
> >     -e syntax OK
> >
> > If I read this right, the arguments are already on the stack by the time
> > that Perl_gv_fetchmethod_pvn_flags gets called.
>
> I tried grepping around but couldn't find this, can you or anyone else
> here point out what API I'm supposed to be using in
> Perl_gv_fetchmethod_pvn_flags to get at these arguments?

I’m not a guts hacker, so maybe I’m guessing+reading this completely
wrong, but as far as I can tell, pp_entersub uses `SP - MARK` to find
out how many things are on the stack when it goes to populate @_.

Question is whether Perl_gv_fetchmethod_pvn_flags can expect to always
be called in a context where the stack has been set up for an impending
call, or does it also get called otherwise? If the latter, then maybe
it’s pp_method_named that needs to look at the stack and pass a flag or
something. Or at least my guess is that the op is more likely only used
in impending-call contexts.

Would be nice if someone who actually knows what they’re talking about
could help you out in my stead, though. :-)

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>

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