Skip to content

Commit 625ecbe

Browse files
authored
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.
1 parent a376a72 commit 625ecbe

File tree

5 files changed

+36
-63
lines changed

5 files changed

+36
-63
lines changed

Include/internal/pycore_opcode_metadata.h

+32-39
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/abstract_interp_cases.c.h

-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/bytecodes.c

+2-8
Original file line numberDiff line numberDiff line change
@@ -2038,7 +2038,7 @@ dummy_func(
20382038

20392039
macro(STORE_ATTR_INSTANCE_VALUE) =
20402040
unused/1 +
2041-
_GUARD_TYPE_VERSION_STORE +
2041+
_GUARD_TYPE_VERSION +
20422042
_GUARD_DORV_VALUES +
20432043
_STORE_ATTR_INSTANCE_VALUE;
20442044

@@ -2083,12 +2083,6 @@ dummy_func(
20832083
Py_DECREF(owner);
20842084
}
20852085

2086-
op(_GUARD_TYPE_VERSION_STORE, (type_version/2, owner -- owner)) {
2087-
PyTypeObject *tp = Py_TYPE(owner);
2088-
assert(type_version != 0);
2089-
DEOPT_IF(tp->tp_version_tag != type_version);
2090-
}
2091-
20922086
op(_STORE_ATTR_SLOT, (index/1, value, owner --)) {
20932087
char *addr = (char *)owner + index;
20942088
STAT_INC(STORE_ATTR, hit);
@@ -2100,7 +2094,7 @@ dummy_func(
21002094

21012095
macro(STORE_ATTR_SLOT) =
21022096
unused/1 +
2103-
_GUARD_TYPE_VERSION_STORE +
2097+
_GUARD_TYPE_VERSION +
21042098
_STORE_ATTR_SLOT;
21052099

21062100
family(COMPARE_OP, INLINE_CACHE_ENTRIES_COMPARE_OP) = {

Python/executor_cases.c.h

-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/generated_cases.c.h

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)