Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
GH-112354:END_FOR instruction to only pop one value.#114247
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
…TOP instead of END_FOR. To support tier 2 side exits in loops.
gvanrossum commentedJan 18, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
EDIT: Never mind, it's needed for instrumentation. |
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.
Looks good, never mind my premature commend about END_FOR/POP_TOP.
| string=&_Py_ID(alias); | ||
| assert(_PyUnicode_CheckConsistency(string,1)); | ||
| _PyUnicode_InternInPlace(interp,&string); |
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.
(The updates to this file (and a few other generated files) are spurious and will disappear after merging the latest main.)
The benchmarks show no performance impact. |
That's evidently not clear. The order of the |
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.
Thanks!
Oh, fun stuff. Windows compilation error. :-( |
Misc/NEWS.d/next/Core and Builtins/2024-01-17-05-09-32.gh-issue-112354.Run9ko.rstShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
…GH-114247)* Compiler emits END_FOR; POP_TOP instead of END_FOR. To support tier 2 side exits in loops.
…GH-114247)* Compiler emits END_FOR; POP_TOP instead of END_FOR. To support tier 2 side exits in loops.
Uh oh!
There was an error while loading.Please reload this page.
In order to support tier 2 side-exits from
FOR_ITERvariants, we need a target that has the same stack as the exhaustion guard.Currently we can either jump to the
END_FOR, as we do for generators or the instruction afterwards, which we do forFOR_ITER.In order to exit a guard we need a target in between those instructions, that pops the iterator, but not the value.
The compiler emits END_FOR; POP_TOP instead of END_FOR.
Previously:
Now: