Perl_op_convert_list - only short circuit CONST OPs with an IsCOW SV #23296
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.
Currently, a CONST OP's SV will not have the
IsCOW
flag set if the PV buffer was truncated such that it is too small to be COWed. In which case, not short circutingPerl_op_convert_list
causes the OP to undergo constant folding, resulting in a CONST OP with an SV that can participate in COW.This means that the commit which introduced the short-circuit for CONST OPs accidentally introduced a performance regression:
a902d92
This commit adds an additional check to ensure that short circuiting does not happen when the CONST OP SV cannot be COWed. This is a short term workaround given the proximity to the next stable release. #23290 seems like the more appropriate fix, but is a bigger change, so will be held until the next development cycle.