https://github.com/python/cpython/commit/2ec50b4a66de6be418bfad058117249d4775df0f
commit: 2ec50b4a66de6be418bfad058117249d4775df0f
branch: main
author: Ken Jin <[email protected]>
committer: Fidget-Spinner <[email protected]>
date: 2024-02-23T23:41:10+08:00
summary:

gh-114058: Improve method information in redundancy eliminator (GH-115848)

files:
M Python/tier2_redundancy_eliminator_bytecodes.c
M Python/tier2_redundancy_eliminator_cases.c.h

diff --git a/Python/tier2_redundancy_eliminator_bytecodes.c 
b/Python/tier2_redundancy_eliminator_bytecodes.c
index ef7b43d53539ce..b9afd3089e1077 100644
--- a/Python/tier2_redundancy_eliminator_bytecodes.c
+++ b/Python/tier2_redundancy_eliminator_bytecodes.c
@@ -296,21 +296,25 @@ dummy_func(void) {
     }
 
     op(_LOAD_ATTR_METHOD_WITH_VALUES, (descr/4, owner -- attr, self if (1))) {
+        (void)descr;
         OUT_OF_SPACE_IF_NULL(attr = sym_new_known_notnull(ctx));
-        OUT_OF_SPACE_IF_NULL(self = sym_new_known_notnull(ctx));
+        self = owner;
     }
 
     op(_LOAD_ATTR_METHOD_NO_DICT, (descr/4, owner -- attr, self if (1))) {
+        (void)descr;
         OUT_OF_SPACE_IF_NULL(attr = sym_new_known_notnull(ctx));
-        OUT_OF_SPACE_IF_NULL(self = sym_new_known_notnull(ctx));
+        self = owner;
     }
 
     op(_LOAD_ATTR_METHOD_LAZY_DICT, (descr/4, owner -- attr, self if (1))) {
+        (void)descr;
         OUT_OF_SPACE_IF_NULL(attr = sym_new_known_notnull(ctx));
-        OUT_OF_SPACE_IF_NULL(self = sym_new_known_notnull(ctx));
+        self = owner;
     }
 
     op(_INIT_CALL_BOUND_METHOD_EXACT_ARGS, (callable, unused, unused[oparg] -- 
func, self, unused[oparg])) {
+        (void)callable;
         OUT_OF_SPACE_IF_NULL(func = sym_new_known_notnull(ctx));
         OUT_OF_SPACE_IF_NULL(self = sym_new_known_notnull(ctx));
     }
diff --git a/Python/tier2_redundancy_eliminator_cases.c.h 
b/Python/tier2_redundancy_eliminator_cases.c.h
index ca9b5953d21012..ca341e4dde5d93 100644
--- a/Python/tier2_redundancy_eliminator_cases.c.h
+++ b/Python/tier2_redundancy_eliminator_cases.c.h
@@ -1305,8 +1305,9 @@
             _Py_UOpsSymType *self = NULL;
             owner = stack_pointer[-1];
             PyObject *descr = (PyObject *)this_instr->operand;
+            (void)descr;
             OUT_OF_SPACE_IF_NULL(attr = sym_new_known_notnull(ctx));
-            OUT_OF_SPACE_IF_NULL(self = sym_new_known_notnull(ctx));
+            self = owner;
             stack_pointer[-1] = attr;
             stack_pointer[0] = self;
             stack_pointer += 1;
@@ -1319,8 +1320,9 @@
             _Py_UOpsSymType *self = NULL;
             owner = stack_pointer[-1];
             PyObject *descr = (PyObject *)this_instr->operand;
+            (void)descr;
             OUT_OF_SPACE_IF_NULL(attr = sym_new_known_notnull(ctx));
-            OUT_OF_SPACE_IF_NULL(self = sym_new_known_notnull(ctx));
+            self = owner;
             stack_pointer[-1] = attr;
             stack_pointer[0] = self;
             stack_pointer += 1;
@@ -1353,8 +1355,9 @@
             _Py_UOpsSymType *self = NULL;
             owner = stack_pointer[-1];
             PyObject *descr = (PyObject *)this_instr->operand;
+            (void)descr;
             OUT_OF_SPACE_IF_NULL(attr = sym_new_known_notnull(ctx));
-            OUT_OF_SPACE_IF_NULL(self = sym_new_known_notnull(ctx));
+            self = owner;
             stack_pointer[-1] = attr;
             stack_pointer[0] = self;
             stack_pointer += 1;
@@ -1380,6 +1383,7 @@
             _Py_UOpsSymType *func;
             _Py_UOpsSymType *self;
             callable = stack_pointer[-2 - oparg];
+            (void)callable;
             OUT_OF_SPACE_IF_NULL(func = sym_new_known_notnull(ctx));
             OUT_OF_SPACE_IF_NULL(self = sym_new_known_notnull(ctx));
             stack_pointer[-2 - oparg] = func;

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to