mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
GH-130415: Optimize constant comparison in JIT builds (GH-131489)
This commit is contained in:
parent
0de5e0c544
commit
b92ee14b80
8 changed files with 142 additions and 35 deletions
24
Python/executor_cases.c.h
generated
24
Python/executor_cases.c.h
generated
|
@ -6925,6 +6925,30 @@
|
|||
break;
|
||||
}
|
||||
|
||||
case _POP_TWO_LOAD_CONST_INLINE_BORROW: {
|
||||
_PyStackRef pop2;
|
||||
_PyStackRef pop1;
|
||||
_PyStackRef value;
|
||||
pop2 = stack_pointer[-1];
|
||||
pop1 = stack_pointer[-2];
|
||||
PyObject *ptr = (PyObject *)CURRENT_OPERAND0();
|
||||
stack_pointer += -1;
|
||||
assert(WITHIN_STACK_BOUNDS());
|
||||
_PyFrame_SetStackPointer(frame, stack_pointer);
|
||||
PyStackRef_CLOSE(pop2);
|
||||
stack_pointer = _PyFrame_GetStackPointer(frame);
|
||||
stack_pointer += -1;
|
||||
assert(WITHIN_STACK_BOUNDS());
|
||||
_PyFrame_SetStackPointer(frame, stack_pointer);
|
||||
PyStackRef_CLOSE(pop1);
|
||||
stack_pointer = _PyFrame_GetStackPointer(frame);
|
||||
value = PyStackRef_FromPyObjectImmortal(ptr);
|
||||
stack_pointer[0] = value;
|
||||
stack_pointer += 1;
|
||||
assert(WITHIN_STACK_BOUNDS());
|
||||
break;
|
||||
}
|
||||
|
||||
case _CHECK_FUNCTION: {
|
||||
uint32_t func_version = (uint32_t)CURRENT_OPERAND0();
|
||||
assert(PyStackRef_FunctionCheck(frame->f_funcobj));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue