Skip to content

Commit 8b73d0d

Browse files
committed
Rename YIELD_FROM_LOOP to JUMP_NO_INTERRUPT: describe what it does, not where it might be used.
1 parent c2b141e commit 8b73d0d

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

Include/opcode.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Lib/opcode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def jabs_op(name, op):
155155
def_op('RAISE_VARARGS', 130) # Number of raise arguments (1, 2, or 3)
156156
def_op('MAKE_FUNCTION', 132) # Flags
157157
def_op('BUILD_SLICE', 133) # Number of items
158-
jabs_op('YIELD_FROM_LOOP', 134) # Target byte offset from beginning of code
158+
jabs_op('JUMP_NO_INTERRUPT', 134) # Target byte offset from beginning of code
159159
def_op('MAKE_CELL', 135)
160160
hasfree.append(135)
161161
def_op('LOAD_CLOSURE', 136)

Objects/frameobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ mark_stacks(PyCodeObject *code_obj, int len)
242242
break;
243243
}
244244
case JUMP_ABSOLUTE:
245-
case YIELD_FROM_LOOP:
245+
case JUMP_NO_INTERRUPT:
246246
j = get_arg(code, i);
247247
assert(j < len);
248248
if (stacks[j] == UNINITIALIZED && j < i) {

Python/ceval.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4111,7 +4111,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr
41114111
DISPATCH();
41124112
}
41134113

4114-
TARGET(YIELD_FROM_LOOP) {
4114+
TARGET(JUMP_NO_INTERRUPT) {
41154115
frame->f_state = FRAME_EXECUTING;
41164116
JUMPTO(oparg);
41174117
DISPATCH();

Python/compile.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,7 @@ stack_effect(int opcode, int oparg, int jump)
969969
/* Jumps */
970970
case JUMP_FORWARD:
971971
case JUMP_ABSOLUTE:
972-
case YIELD_FROM_LOOP:
972+
case JUMP_NO_INTERRUPT:
973973
return 0;
974974

975975
case JUMP_IF_TRUE_OR_POP:
@@ -1845,7 +1845,7 @@ compiler_add_yield_from(struct compiler *c, int await)
18451845
ADDOP_JUMP(c, SEND, exit);
18461846
compiler_use_next_block(c, resume);
18471847
ADDOP_I(c, RESUME, await ? 3 : 2);
1848-
ADDOP_JUMP(c, YIELD_FROM_LOOP, start);
1848+
ADDOP_JUMP(c, JUMP_NO_INTERRUPT, start);
18491849
compiler_use_next_block(c, exit);
18501850
return 1;
18511851
}
@@ -7056,7 +7056,7 @@ stackdepth(struct compiler *c)
70567056
}
70577057
depth = new_depth;
70587058
if (instr->i_opcode == JUMP_ABSOLUTE ||
7059-
instr->i_opcode == YIELD_FROM_LOOP ||
7059+
instr->i_opcode == JUMP_NO_INTERRUPT ||
70607060
instr->i_opcode == JUMP_FORWARD ||
70617061
instr->i_opcode == RETURN_VALUE ||
70627062
instr->i_opcode == RAISE_VARARGS ||
@@ -8812,7 +8812,7 @@ normalize_basic_block(basicblock *bb) {
88128812
break;
88138813
case JUMP_ABSOLUTE:
88148814
case JUMP_FORWARD:
8815-
case YIELD_FROM_LOOP:
8815+
case JUMP_NO_INTERRUPT:
88168816
bb->b_nofallthrough = 1;
88178817
/* fall through */
88188818
case POP_JUMP_IF_NOT_NONE:
@@ -8997,7 +8997,7 @@ optimize_cfg(struct compiler *c, struct assembler *a, PyObject *consts)
89978997
if (b->b_iused > 0) {
89988998
struct instr *b_last_instr = &b->b_instr[b->b_iused - 1];
89998999
if (b_last_instr->i_opcode == JUMP_ABSOLUTE ||
9000-
b_last_instr->i_opcode == YIELD_FROM_LOOP ||
9000+
b_last_instr->i_opcode == JUMP_NO_INTERRUPT ||
90019001
b_last_instr->i_opcode == JUMP_FORWARD) {
90029002
if (b_last_instr->i_target == b->b_next) {
90039003
assert(b->b_next->b_iused);

Python/opcode_targets.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)