Skip to content

Commit

Permalink
remove unused types
Browse files Browse the repository at this point in the history
  • Loading branch information
Fidget-Spinner committed Feb 8, 2024
1 parent 9a9033f commit 710f609
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions Python/optimizer_analysis.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,11 @@
* `PYFLOAT_TYPE`: `Py_TYPE(val) == &PyFloat_Type`
* `PYUNICODE_TYPE`: `Py_TYPE(val) == &PYUNICODE_TYPE`
* `NULL_TYPE`: `val == NULL`
* `GUARD_TYPE_VERSION_TYPE`: `type->tp_version_tag == auxillary`
* `GUARD_DORV_VALUES_TYPE`: `_PyDictOrValues_IsValues(obj)`
* `GUARD_KEYS_VERSION_TYPE`: `owner_heap_type->ht_cached_keys->dk_version == auxillary`
* `PYMETHOD_TYPE`: `Py_TYPE(val) == &PyMethod_Type`
* `PYFUNCTION_TYPE_VERSION_TYPE`:
`PyFunction_Check(callable) && func->func_version == auxillary && code->co_argcount == oparg + (self_or_null != NULL)`
`PyFunction_Check(callable) && code->co_argcount == oparg + (self_or_null != NULL)`
*/
typedef enum {
// Types with refinement info
GUARD_KEYS_VERSION_TYPE = 0,
GUARD_TYPE_VERSION_TYPE = 1,
// You might think this actually needs to encode oparg
// info as well, see _CHECK_FUNCTION_EXACT_ARGS.
// However, since oparg is tied to code object is tied to function version,
Expand All @@ -87,7 +81,6 @@ typedef enum {
PYUNICODE_TYPE = 5,
NULL_TYPE = 6,
PYMETHOD_TYPE = 7,
GUARD_DORV_VALUES_TYPE = 8,
NOT_NULL = 9,

// Represents something from LOAD_CONST which is truly constant.
Expand Down Expand Up @@ -342,9 +335,6 @@ sym_set_type_from_const(_Py_UOpsSymType *sym, PyObject *obj)
{
PyTypeObject *tp = Py_TYPE(obj);

if (tp->tp_version_tag != 0) {
sym_set_type(sym, GUARD_TYPE_VERSION_TYPE);
}
if (tp == &PyFunction_Type) {
sym_set_type(sym, PYFUNCTION_TYPE_VERSION_TYPE);
}
Expand Down

0 comments on commit 710f609

Please sign in to comment.