aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/optimizer_cases.c.h
diff options
context:
space:
mode:
Diffstat (limited to 'Python/optimizer_cases.c.h')
-rw-r--r--Python/optimizer_cases.c.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/Python/optimizer_cases.c.h b/Python/optimizer_cases.c.h
index 8e8b2ecfa5b..a9bb67d9605 100644
--- a/Python/optimizer_cases.c.h
+++ b/Python/optimizer_cases.c.h
@@ -2065,11 +2065,22 @@
break;
}
+ case _GUARD_CALLABLE_LEN: {
+ JitOptSymbol *callable;
+ callable = stack_pointer[-3];
+ PyObject *len = _PyInterpreterState_GET()->callable_cache.len;
+ if (sym_get_const(ctx, callable) == len) {
+ REPLACE_OP(this_instr, _NOP, 0, 0);
+ }
+ sym_set_const(callable, len);
+ break;
+ }
+
case _CALL_LEN: {
JitOptSymbol *res;
res = sym_new_type(ctx, &PyLong_Type);
- stack_pointer[-2 - oparg] = res;
- stack_pointer += -1 - oparg;
+ stack_pointer[-3] = res;
+ stack_pointer += -2;
assert(WITHIN_STACK_BOUNDS());
break;
}