mirror of
https://github.com/python/cpython.git
synced 2026-04-14 15:50:50 +00:00
gh-145866: Convert _CALL_INTRINSIC_2 to leave its inputs on the stack to be cleaned up by _POP_TOP (GH-146262)
This commit is contained in:
parent
495178ab05
commit
f5364ae750
10 changed files with 1346 additions and 1283 deletions
24
Python/executor_cases.c.h
generated
24
Python/executor_cases.c.h
generated
|
|
@ -7386,12 +7386,14 @@
|
|||
break;
|
||||
}
|
||||
|
||||
case _CALL_INTRINSIC_2_r21: {
|
||||
case _CALL_INTRINSIC_2_r23: {
|
||||
CHECK_CURRENT_CACHED_VALUES(2);
|
||||
assert(WITHIN_STACK_BOUNDS_IGNORING_CACHE());
|
||||
_PyStackRef value1_st;
|
||||
_PyStackRef value2_st;
|
||||
_PyStackRef res;
|
||||
_PyStackRef vs1;
|
||||
_PyStackRef vs2;
|
||||
_PyStackRef _stack_item_0 = _tos_cache0;
|
||||
_PyStackRef _stack_item_1 = _tos_cache1;
|
||||
oparg = CURRENT_OPARG();
|
||||
|
|
@ -7406,26 +7408,20 @@
|
|||
ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
|
||||
_PyFrame_SetStackPointer(frame, stack_pointer);
|
||||
PyObject *res_o = _PyIntrinsics_BinaryFunctions[oparg].func(tstate, value2, value1);
|
||||
_PyStackRef tmp = value1_st;
|
||||
value1_st = PyStackRef_NULL;
|
||||
stack_pointer[-1] = value1_st;
|
||||
PyStackRef_CLOSE(tmp);
|
||||
tmp = value2_st;
|
||||
value2_st = PyStackRef_NULL;
|
||||
stack_pointer[-2] = value2_st;
|
||||
PyStackRef_CLOSE(tmp);
|
||||
stack_pointer = _PyFrame_GetStackPointer(frame);
|
||||
stack_pointer += -2;
|
||||
ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
|
||||
if (res_o == NULL) {
|
||||
SET_CURRENT_CACHED_VALUES(0);
|
||||
JUMP_TO_ERROR();
|
||||
}
|
||||
res = PyStackRef_FromPyObjectSteal(res_o);
|
||||
vs1 = value1_st;
|
||||
vs2 = value2_st;
|
||||
_tos_cache2 = vs2;
|
||||
_tos_cache1 = vs1;
|
||||
_tos_cache0 = res;
|
||||
_tos_cache1 = PyStackRef_ZERO_BITS;
|
||||
_tos_cache2 = PyStackRef_ZERO_BITS;
|
||||
SET_CURRENT_CACHED_VALUES(1);
|
||||
SET_CURRENT_CACHED_VALUES(3);
|
||||
stack_pointer += -2;
|
||||
ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
|
||||
assert(WITHIN_STACK_BOUNDS_IGNORING_CACHE());
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue