mirror of
https://github.com/python/cpython.git
synced 2025-08-24 02:35:59 +00:00
GH-128375: Better instrument for FOR_ITER
(GH-128445)
This commit is contained in:
parent
b9c693dcca
commit
f826beca0c
27 changed files with 827 additions and 544 deletions
|
@ -409,7 +409,7 @@ codegen_addop_j(instr_sequence *seq, location loc,
|
|||
if (_PyInstructionSequence_Addop(seq, opcode, target.id, loc) != SUCCESS) {
|
||||
return ERROR;
|
||||
}
|
||||
if (IS_CONDITIONAL_JUMP_OPCODE(opcode) || opcode == FOR_ITER) {
|
||||
if (IS_CONDITIONAL_JUMP_OPCODE(opcode)) {
|
||||
return _PyInstructionSequence_Addop(seq, NOT_TAKEN, 0, NO_LOCATION);
|
||||
}
|
||||
return SUCCESS;
|
||||
|
@ -2018,7 +2018,7 @@ codegen_for(compiler *c, stmt_ty s)
|
|||
* but a non-generator will jump to a later instruction.
|
||||
*/
|
||||
ADDOP(c, NO_LOCATION, END_FOR);
|
||||
ADDOP(c, NO_LOCATION, POP_TOP);
|
||||
ADDOP(c, NO_LOCATION, POP_ITER);
|
||||
|
||||
_PyCompile_PopFBlock(c, COMPILE_FBLOCK_FOR_LOOP, start);
|
||||
|
||||
|
@ -4283,7 +4283,7 @@ codegen_sync_comprehension_generator(compiler *c, location loc,
|
|||
* but a non-generator will jump to a later instruction.
|
||||
*/
|
||||
ADDOP(c, NO_LOCATION, END_FOR);
|
||||
ADDOP(c, NO_LOCATION, POP_TOP);
|
||||
ADDOP(c, NO_LOCATION, POP_ITER);
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue