develooper Front page | perl.perl5.porters | Postings from December 2021

Re: "no snails"; or having signatured subs complain about @_

Thread Previous | Thread Next
From:
Dave Mitchell
Date:
December 9, 2021 17:47
Subject:
Re: "no snails"; or having signatured subs complain about @_
Message ID:
YbJBJU5gKrqgFYJ2@iabyn.com
On Thu, Dec 09, 2021 at 05:36:06PM +0000, Paul "LeoNerd" Evans wrote:
> Currently (from pp.c), pp_argelem encodes the index of @_ in its op_aux
> pointer, so it can simply
> 
>     svp = av_fetch(defav, ix, FALSE);
> 
> In the "read directly from the stack" world, I can imagine it would
> 
>     svp = &PL_stack_base[ ??? ];
> 
> for some offset - how would it determine that?

Some off the top of my head suggestions:

* Don't pop the MARK until the end - pop it at the same time as popping
  all the args.

* store the index in padsv[0] - i.e. treat PL_curpad[0] as a union holding
  a pointer to an AV, or holding a I32 (or whatever type stack offsets are
  these days)

* store the index in the SUB context frame


-- 
It's not that I'm afraid to die, I just don't want to be there when it
happens.
    -- Woody Allen

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