Uh oh!
There was an error while loading. Please reload this page.
GH-98831: Remove all remaining DISPATCH() calls from bytecodes.c - #99271
Conversation
Also mark those opcodes that have no stack effect as such.
gvanrossum
commented
Nov 10, 2022
@brandtbucher When you have the benchmark results can you just post them here? So Mark won't have to ask for them. |
brandtbucher
commented
Nov 10, 2022
Here you go: Details |
| /* Use BASIC_PUSH as NULL is not a valid object pointer */ | ||
| BASIC_PUSH(NULL); | ||
| inst(PUSH_NULL, (-- res)) { | ||
| res = NULL; |
There was a problem hiding this comment.
I feel that this ought to fail, as we should have NULL checks in debug mode.
There was a problem hiding this comment.
Yeah, but we never had those. In debug mode we check for stack overflow/underflow but not for NULL-ness. (Of course the NULL will wreak havoc if it gets popped by the wrong opcode, bu that's also nothing new.) The code generator still checks for stack over/underflow by calling STACK_SHRINK()/GROW(), so nothing is really changed.
There was a problem hiding this comment.
Once we have typed stack effects, we can auto-generate those sorts of assertions. That would be really nice.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| PUSH(Py_NewRef(next)); | ||
| JUMPBY(INLINE_CACHE_ENTRIES_FOR_ITER); | ||
| DISPATCH(); | ||
| goto end_for_iter_list; // End of this instruction |
There was a problem hiding this comment.
Yeah, I'm really counting on the compiler to optimize this for us.
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
python#99271) Also mark those opcodes that have no stack effect as such. Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
python#99271) Also mark those opcodes that have no stack effect as such. Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
Also mark those opcodes that have no stack effect as such (
inst(FOO)->inst(FOO, (--))).