Skip to content

Commit b3e16a4

Browse files
committed
Split LOAD_ATTR_NONDESCRIPTOR_NO_DICT
1 parent ea0e772 commit b3e16a4

File tree

5 files changed

+68
-30
lines changed

5 files changed

+68
-30
lines changed

Include/internal/pycore_opcode_metadata.h

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

Python/abstract_interp_cases.c.h

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

Python/bytecodes.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2865,18 +2865,21 @@ dummy_func(
28652865
_GUARD_KEYS_VERSION +
28662866
_LOAD_ATTR_NONDESCRIPTOR_WITH_VALUES;
28672867

2868-
inst(LOAD_ATTR_NONDESCRIPTOR_NO_DICT, (unused/1, type_version/2, unused/2, descr/4, owner -- attr, unused if (0))) {
2868+
op(_LOAD_ATTR_NONDESCRIPTOR_NO_DICT, (descr/4, owner -- attr, unused if (0))) {
28692869
assert((oparg & 1) == 0);
2870-
PyTypeObject *owner_cls = Py_TYPE(owner);
2871-
assert(type_version != 0);
2872-
DEOPT_IF(owner_cls->tp_version_tag != type_version);
2873-
assert(owner_cls->tp_dictoffset == 0);
2870+
assert(Py_TYPE(owner)->tp_dictoffset == 0);
28742871
STAT_INC(LOAD_ATTR, hit);
28752872
assert(descr != NULL);
28762873
DECREF_INPUTS();
28772874
attr = Py_NewRef(descr);
28782875
}
28792876

2877+
macro(LOAD_ATTR_NONDESCRIPTOR_NO_DICT) =
2878+
unused/1 +
2879+
_GUARD_TYPE_VERSION +
2880+
unused/2 +
2881+
_LOAD_ATTR_NONDESCRIPTOR_NO_DICT;
2882+
28802883
op(_CHECK_ATTR_METHOD_LAZY_DICT, (owner -- owner)) {
28812884
Py_ssize_t dictoffset = Py_TYPE(owner)->tp_dictoffset;
28822885
assert(dictoffset > 0);

Python/executor_cases.c.h

Lines changed: 15 additions & 0 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: 17 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)