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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
perldebguts documents that the lines stored in @{"_<$filename"}
arrays have a numeric value in addition to the text of the source,
ensure that is true for evals.
Non-zero IV values indicate the lines are breakable (they represent
the address of the COP for that line)
This set of changes requires a perldelta entry, and it is included.
SV * const tmpstr = newSV_type(SVt_PVMG);
t = (const char *)memchr(s, '\n', send - s);
if (t)
t++;
else
t = send;
sv_setpvn_fresh(tmpstr, s, t - s);
/* not breakable until we compile a COP for it */
SvIV_set(tmpstr, 0);
Improvement, why is this code using SVt_PVMG and not the smaller PVIV body struct?
git blame shows Larry typed in "PVMG" for unknown reasons
STATIC void
S_save_lines(pTHX_ AV *array, SV *sv)
{
const char *s = SvPVX_const(sv);
const char * const send = SvPVX_const(sv) + SvCUR(sv);
I32 line = 1;
while (s && s < send) {
const char *t;
SV * const tmpstr = newSV(0);
sv_upgrade(tmpstr, SVt_PVMG);
t = strchr(s, '\n');
if (t)
t++;
perldebguts documents that the lines stored in @{"_<$filename"}
arrays have a numeric value in addition to the text of the source,
ensure that is true for evals.
Non-zero IV values indicate the lines are breakable (they represent
the address of the COP for that line)
FixesPerl#23151
These were saved as PVMG but as bulk88 suggested in
Perl#23171 (comment)
we only need PVIV, since the source lines don't need magic,
aren't blessed and store an integer, not an NV.
So create them as PVIV instead.
If it turns out we do need PVMG instead for some future use, simply
remove the test added here, it's simply to confirm we don't need
PVMG here.
The reason will be displayed to describe this comment to others. Learn more.
Unroll SvUPGRADE(), add {} to SvPVCLEAR(sv);, add 2 goto skipping if(!SvPOK(sv)) test and jump right into the branch, if was < SVt_PV or we did a newSV_type(SVt_PVIV);. We know the SV* is undef and/or doesn't have POK_on, so we can skip the if(!SvPOK(sv)) conditional jump CPU opcode/opcodes.
These were saved as PVMG but as bulk88 suggested in
#23171 (comment)
we only need PVIV, since the source lines don't need magic,
aren't blessed and store an integer, not an NV.
So create them as PVIV instead.
If it turns out we do need PVMG instead for some future use, simply
remove the test added here, it's simply to confirm we don't need
PVMG here.
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.
perldebguts documents that the lines stored in @{"_<$filename"}
arrays have a numeric value in addition to the text of the source,
ensure that is true for evals.
Non-zero IV values indicate the lines are breakable (they represent
the address of the COP for that line)