diff options
author | Ken Jin <kenjin@python.org> | 2024-02-23 07:42:03 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-23 07:42:03 (GMT) |
commit | a33ffe4785f90f68227ddf2ec3e06d5ceaf76cec (patch) | |
tree | 941f62dd34527cf4208ad9c319cc8f2fd7582d9e /Python/tier2_redundancy_eliminator_cases.c.h | |
parent | a494a3dd8e0e74861972698c37b14a4087a4688c (diff) | |
download | cpython-a33ffe4785f90f68227ddf2ec3e06d5ceaf76cec.zip cpython-a33ffe4785f90f68227ddf2ec3e06d5ceaf76cec.tar.gz cpython-a33ffe4785f90f68227ddf2ec3e06d5ceaf76cec.tar.bz2 |
gh-114058: More robust method handling in redundancy eliminator (GH-115779)
Diffstat (limited to 'Python/tier2_redundancy_eliminator_cases.c.h')
-rw-r--r-- | Python/tier2_redundancy_eliminator_cases.c.h | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/Python/tier2_redundancy_eliminator_cases.c.h b/Python/tier2_redundancy_eliminator_cases.c.h index 58c11b7..ca9b595 100644 --- a/Python/tier2_redundancy_eliminator_cases.c.h +++ b/Python/tier2_redundancy_eliminator_cases.c.h @@ -1300,12 +1300,13 @@ } case _LOAD_ATTR_METHOD_WITH_VALUES: { + _Py_UOpsSymType *owner; _Py_UOpsSymType *attr; _Py_UOpsSymType *self = NULL; - attr = sym_new_unknown(ctx); - if (attr == NULL) goto out_of_space; - self = sym_new_unknown(ctx); - if (self == NULL) goto out_of_space; + owner = stack_pointer[-1]; + PyObject *descr = (PyObject *)this_instr->operand; + OUT_OF_SPACE_IF_NULL(attr = sym_new_known_notnull(ctx)); + OUT_OF_SPACE_IF_NULL(self = sym_new_known_notnull(ctx)); stack_pointer[-1] = attr; stack_pointer[0] = self; stack_pointer += 1; @@ -1313,12 +1314,13 @@ } case _LOAD_ATTR_METHOD_NO_DICT: { + _Py_UOpsSymType *owner; _Py_UOpsSymType *attr; _Py_UOpsSymType *self = NULL; - attr = sym_new_unknown(ctx); - if (attr == NULL) goto out_of_space; - self = sym_new_unknown(ctx); - if (self == NULL) goto out_of_space; + owner = stack_pointer[-1]; + PyObject *descr = (PyObject *)this_instr->operand; + OUT_OF_SPACE_IF_NULL(attr = sym_new_known_notnull(ctx)); + OUT_OF_SPACE_IF_NULL(self = sym_new_known_notnull(ctx)); stack_pointer[-1] = attr; stack_pointer[0] = self; stack_pointer += 1; @@ -1346,12 +1348,13 @@ } case _LOAD_ATTR_METHOD_LAZY_DICT: { + _Py_UOpsSymType *owner; _Py_UOpsSymType *attr; _Py_UOpsSymType *self = NULL; - attr = sym_new_unknown(ctx); - if (attr == NULL) goto out_of_space; - self = sym_new_unknown(ctx); - if (self == NULL) goto out_of_space; + owner = stack_pointer[-1]; + PyObject *descr = (PyObject *)this_instr->operand; + OUT_OF_SPACE_IF_NULL(attr = sym_new_known_notnull(ctx)); + OUT_OF_SPACE_IF_NULL(self = sym_new_known_notnull(ctx)); stack_pointer[-1] = attr; stack_pointer[0] = self; stack_pointer += 1; @@ -1373,12 +1376,12 @@ } case _INIT_CALL_BOUND_METHOD_EXACT_ARGS: { + _Py_UOpsSymType *callable; _Py_UOpsSymType *func; _Py_UOpsSymType *self; - func = sym_new_unknown(ctx); - if (func == NULL) goto out_of_space; - self = sym_new_unknown(ctx); - if (self == NULL) goto out_of_space; + callable = stack_pointer[-2 - oparg]; + 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; stack_pointer[-1 - oparg] = self; break; |