8000 gh-104909: Split more LOAD_ATTR specializations by gvanrossum · Pull Request #110317 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-104909: Split more LOAD_ATTR specializations #110317

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Oct 4, 2023
Prev Previous commit
Next Next commit
Split LOAD_ATTR_CLASS
  • Loading branch information
gvanrossum committed Oct 3, 2023
commit a45d86148b027c922ea18d709f8103906f34db54
83 changes: 49 additions & 34 deletions Include/internal/pycore_opcode_metadata.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions Python/abstract_interp_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 13 additions & 6 deletions Python/bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1967,20 +1967,27 @@ dummy_func(
_LOAD_ATTR_SLOT + // NOTE: This action may also deopt
unused/5;

inst(LOAD_ATTR_CLASS, (unused/1, type_version/2, unused/2, descr/4, owner -- attr, null if (oparg & 1))) {

op(_CHECK_ATTR_CLASS, (type_version/2, owner -- owner)) {
DEOPT_IF(!PyType_Check(owner));
DEOPT_IF(((PyTypeObject *)owner)->tp_version_tag != type_version);
assert(type_version != 0);
DEOPT_IF(((PyTypeObject *)owner)->tp_version_tag != type_version);

}

op(_LOAD_ATTR_CLASS, (descr/4, owner -- attr, null if (oparg & 1))) {
STAT_INC(LOAD_ATTR, hit);
assert(descr != NULL);
attr = Py_NewRef(descr);
null = NULL;
attr = descr;
assert(attr != NULL);
Py_INCREF(attr);
DECREF_INPUTS();
}

macro(LOAD_ATTR_CLASS) =
unused/1 +
_CHECK_ATTR_CLASS +
unused/2 +
_LOAD_ATTR_CLASS;

inst(LOAD_ATTR_PROPERTY, (unused/1, type_version/2, func_version/2, fget/4, owner -- unused, unused if (0))) {
assert((oparg & 1) == 0);
DEOPT_IF(tstate->interp->eval_frame);
Expand Down
27 changes: 27 additions & 0 deletions Python/executor_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 14 additions & 11 deletions Python/generated_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0