10000 gh-114058: More robust method handling in redundancy eliminator by Fidget-Spinner · Pull Request #115779 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-114058: More robust method handling in redundancy eliminator #115779

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 3 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
8000
Diff view
Diff view
1 change: 1 addition & 0 deletions Python/optimizer_analysis.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ sym_new_known_notnull(_Py_UOpsAbstractInterpContext *ctx)
if (res == NULL) {
return NULL;
}
sym_set_flag(res, KNOWN);
sym_set_flag(res, NOT_NULL);
return res;
}
Expand Down
21 changes: 21 additions & 0 deletions Python/tier2_redundancy_eliminator_bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,27 @@ dummy_func(void) {
(void)owner;
}

op(_LOAD_ATTR_METHOD_WITH_VALUES, (descr/4, owner -- attr, self if (1))) {
OUT_OF_SPACE_IF_NULL(attr = sym_new_known_notnull(ctx));
OUT_OF_SPACE_IF_NULL(self = sym_new_known_notnull(ctx));
}

op(_LOAD_ATTR_METHOD_NO_DICT, (descr/4, owner -- attr, self if (1))) {
OUT_OF_SPACE_IF_NULL(attr = sym_new_known_notnull(ctx));
OUT_OF_SPACE_IF_NULL(self = sym_new_known_notnull(ctx));
}

op(_LOAD_ATTR_METHOD_LAZY_DICT, (descr/4, owner -- attr, self if (1))) {
OUT_OF_SPACE_IF_NULL(attr = sym_new_known_notnull(ctx));
OUT_OF_SPACE_IF_NULL(self = sym_new_known_notnull(ctx));
}

op(_INIT_CALL_BOUND_METHOD_EXACT_ARGS, (callable, unused, unused[oparg] -- func, self, unused[oparg])) {
OUT_OF_SPACE_IF_NULL(func = sym_new_known_notnull(ctx));
OUT_OF_SPACE_IF_NULL(self = sym_new_known_notnull(ctx));
}


op(_CHECK_FUNCTION_EXACT_ARGS, (func_version/2, callable, self_or_null, unused[oparg] -- callable, self_or_null, unused[oparg])) {
sym_set_type(callable, &PyFunction_Type);
(void)self_or_null;
Expand Down
35 changes: 19 additions & 16 deletions Python/tier2_redundancy_eliminator_cases.c.h

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

0