Skip to content

Commit b57948e

Browse files
committed
Remove resume_with_error label
1 parent c3ae5c9 commit b57948e

File tree

5 files changed

+14
-22
lines changed

5 files changed

+14
-22
lines changed

Python/bytecodes.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5303,14 +5303,11 @@ dummy_func(
53035303
tstate->c_recursion_remaining += PY_EVAL_C_STACK_UNITS;
53045304
return NULL;
53055305
}
5306-
goto resume_with_error;
5307-
}
5308-
5309-
label(resume_with_error) {
53105306
next_instr = frame->instr_ptr;
53115307
stack_pointer = _PyFrame_GetStackPointer(frame);
53125308
goto error;
53135309
}
5310+
53145311
// END BYTECODES //
53155312

53165313
}
@@ -5320,7 +5317,6 @@ dummy_func(
53205317
exit_unwind:
53215318
handle_eval_breaker:
53225319
resume_frame:
5323-
resume_with_error:
53245320
start_frame:
53255321
unbound_local_error:
53265322
;

Python/ceval.c

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,11 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
792792
return NULL;
793793
}
794794

795+
/* Local "register" variables.
796+
* These are cached values from the frame and code object. */
797+
_Py_CODEUNIT *next_instr;
798+
_PyStackRef *stack_pointer;
799+
795800
#if defined(Py_DEBUG) && !defined(Py_STACKREF_DEBUG)
796801
/* Set these to invalid but identifiable values for debugging. */
797802
entry_frame.f_funcobj = (_PyStackRef){.bits = 0xaaa0};
@@ -838,15 +843,11 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
838843
#endif
839844
_Py_Instrument(_PyFrame_GetCode(frame), tstate->interp);
840845
monitor_throw(tstate, frame, frame->instr_ptr);
841-
/* TO DO -- Monitor throw entry. */
842-
goto resume_with_error;
846+
next_instr = frame->instr_ptr;
847+
stack_pointer = _PyFrame_GetStackPointer(frame);
848+
goto error;
843849
}
844850

845-
/* Local "register" variables.
846-
* These are cached values from the frame and code object. */
847-
_Py_CODEUNIT *next_instr;
848-
_PyStackRef *stack_pointer;
849-
850851
#if defined(_Py_TIER2) && !defined(_Py_JIT)
851852
/* Tier 2 interpreter state */
852853
_PyExecutorObject *current_executor = NULL;
@@ -983,10 +984,10 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
983984
OPT_HIST(trace_uop_execution_counter, trace_run_length_hist);
984985
assert(next_uop[-1].format == UOP_FORMAT_TARGET);
985986
frame->return_offset = 0; // Don't leave this random
986-
_PyFrame_SetStackPointer(frame, stack_pointer);
987987
Py_DECREF(current_executor);
988988
tstate->previous_executor = NULL;
989-
goto resume_with_error;
989+
next_instr = frame->instr_ptr;
990+
goto error;
990991

991992
jump_to_jump_target:
992993
assert(next_uop[-1].format == UOP_FORMAT_JUMP);

Python/ceval_macros.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,9 @@ do { \
381381
tstate->previous_executor = NULL; \
382382
frame = tstate->current_frame; \
383383
if (next_instr == NULL) { \
384-
goto resume_with_error; \
384+
next_instr = frame->instr_ptr; \
385+
stack_pointer = _PyFrame_GetStackPointer(frame); \
386+
goto error; \
385387
} \
386388
stack_pointer = _PyFrame_GetStackPointer(frame); \
387389
DISPATCH(); \

Python/generated_cases.c.h

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

Tools/cases_generator/analyzer.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,6 @@ def has_error_with_pop(op: parser.InstDef) -> bool:
511511
variable_used(op, "ERROR_IF")
512512
or variable_used(op, "pop_1_error")
513513
or variable_used(op, "exception_unwind")
514-
or variable_used(op, "resume_with_error")
515514
)
516515

517516

@@ -520,7 +519,6 @@ def has_error_without_pop(op: parser.InstDef) -> bool:
520519
variable_used(op, "ERROR_NO_POP")
521520
or variable_used(op, "pop_1_error")
522521
or variable_used(op, "exception_unwind")
523-
or variable_used(op, "resume_with_error")
524522
)
525523

526524

0 commit comments

Comments
 (0)