Skip to content

Commit 8757207

Browse files
Allow __slots__ specialization
1 parent d61542b commit 8757207

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

Include/internal/pycore_uop_metadata.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/bytecodes.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3765,13 +3765,13 @@ dummy_func(
37653765
DEOPT_IF(!PyType_Check(callable_o));
37663766
PyTypeObject *tp = (PyTypeObject *)callable_o;
37673767
DEOPT_IF(FT_ATOMIC_LOAD_UINT32_RELAXED(tp->tp_version_tag) != type_version);
3768-
assert(tp->tp_flags & Py_TPFLAGS_INLINE_VALUES);
3768+
assert(tp->tp_flags & Py_TPFLAGS_HEAPTYPE);
37693769
PyHeapTypeObject *cls = (PyHeapTypeObject *)callable_o;
37703770
PyFunctionObject *init_func = (PyFunctionObject *)FT_ATOMIC_LOAD_PTR_ACQUIRE(cls->_spec_cache.init);
37713771
PyCodeObject *code = (PyCodeObject *)init_func->func_code;
37723772
DEOPT_IF(!_PyThreadState_HasStackSpace(tstate, code->co_framesize + _Py_InitCleanup.co_framesize));
37733773
STAT_INC(CALL, hit);
3774-
PyObject *self_o = _PyType_NewManagedObject(tp);
3774+
PyObject *self_o = PyType_GenericAlloc(tp, 0);
37753775
if (self_o == NULL) {
37763776
ERROR_NO_POP();
37773777
}

Python/executor_cases.c.h

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/generated_cases.c.h

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/specialize.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2002,10 +2002,6 @@ get_init_for_simple_managed_python_class(PyTypeObject *tp, unsigned int *tp_vers
20022002
return NULL;
20032003
}
20042004
unsigned long tp_flags = PyType_GetFlags(tp);
2005-
if ((tp_flags & Py_TPFLAGS_INLINE_VALUES) == 0) {
2006-
SPECIALIZATION_FAIL(CALL, SPEC_FAIL_CALL_INIT_NOT_INLINE_VALUES);
2007-
return NULL;
2008-
}
20092005
if (!(tp_flags & Py_TPFLAGS_HEAPTYPE)) {
20102006
/* Is this possible? */
20112007
SPECIALIZATION_FAIL(CALL, SPEC_FAIL_EXPECTED_ERROR);

0 commit comments

Comments
 (0)