diff options
| author | Guido van Rossum <guido@python.org> | 2023-10-03 22:37:21 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-03 22:37:21 (GMT) |
| commit | 625ecbe92eb69d2850c2e6dbe9538e9b1a098baa (patch) | |
| tree | 95234975fc8ce7118483dc5ced844d5d4827fd1a /Python | |
| parent | a376a72bd92cd7c9930467dd1aba40045fb75e3b (diff) | |
| download | cpython-625ecbe92eb69d2850c2e6dbe9538e9b1a098baa.zip cpython-625ecbe92eb69d2850c2e6dbe9538e9b1a098baa.tar.gz cpython-625ecbe92eb69d2850c2e6dbe9538e9b1a098baa.tar.bz2 | |
gh-109979: Unify _GUARD_TYPE_VERSION{,_STORE} (#110301)
Now the target for `DEOPT_IF()` is auto-filled,
we don't need a separate `_GUARD_TYPE_VERSION_STORE` uop.
Diffstat (limited to 'Python')
| -rw-r--r-- | Python/abstract_interp_cases.c.h | 4 | ||||
| -rw-r--r-- | Python/bytecodes.c | 10 | ||||
| -rw-r--r-- | Python/executor_cases.c.h | 10 | ||||
| -rw-r--r-- | Python/generated_cases.c.h | 4 |
4 files changed, 4 insertions, 24 deletions
diff --git a/Python/abstract_interp_cases.c.h b/Python/abstract_interp_cases.c.h index 61b1db9..e98f764 100644 --- a/Python/abstract_interp_cases.c.h +++ b/Python/abstract_interp_cases.c.h @@ -490,10 +490,6 @@ break; } - case _GUARD_TYPE_VERSION_STORE: { - break; - } - case _STORE_ATTR_SLOT: { STACK_SHRINK(2); break; diff --git a/Python/bytecodes.c b/Python/bytecodes.c index 035629d..08f8081 100644 --- a/Python/bytecodes.c +++ b/Python/bytecodes.c @@ -2038,7 +2038,7 @@ dummy_func( macro(STORE_ATTR_INSTANCE_VALUE) = unused/1 + - _GUARD_TYPE_VERSION_STORE + + _GUARD_TYPE_VERSION + _GUARD_DORV_VALUES + _STORE_ATTR_INSTANCE_VALUE; @@ -2083,12 +2083,6 @@ dummy_func( Py_DECREF(owner); } - op(_GUARD_TYPE_VERSION_STORE, (type_version/2, owner -- owner)) { - PyTypeObject *tp = Py_TYPE(owner); - assert(type_version != 0); - DEOPT_IF(tp->tp_version_tag != type_version); - } - op(_STORE_ATTR_SLOT, (index/1, value, owner --)) { char *addr = (char *)owner + index; STAT_INC(STORE_ATTR, hit); @@ -2100,7 +2094,7 @@ dummy_func( macro(STORE_ATTR_SLOT) = unused/1 + - _GUARD_TYPE_VERSION_STORE + + _GUARD_TYPE_VERSION + _STORE_ATTR_SLOT; family(COMPARE_OP, INLINE_CACHE_ENTRIES_COMPARE_OP) = { diff --git a/Python/executor_cases.c.h b/Python/executor_cases.c.h index 662de57..bbdc508 100644 --- a/Python/executor_cases.c.h +++ b/Python/executor_cases.c.h @@ -1761,16 +1761,6 @@ break; } - case _GUARD_TYPE_VERSION_STORE: { - PyObject *owner; - owner = stack_pointer[-1]; - uint32_t type_version = (uint32_t)operand; - PyTypeObject *tp = Py_TYPE(owner); - assert(type_version != 0); - DEOPT_IF(tp->tp_version_tag != type_version, _GUARD_TYPE_VERSION_STORE); - break; - } - case _STORE_ATTR_SLOT: { PyObject *owner; PyObject *value; diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h index 96d9d9d..c616d03 100644 --- a/Python/generated_cases.c.h +++ b/Python/generated_cases.c.h @@ -2616,7 +2616,7 @@ TARGET(STORE_ATTR_INSTANCE_VALUE) { PyObject *owner; PyObject *value; - // _GUARD_TYPE_VERSION_STORE + // _GUARD_TYPE_VERSION owner = stack_pointer[-1]; { uint32_t type_version = read_u32(&next_instr[1].cache); @@ -2705,7 +2705,7 @@ TARGET(STORE_ATTR_SLOT) { PyObject *owner; PyObject *value; - // _GUARD_TYPE_VERSION_STORE + // _GUARD_TYPE_VERSION owner = stack_pointer[-1]; { uint32_t type_version = read_u32(&next_instr[1].cache); |
