Skip to content

Commit

Permalink
pythonGH-123040: Specialize shadowed LOAD_ATTR. (pythonGH-123219)
Browse files Browse the repository at this point in the history
  • Loading branch information
markshannon authored Aug 23, 2024
1 parent 90b6d0e commit 5d3201f
Show file tree
Hide file tree
Showing 7 changed files with 334 additions and 201 deletions.
9 changes: 8 additions & 1 deletion Include/internal/pycore_opcode_metadata.h

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

63 changes: 32 additions & 31 deletions Include/opcode_ids.h

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

64 changes: 33 additions & 31 deletions Lib/_opcode_metadata.py

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

8 changes: 7 additions & 1 deletion Python/bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1936,6 +1936,7 @@ dummy_func(
LOAD_ATTR_WITH_HINT,
LOAD_ATTR_SLOT,
LOAD_ATTR_CLASS,
LOAD_ATTR_CLASS_WITH_METACLASS_CHECK,
LOAD_ATTR_PROPERTY,
LOAD_ATTR_GETATTRIBUTE_OVERRIDDEN,
LOAD_ATTR_METHOD_WITH_VALUES,
Expand Down Expand Up @@ -2119,7 +2120,6 @@ dummy_func(
EXIT_IF(!PyType_Check(owner_o));
assert(type_version != 0);
EXIT_IF(((PyTypeObject *)owner_o)->tp_version_tag != type_version);

}

split op(_LOAD_ATTR_CLASS, (descr/4, owner -- attr, null if (oparg & 1))) {
Expand All @@ -2136,6 +2136,12 @@ dummy_func(
unused/2 +
_LOAD_ATTR_CLASS;

macro(LOAD_ATTR_CLASS_WITH_METACLASS_CHECK) =
unused/1 +
_CHECK_ATTR_CLASS +
_GUARD_TYPE_VERSION +
_LOAD_ATTR_CLASS;

op(_LOAD_ATTR_PROPERTY_FRAME, (fget/4, owner -- new_frame: _PyInterpreterFrame *)) {
assert((oparg & 1) == 0);
assert(Py_IS_TYPE(fget, &PyFunction_Type));
Expand Down
41 changes: 41 additions & 0 deletions Python/generated_cases.c.h

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

2 changes: 1 addition & 1 deletion Python/opcode_targets.h

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

Loading

0 comments on commit 5d3201f

Please sign in to comment.