mirror of
https://github.com/python/cpython.git
synced 2025-09-02 06:57:58 +00:00
Normalize jumps in compiler. All forward jumps to use JUMP_FORWARD. (GH-28755)
This commit is contained in:
parent
c379bc5ec9
commit
f6eafe18c0
3 changed files with 37 additions and 14 deletions
|
@ -4051,19 +4051,18 @@ check_eval_breaker:
|
|||
|
||||
TARGET(JUMP_ABSOLUTE) {
|
||||
PREDICTED(JUMP_ABSOLUTE);
|
||||
if (oparg < INSTR_OFFSET()) {
|
||||
/* Increment the warmup counter and quicken if warm enough
|
||||
* _Py_Quicken is idempotent so we don't worry about overflow */
|
||||
if (!PyCodeObject_IsWarmedUp(co)) {
|
||||
PyCodeObject_IncrementWarmup(co);
|
||||
if (PyCodeObject_IsWarmedUp(co)) {
|
||||
if (_Py_Quicken(co)) {
|
||||
goto error;
|
||||
}
|
||||
int nexti = INSTR_OFFSET();
|
||||
first_instr = co->co_firstinstr;
|
||||
next_instr = first_instr + nexti;
|
||||
assert(oparg < INSTR_OFFSET());
|
||||
/* Increment the warmup counter and quicken if warm enough
|
||||
* _Py_Quicken is idempotent so we don't worry about overflow */
|
||||
if (!PyCodeObject_IsWarmedUp(co)) {
|
||||
PyCodeObject_IncrementWarmup(co);
|
||||
if (PyCodeObject_IsWarmedUp(co)) {
|
||||
if (_Py_Quicken(co)) {
|
||||
goto error;
|
||||
}
|
||||
int nexti = INSTR_OFFSET();
|
||||
first_instr = co->co_firstinstr;
|
||||
next_instr = first_instr + nexti;
|
||||
}
|
||||
}
|
||||
JUMPTO(oparg);
|
||||
|
@ -4072,6 +4071,7 @@ check_eval_breaker:
|
|||
}
|
||||
|
||||
TARGET(JUMP_ABSOLUTE_QUICK) {
|
||||
assert(oparg < INSTR_OFFSET());
|
||||
JUMPTO(oparg);
|
||||
CHECK_EVAL_BREAKER();
|
||||
DISPATCH();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue