mirror of
https://github.com/python/cpython.git
synced 2025-07-09 20:35:26 +00:00
GH-111848: Convert remaining jumps to deopts into tier 2 code. (GH-112045)
This commit is contained in:
parent
b11c443bb2
commit
a519b87958
7 changed files with 194 additions and 139 deletions
36
Python/generated_cases.c.h
generated
36
Python/generated_cases.c.h
generated
|
@ -3435,22 +3435,6 @@
|
|||
goto enter_tier_one;
|
||||
}
|
||||
|
||||
TARGET(POP_JUMP_IF_FALSE) {
|
||||
_Py_CODEUNIT *this_instr = frame->instr_ptr = next_instr;
|
||||
next_instr += 2;
|
||||
INSTRUCTION_STATS(POP_JUMP_IF_FALSE);
|
||||
PyObject *cond;
|
||||
cond = stack_pointer[-1];
|
||||
assert(PyBool_Check(cond));
|
||||
int flag = Py_IsFalse(cond);
|
||||
#if ENABLE_SPECIALIZATION
|
||||
this_instr[1].cache = (this_instr[1].cache << 1) | flag;
|
||||
#endif
|
||||
JUMPBY(oparg * flag);
|
||||
STACK_SHRINK(1);
|
||||
DISPATCH();
|
||||
}
|
||||
|
||||
TARGET(POP_JUMP_IF_TRUE) {
|
||||
_Py_CODEUNIT *this_instr = frame->instr_ptr = next_instr;
|
||||
next_instr += 2;
|
||||
|
@ -3467,6 +3451,22 @@
|
|||
DISPATCH();
|
||||
}
|
||||
|
||||
TARGET(POP_JUMP_IF_FALSE) {
|
||||
_Py_CODEUNIT *this_instr = frame->instr_ptr = next_instr;
|
||||
next_instr += 2;
|
||||
INSTRUCTION_STATS(POP_JUMP_IF_FALSE);
|
||||
PyObject *cond;
|
||||
cond = stack_pointer[-1];
|
||||
assert(PyBool_Check(cond));
|
||||
int flag = Py_IsFalse(cond);
|
||||
#if ENABLE_SPECIALIZATION
|
||||
this_instr[1].cache = (this_instr[1].cache << 1) | flag;
|
||||
#endif
|
||||
JUMPBY(oparg * flag);
|
||||
STACK_SHRINK(1);
|
||||
DISPATCH();
|
||||
}
|
||||
|
||||
TARGET(POP_JUMP_IF_NONE) {
|
||||
_Py_CODEUNIT *this_instr = frame->instr_ptr = next_instr;
|
||||
next_instr += 2;
|
||||
|
@ -3485,7 +3485,7 @@
|
|||
Py_DECREF(value);
|
||||
}
|
||||
}
|
||||
// POP_JUMP_IF_TRUE
|
||||
// _POP_JUMP_IF_TRUE
|
||||
cond = b;
|
||||
{
|
||||
assert(PyBool_Check(cond));
|
||||
|
@ -3517,7 +3517,7 @@
|
|||
Py_DECREF(value);
|
||||
}
|
||||
}
|
||||
// POP_JUMP_IF_FALSE
|
||||
// _POP_JUMP_IF_FALSE
|
||||
cond = b;
|
||||
{
|
||||
assert(PyBool_Check(cond));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue