mirror of
https://github.com/Perl/perl5.git
synced 2026-01-26 16:39:36 +00:00
Creates a new UNOP_AUX op type, `OP_MULTIPARAM`, that handles all of the
initial behaviour of assigning values to parameters of a subroutine
signature out of values passed by the caller. This is created in a
similar style to other multi-ops like `OP_MULTIDEREF` and
`OP_MULTICONCAT` where the op's aux structure contains a sub-program of
sorts, which describes all of the small details of operation.
Also adds a LOGOP, `OP_PARAMTEST` and UNOP `OP_PARAMSTORE` which are
responsible for implementing the default expressions of optional
parameters. These use the `SvPADSTALE` flag set on pad lexicals used as
parameters to remember whether assignment has happened, ensuring that
missing vs present-but-undef can be detected in a way that does not
depend on counting arguments on the stack.
This change is carefully designed to support two future ideas:
* Named parameters as per PPC0024
https://github.com/Perl/PPCs/blob/main/ppcs/ppc0024-signature-named-parameters.md
* "no-snails"; the performance optimisation that avoids storing
incoming argument values in the `@_` AV and instead consumes them
directly from the stack