gh-131798: constant fold classmethod and staticmethod in JIT#148331
gh-131798: constant fold classmethod and staticmethod in JIT#148331kumaraditya303 wants to merge 5 commits intopython:mainfrom
Conversation
|
This can be done for class lookups as well so things like |
|
I don't see any change in deltablue, but that's because it's using |
This turned out to be harder than I thought, because it would fold the classmethod descriptor into a unbound method lookup rather than a bound one, which changes the following CALL_BOUND_METHOD_EXACT_ARGS in the trace. |
|
The outer else doesn't set |
| assert(callable); | ||
| bool immortal = _Py_IsImmortal(callable) || (type->tp_flags & Py_TPFLAGS_IMMUTABLETYPE); | ||
| ADD_OP(_GUARD_TYPE_VERSION, 0, type->tp_version_tag); | ||
| ADD_OP(_POP_TOP, 0, 0); |
There was a problem hiding this comment.
| ADD_OP(_POP_TOP, 0, 0); | |
| optimize_pop_top(ctx, this_instr, owner); |
That shouldn't be a problem for It would make sense for If we special case |
Working on that. |
Script used for benchmark: