- Notifications
You must be signed in to change notification settings - Fork587
eval: ensure debugging saved lines have an IV part#23171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
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
|
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 representthe address of the COP for that line)FixesPerl#23151
These were saved as PVMG but as bulk88 suggested inPerl#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, simplyremove the test added here, it's simply to confirm we don't needPVMG here.
Good point, I've added changing from PVMG to PVIV. |
Fixes#23151 |
else { | ||
sv = *av_fetch(av, 0, 1); | ||
SvUPGRADE(sv,SVt_PVMG); | ||
SvUPGRADE(sv,SVt_PVIV); | ||
} | ||
if (!SvPOK(sv)) SvPVCLEAR(sv); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
UnrollSvUPGRADE()
, add{}
toSvPVCLEAR(sv);
, add 2goto
skippingif(!SvPOK(sv))
test and jump right into the branch, if was< SVt_PV
or we did anewSV_type(SVt_PVIV);
. We know the SV* is undef and/or doesn't havePOK_on
, so we can skip theif(!SvPOK(sv))
conditional jump CPU opcode/opcodes.
a707dec
intoPerl:bleadUh oh!
There was an error while loading.Please reload this page.
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, simplyremove the test added here, it's simply to confirm we don't needPVMG here.
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)