aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/executor_cases.c.h
diff options
context:
space:
mode:
Diffstat (limited to 'Python/executor_cases.c.h')
-rw-r--r--Python/executor_cases.c.h42
1 files changed, 20 insertions, 22 deletions
diff --git a/Python/executor_cases.c.h b/Python/executor_cases.c.h
index 662e050c5c4..c1829717e49 100644
--- a/Python/executor_cases.c.h
+++ b/Python/executor_cases.c.h
@@ -5788,35 +5788,31 @@
break;
}
- case _CALL_LEN: {
- _PyStackRef *args;
- _PyStackRef self_or_null;
+ case _GUARD_CALLABLE_LEN: {
_PyStackRef callable;
- _PyStackRef res;
- oparg = CURRENT_OPARG();
- args = &stack_pointer[-oparg];
- self_or_null = stack_pointer[-1 - oparg];
- callable = stack_pointer[-2 - oparg];
+ callable = stack_pointer[-3];
PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
- int total_args = oparg;
- if (!PyStackRef_IsNull(self_or_null)) {
- args--;
- total_args++;
- }
- if (total_args != 1) {
- UOP_STAT_INC(uopcode, miss);
- JUMP_TO_JUMP_TARGET();
- }
PyInterpreterState *interp = tstate->interp;
if (callable_o != interp->callable_cache.len) {
UOP_STAT_INC(uopcode, miss);
JUMP_TO_JUMP_TARGET();
}
+ break;
+ }
+
+ case _CALL_LEN: {
+ _PyStackRef arg;
+ _PyStackRef null;
+ _PyStackRef callable;
+ _PyStackRef res;
+ arg = stack_pointer[-1];
+ null = stack_pointer[-2];
+ callable = stack_pointer[-3];
+ (void)null;
STAT_INC(CALL, hit);
- _PyStackRef arg_stackref = args[0];
- PyObject *arg = PyStackRef_AsPyObjectBorrow(arg_stackref);
+ PyObject *arg_o = PyStackRef_AsPyObjectBorrow(arg);
_PyFrame_SetStackPointer(frame, stack_pointer);
- Py_ssize_t len_i = PyObject_Length(arg);
+ Py_ssize_t len_i = PyObject_Length(arg_o);
stack_pointer = _PyFrame_GetStackPointer(frame);
if (len_i < 0) {
JUMP_TO_ERROR();
@@ -5826,10 +5822,12 @@
if (res_o == NULL) {
JUMP_TO_ERROR();
}
+ stack_pointer += -1;
+ assert(WITHIN_STACK_BOUNDS());
_PyFrame_SetStackPointer(frame, stack_pointer);
- PyStackRef_CLOSE(arg_stackref);
+ PyStackRef_CLOSE(arg);
stack_pointer = _PyFrame_GetStackPointer(frame);
- stack_pointer += -2 - oparg;
+ stack_pointer += -2;
assert(WITHIN_STACK_BOUNDS());
_PyFrame_SetStackPointer(frame, stack_pointer);
PyStackRef_CLOSE(callable);