Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

GH-115816: Make tier2 optimizer symbols testable, and add a few tests. #115953

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 10 commits into from
Feb 27, 2024
Merged
Prev Previous commit
Add missing underscore
  • Loading branch information
markshannon committed Feb 22, 2024
commit 91ad8abda9d7cd5edc580e47fe7e50a978ae1b5c
2 changes: 1 addition & 1 deletion 2 Include/internal/pycore_optimizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ extern bool _Py_uop_sym_is_not_null(_Py_UOpsSymType *sym);
extern bool _Py_uop_sym_is_const(_Py_UOpsSymType *sym);
extern PyObject *_Py_uop_sym_get_const(_Py_UOpsSymType *sym);
extern _Py_UOpsSymType *_Py_uop_sym_new_unknown(_Py_UOpsAbstractInterpContext *ctx);
extern _Py_UOpsSymType *_Py_uop_sym_new_notnull(_Py_UOpsAbstractInterpContext *ctx);
extern _Py_UOpsSymType *_Py_uop_sym_new_not_null(_Py_UOpsAbstractInterpContext *ctx);
extern _Py_UOpsSymType *_Py_uop_sym_new_type(
_Py_UOpsAbstractInterpContext *ctx, PyTypeObject *typ);
extern _Py_UOpsSymType *_Py_uop_sym_new_const(_Py_UOpsAbstractInterpContext *ctx, PyObject *const_val);
Expand Down
2 changes: 1 addition & 1 deletion 2 Python/optimizer_analysis.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ remove_globals(_PyInterpreterFrame *frame, _PyUOpInstruction *buffer,

#define _LOAD_ATTR_NOT_NULL \
do { \
OUT_OF_SPACE_IF_NULL(attr = _Py_uop_sym_new_notnull(ctx)); \
OUT_OF_SPACE_IF_NULL(attr = _Py_uop_sym_new_not_null(ctx)); \
OUT_OF_SPACE_IF_NULL(null = _Py_uop_sym_new_null(ctx)); \
} while (0);

Expand Down
12 changes: 6 additions & 6 deletions 12 Python/optimizer_bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ dummy_func(void) {
}
if (attr == NULL) {
/* No conversion made. We don't know what `attr` is. */
OUT_OF_SPACE_IF_NULL(attr = _Py_uop_sym_new_notnull(ctx));
OUT_OF_SPACE_IF_NULL(attr = _Py_uop_sym_new_not_null(ctx));
}
}

Expand All @@ -297,26 +297,26 @@ dummy_func(void) {

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

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

op(_LOAD_ATTR_METHOD_LAZY_DICT, (descr/4, owner -- attr, self if (1))) {
(void)descr;
OUT_OF_SPACE_IF_NULL(attr = _Py_uop_sym_new_notnull(ctx));
OUT_OF_SPACE_IF_NULL(attr = _Py_uop_sym_new_not_null(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 = _Py_uop_sym_new_notnull(ctx));
OUT_OF_SPACE_IF_NULL(self = _Py_uop_sym_new_notnull(ctx));
OUT_OF_SPACE_IF_NULL(func = _Py_uop_sym_new_not_null(ctx));
OUT_OF_SPACE_IF_NULL(self = _Py_uop_sym_new_not_null(ctx));
}


Expand Down
12 changes: 6 additions & 6 deletions 12 Python/optimizer_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 2 Python/optimizer_symbols.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ _Py_uop_sym_new_unknown(_Py_UOpsAbstractInterpContext *ctx)
}

_Py_UOpsSymType *
_Py_uop_sym_new_notnull(_Py_UOpsAbstractInterpContext *ctx)
_Py_uop_sym_new_not_null(_Py_UOpsAbstractInterpContext *ctx)
{
_Py_UOpsSymType *res = _Py_uop_sym_new_unknown(ctx);
if (res == NULL) {
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.