GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||
GeezerVison is showing github.com — gh-98831: Modernize the FOR_ITER family of instructions by gvanrossum · Pull Request #101626 · python/cpython Conversation
|
| if (it->it_index < PyList_GET_SIZE(seq)) { | ||
| PyObject *next = PyList_GET_ITEM(seq, it->it_index++); | ||
| PUSH(Py_NewRef(next)); | ||
| JUMPBY(INLINE_CACHE_ENTRIES_FOR_ITER); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I'm a little confused, why do we not need to JUMPBY INLINE_CACHE_ENTRIES_FOR_ITER anymore?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I think this is the JUMPBY(1); in line 2688.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Ahh right. I forgot that the inline cache entries for FOR_ITER is just the counter. Thanks Irit!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| FOR_ITER_GEN, | ||
| }; | ||
|
|
||
| inst(FOR_ITER, (unused/1, iter -- iter, next)) { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Should this be counter/1 instead of unused/1, and then the counter used in the body?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
In all cases where the counter is manipulated using ADAPTIVE_COUNTER_IS_ZERO / DECREMENT_ADAPTIVE_COUNTER I'm leaving this idiom unchanged -- the generator won't let you write back to cache entries, so it would become asymmetrical, and the common case is DECREMENT_ADAPTIVE_COUNTER anyway.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Co-authored-by: Irit Katriel <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.