diff options
author | Mark Shannon <mark@hotpy.org> | 2023-10-31 13:21:07 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-31 13:21:07 (GMT) |
commit | 2904d99839cd4620818fd0556a1c0b0229944abc (patch) | |
tree | 39a1a91ac415017441f0c5c6859f6226f0a5332c /Python/generated_cases.c.h | |
parent | d27acd4461ee603bcf6f4a81ca6afccc9fc87331 (diff) | |
download | cpython-2904d99839cd4620818fd0556a1c0b0229944abc.zip cpython-2904d99839cd4620818fd0556a1c0b0229944abc.tar.gz cpython-2904d99839cd4620818fd0556a1c0b0229944abc.tar.bz2 |
GH-111485: Remove some special cases from the code generator and bytecodes.c (GH-111540)
Diffstat (limited to 'Python/generated_cases.c.h')
-rw-r--r-- | Python/generated_cases.c.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h index 40c8cd8..8b6ebe4 100644 --- a/Python/generated_cases.c.h +++ b/Python/generated_cases.c.h @@ -1090,6 +1090,7 @@ INSTRUCTION_STATS(RAISE_VARARGS); PyObject **args; args = stack_pointer - oparg; + TIER_ONE_ONLY PyObject *cause = NULL, *exc = NULL; switch (oparg) { case 2: @@ -1532,6 +1533,7 @@ PyObject **values; exc = stack_pointer[-1]; values = stack_pointer - 1 - oparg; + TIER_ONE_ONLY assert(oparg >= 0 && oparg <= 2); if (oparg) { PyObject *lasti = values[0]; @@ -1560,6 +1562,7 @@ PyObject *awaitable; exc = stack_pointer[-1]; awaitable = stack_pointer[-2]; + TIER_ONE_ONLY assert(exc && PyExceptionInstance_Check(exc)); if (PyErr_GivenExceptionMatches(exc, PyExc_StopAsyncIteration)) { Py_DECREF(awaitable); @@ -1587,6 +1590,7 @@ exc_value = stack_pointer[-1]; last_sent_val = stack_pointer[-2]; sub_iter = stack_pointer[-3]; + TIER_ONE_ONLY assert(throwflag); assert(exc_value && PyExceptionInstance_Check(exc_value)); if (PyErr_GivenExceptionMatches(exc_value, PyExc_StopIteration)) { @@ -2107,7 +2111,7 @@ PyObject *initial = GETLOCAL(oparg); PyObject *cell = PyCell_New(initial); if (cell == NULL) { - goto resume_with_error; + goto error; } SETLOCAL(oparg, cell); DISPATCH(); @@ -3282,6 +3286,7 @@ PyObject *res; fromlist = stack_pointer[-1]; level = stack_pointer[-2]; + TIER_ONE_ONLY PyObject *name = GETITEM(FRAME_CO_NAMES, oparg); res = import_name(tstate, frame, name, fromlist, level); Py_DECREF(level); @@ -3299,6 +3304,7 @@ PyObject *from; PyObject *res; from = stack_pointer[-1]; + TIER_ONE_ONLY PyObject *name = GETITEM(FRAME_CO_NAMES, oparg); res = import_from(tstate, from, name); if (res == NULL) goto error; @@ -3317,11 +3323,11 @@ TARGET(JUMP_BACKWARD) { _Py_CODEUNIT *this_instr = frame->instr_ptr = next_instr; - next_instr += 1; + next_instr += 2; INSTRUCTION_STATS(JUMP_BACKWARD); CHECK_EVAL_BREAKER(); assert(oparg <= INSTR_OFFSET()); - JUMPBY(1-oparg); + JUMPBY(-oparg); #if ENABLE_SPECIALIZATION this_instr[1].cache += (1 << OPTIMIZER_BITS_IN_COUNTER); if (this_instr[1].cache > tstate->interp->optimizer_backedge_threshold && @@ -3346,6 +3352,7 @@ frame->instr_ptr = next_instr; next_instr += 1; INSTRUCTION_STATS(ENTER_EXECUTOR); + TIER_ONE_ONLY CHECK_EVAL_BREAKER(); PyCodeObject *code = _PyFrame_GetCode(frame); @@ -3890,6 +3897,7 @@ PyObject *exit; PyObject *res; mgr = stack_pointer[-1]; + TIER_ONE_ONLY /* pop the context manager, push its __exit__ and the * value returned from calling its __enter__ */ @@ -5560,10 +5568,10 @@ TARGET(INSTRUMENTED_JUMP_BACKWARD) { _Py_CODEUNIT *this_instr = frame->instr_ptr = next_instr; - next_instr += 1; + next_instr += 2; INSTRUCTION_STATS(INSTRUMENTED_JUMP_BACKWARD); CHECK_EVAL_BREAKER(); - INSTRUMENTED_JUMP(this_instr, next_instr + 1 - oparg, PY_MONITORING_EVENT_JUMP); + INSTRUMENTED_JUMP(this_instr, next_instr - oparg, PY_MONITORING_EVENT_JUMP); DISPATCH(); } |