You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The last few commits have moved the looking-up and processing of
typemap entries (but not the evalling) for parameters from
Param::as_input_code() and Param::as_output_code() into their
own subs, lookup_input_typemap() and lookup_output_typemap().
This commit takes that one step further, and makes those new subs be
called at parse time, rather than at code-generation time.
This is needed because in principle, XSUB ASTs should be completely
self-contained, and the code they emit shouldn't vary depending on when
their top-level as_code() methods are called. But via the
TYPEMAP: <<EOF
mechanism, its possible for the typemap to change between XSUBs.
This commit does this in a very crude way. Formerly, at code-emitting
time, as_input_code() etc would do:
my ($foo, $bar, ...) = lookup_input_typemap(...);
Now, the parsing code does
$self->{input_typemap_vals} = [ lookup_input_typemap(...) ];
and as_input_code() etc does:
my ($foo, $bar, ...) = @{$self->{input_typemap_vals}};
Note that there are both output_typemap_vals and
output_typemap_vals_outlist fields, as it's possible for the same
parameter to be used both for updating the original arg (OUTPUT) and for
returning the current value as a new SV (OUTLIST). So potentially we
save the results of *two* calls to lookup_output_typemap() for each
parameter.
0 commit comments