Implement compile-time-eval for functions called with named arguments #10831
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In #10811 I disabled compile-time-eval for function calls with named
arguments because it was completely unsupported and thus would therefore
crash or give semantically wrong results. This patch undoes the
disabling and implements the necessary components to support CTE for
named arguments.
Since named arguments are a bit of a special case for the VM, I also had
to add some special handling for the SCCP pass. I also had to tweak how
the call removal code worked such that the named arguments, which are
not in num_args, are also removed, as well as the CHECK_UNDEF_ARGS
opline.
Unfortunately this is a bit convoluted because the named params need special handling.
There's probably some room for cleanup by using inline functions or macros though, although maybe that's too invasive anyway? Not sure...
EDIT: OK I need to debug this further, sad that I can't repro the crash locally, but I have some clues. I'm almost out of time for today so that'll have to happen tomorrow... I'll let yo know when it's actually ready for reviewReady for review now