mirror of
https://github.com/python/cpython.git
synced 2025-07-08 03:45:36 +00:00
GH-112354: END_FOR
instruction to only pop one value. (GH-114247)
* Compiler emits END_FOR; POP_TOP instead of END_FOR. To support tier 2 side exits in loops.
This commit is contained in:
parent
6fadd68da5
commit
981d172f7f
16 changed files with 238 additions and 184 deletions
|
@ -572,9 +572,10 @@ top: // Jump here after _PUSH_FRAME or likely branches
|
|||
uop = _PyUOp_Replacements[uop];
|
||||
assert(uop != 0);
|
||||
if (uop == _FOR_ITER_TIER_TWO) {
|
||||
target += 1 + INLINE_CACHE_ENTRIES_FOR_ITER + oparg + 1 + extended;
|
||||
assert(_PyCode_CODE(code)[target-1].op.code == END_FOR ||
|
||||
_PyCode_CODE(code)[target-1].op.code == INSTRUMENTED_END_FOR);
|
||||
target += 1 + INLINE_CACHE_ENTRIES_FOR_ITER + oparg + 2 + extended;
|
||||
assert(_PyCode_CODE(code)[target-2].op.code == END_FOR ||
|
||||
_PyCode_CODE(code)[target-2].op.code == INSTRUMENTED_END_FOR);
|
||||
assert(_PyCode_CODE(code)[target-1].op.code == POP_TOP);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue