-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
gh-134584: Eliminate redundant refcounting from TO_BOOL_STR
#143417
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
a0895de
dfbd0c2
6c83c72
a439ed5
92bdb2a
2a96e82
be2c3fb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
TO_BOOL_STR
Signed-off-by: Manjusaka <[email protected]>
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Eliminate redundant refcounting from ``TO_BOOL_STR``. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -431,8 +431,9 @@ dummy_func(void) { | |
| sym_set_type(value, &PyUnicode_Type); | ||
| } | ||
|
|
||
| op(_TO_BOOL_STR, (value -- res)) { | ||
| op(_TO_BOOL_STR, (value -- res, v)) { | ||
| int already_bool = optimize_to_bool(this_instr, ctx, value, &res); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This optimization is broken because the stack effect changed, You need to fix So
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can do this change, as it's a little more complex
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the suggestion! TIL I may need a little bit time to update the patch(lol
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
If this is possible, I would like to make this change!
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure!
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have complete the code on my local branch, not push. Because I have some issue about this part I think the patch, I will use For now, I add a tier2 op named
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah just copy the op over |
||
| v = value; | ||
| if (!already_bool) { | ||
| res = sym_new_truthiness(ctx, value, true); | ||
| } | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.