aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/bytecodes.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2024-08-23 10:22:35 +0100
committerGitHub <noreply@github.com>2024-08-23 10:22:35 +0100
commit5d3201fe3f76aeba33e9e5956ba80a116e422bd0 (patch)
tree5a8abea53010c9412558274a88ccb9226171b007 /Python/bytecodes.c
parent90b6d0e0f8f07d7443695e14a18488cb499d3b4d (diff)
downloadcpython-5d3201fe3f76aeba33e9e5956ba80a116e422bd0.tar.gz
cpython-5d3201fe3f76aeba33e9e5956ba80a116e422bd0.zip
GH-123040: Specialize shadowed `LOAD_ATTR`. (GH-123219)
Diffstat (limited to 'Python/bytecodes.c')
-rw-r--r--Python/bytecodes.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/Python/bytecodes.c b/Python/bytecodes.c
index bc418137a9f..62f6853fedf 100644
--- a/Python/bytecodes.c
+++ b/Python/bytecodes.c
@@ -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,
@@ -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))) {
@@ -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));