Skip to content

Commit 737d23f

Browse files
authored
GH-111485: Mark some instructions as TIER_ONE_ONLY (GH-113155)
1 parent 55ef998 commit 737d23f

File tree

3 files changed

+14
-139
lines changed

3 files changed

+14
-139
lines changed

Python/bytecodes.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,7 @@ dummy_func(
506506
// specializations, but there is no output.
507507
// At the end we just skip over the STORE_FAST.
508508
op(_BINARY_OP_INPLACE_ADD_UNICODE, (unused/1, left, right --)) {
509+
TIER_ONE_ONLY
509510
assert(next_instr->op.code == STORE_FAST);
510511
PyObject **target_local = &GETLOCAL(next_instr->op.arg);
511512
DEOPT_IF(*target_local != left);
@@ -786,6 +787,7 @@ dummy_func(
786787
}
787788

788789
inst(INTERPRETER_EXIT, (retval --)) {
790+
TIER_ONE_ONLY
789791
assert(frame == &entry_frame);
790792
assert(_PyFrame_IsIncomplete(frame));
791793
/* Restore previous frame and return. */
@@ -1072,6 +1074,7 @@ dummy_func(
10721074
}
10731075

10741076
inst(YIELD_VALUE, (retval -- unused)) {
1077+
TIER_ONE_ONLY
10751078
// NOTE: It's important that YIELD_VALUE never raises an exception!
10761079
// The compiler treats any exception raised here as a failed close()
10771080
// or throw() call.
@@ -2297,6 +2300,7 @@ dummy_func(
22972300
}
22982301

22992302
inst(JUMP_FORWARD, (--)) {
2303+
TIER_ONE_ONLY
23002304
JUMPBY(oparg);
23012305
}
23022306

@@ -2402,6 +2406,7 @@ dummy_func(
24022406
macro(POP_JUMP_IF_NOT_NONE) = _IS_NONE + _POP_JUMP_IF_FALSE;
24032407

24042408
inst(JUMP_BACKWARD_NO_INTERRUPT, (--)) {
2409+
TIER_ONE_ONLY
24052410
/* This bytecode is used in the `yield from` or `await` loop.
24062411
* If there is an interrupt, we want it handled in the innermost
24072412
* generator or coroutine, so we deliberately do not check it here.
@@ -3454,6 +3459,7 @@ dummy_func(
34543459

34553460
// This is secretly a super-instruction
34563461
inst(CALL_LIST_APPEND, (unused/1, unused/2, callable, self, args[oparg] -- unused)) {
3462+
TIER_ONE_ONLY
34573463
assert(oparg == 1);
34583464
PyInterpreterState *interp = tstate->interp;
34593465
DEOPT_IF(callable != interp->callable_cache.list_append);
@@ -3792,6 +3798,7 @@ dummy_func(
37923798
}
37933799

37943800
inst(RETURN_GENERATOR, (--)) {
3801+
TIER_ONE_ONLY
37953802
assert(PyFunction_Check(frame->f_funcobj));
37963803
PyFunctionObject *func = (PyFunctionObject *)frame->f_funcobj;
37973804
PyGenObject *gen = (PyGenObject *)_Py_MakeCoro(func);

Python/executor_cases.c.h

Lines changed: 0 additions & 139 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/generated_cases.c.h

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)