Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
6d9b6a2
Refactor specialize_c_call to use helpers
mpage Oct 16, 2024
30e25d2
Refactor specialize_py_call to use helpers
mpage Oct 16, 2024
92160de
Refactor specialize_class_call to use helpers
mpage Oct 16, 2024
4754921
Refactor specialize_method_descriptor to use helpers
mpage Oct 16, 2024
6a20bb0
Remove unneeded code
mpage Oct 16, 2024
ea7206d
Enable almost all specializations of CALL
mpage Oct 17, 2024
d5375f1
Regen files
mpage Oct 18, 2024
a2ca192
Fix implementation of CALL_LIST_APPEND in free-threaded builds
mpage Oct 18, 2024
2ab08f2
Regenerate interpreter and friends
mpage Oct 18, 2024
3534246
Refactor PyType_LookupRef to return version
mpage Oct 22, 2024
acda1c6
Make CALL_ALLOC_AND_ENTER_INIT thread-safe
mpage Oct 24, 2024
fdfa678
Regenerate files
mpage Oct 24, 2024
ad2e15c
Stop the world around assignments to `tstate->eval_frame`
mpage Nov 19, 2024
0003d00
Document restriction on _Py_InitCleanup bytecode
mpage Nov 20, 2024
8ebd331
Undo refactor
mpage Nov 20, 2024
4c1ad6c
Undo workaround for now-fixed cases_generator bug
mpage Nov 20, 2024
57ba52d
Document _PyType_CacheInitForSpecialization
mpage Nov 21, 2024
8ebd73d
Remove unused define
mpage Nov 21, 2024
8651ebe
Enable tests
mpage Nov 21, 2024
4c7837f
Fix warning about unused function on macos
mpage Nov 22, 2024
4b0a850
Merge branch 'main' into gh-115999-tlbc-call
mpage Nov 25, 2024
d8a67c2
Tag workarounds for not deferring nested functions on classes with gh…
mpage Nov 25, 2024
3e8d85e
Use `_PyInterpreterState_SetEvalFrameFunc` when setting / clearing pe…
mpage Nov 25, 2024
de0e2ee
Fix issue with `_CREATE_INIT_FRAME`
mpage Nov 26, 2024
1cb6260
Merge branch 'main' into gh-115999-tlbc-call
mpage Dec 3, 2024
b3aa63c
Use release/acquire for the specialization cache
mpage Dec 3, 2024
6b591c3
Use locking macros instead of helper function
mpage Dec 3, 2024
a5fdc59
Merge branch 'main' into gh-115999-tlbc-call
mpage Dec 3, 2024
bc65932
Merge branch 'main' into gh-115999-tlbc-call
mpage Dec 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Enable almost all specializations of CALL
_CALL_ALLOC_AND_ENTER_INIT will be addressed in a separate PR
  • Loading branch information
mpage committed Nov 20, 2024
commit ea7206d6ba50f5529835195a754681ad0e33bee7
4 changes: 2 additions & 2 deletions Python/bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -3308,15 +3308,15 @@ dummy_func(
};

specializing op(_SPECIALIZE_CALL, (counter/1, callable[1], self_or_null[1], args[oparg] -- callable[1], self_or_null[1], args[oparg])) {
#if ENABLE_SPECIALIZATION
#if ENABLE_SPECIALIZATION_FT
if (ADAPTIVE_COUNTER_TRIGGERS(counter)) {
next_instr = this_instr;
_Py_Specialize_Call(callable[0], next_instr, oparg + !PyStackRef_IsNull(self_or_null[0]));
DISPATCH_SAME_OPARG();
}
OPCODE_DEFERRED_INC(CALL);
ADVANCE_ADAPTIVE_COUNTER(this_instr[1].counter);
#endif /* ENABLE_SPECIALIZATION */
#endif /* ENABLE_SPECIALIZATION_FT */
}

op(_MAYBE_EXPAND_METHOD, (callable[1], self_or_null[1], args[oparg] -- func[1], maybe_self[1], args[oparg])) {
Expand Down
4 changes: 3 additions & 1 deletion Python/specialize.c
Original file line number Diff line number Diff line change
Expand Up @@ -1984,6 +1984,7 @@ specialize_class_call(PyObject *callable, _Py_CODEUNIT *instr, int nargs)
if (Py_TYPE(tp) != &PyType_Type) {
goto generic;
}
#ifndef Py_GIL_DISABLED
if (tp->tp_new == PyBaseObject_Type.tp_new) {
PyFunctionObject *init = get_init_for_simple_managed_python_class(tp);
if (type_get_version(tp, CALL) == 0) {
Expand All @@ -1997,6 +1998,7 @@ specialize_class_call(PyObject *callable, _Py_CODEUNIT *instr, int nargs)
return;
}
}
#endif
generic:
specialize(instr, CALL_NON_PY_GENERAL);
}
Expand Down Expand Up @@ -2159,7 +2161,7 @@ _Py_Specialize_Call(_PyStackRef callable_st, _Py_CODEUNIT *instr, int nargs)
{
PyObject *callable = PyStackRef_AsPyObjectBorrow(callable_st);

assert(ENABLE_SPECIALIZATION);
assert(ENABLE_SPECIALIZATION_FT);
assert(_PyOpcode_Caches[CALL] == INLINE_CACHE_ENTRIES_CALL);
assert(_Py_OPCODE(*instr) != INSTRUMENTED_CALL);
if (PyCFunction_CheckExact(callable)) {
Expand Down