https://github.com/python/cpython/commit/1795d6cebaee07f30804d490fa90e3e516dfed79
commit: 1795d6cebaee07f30804d490fa90e3e516dfed79
branch: main
author: Mark Shannon <[email protected]>
committer: brandtbucher <[email protected]>
date: 2024-08-12T10:35:52-07:00
summary:
GH-122869: Add missing tier two optimizer cases (GH-122936)
files:
M Python/optimizer_bytecodes.c
M Python/optimizer_cases.c.h
diff --git a/Python/optimizer_bytecodes.c b/Python/optimizer_bytecodes.c
index c982e37182157a..010733e6ac221a 100644
--- a/Python/optimizer_bytecodes.c
+++ b/Python/optimizer_bytecodes.c
@@ -329,6 +329,13 @@ dummy_func(void) {
}
}
+ op(_BINARY_SUBSCR_INIT_CALL, (container, sub -- new_frame:
_Py_UOpsAbstractFrame *)) {
+ (void)container;
+ (void)sub;
+ new_frame = NULL;
+ ctx->done = true;
+ }
+
op(_TO_BOOL, (value -- res)) {
if (!optimize_to_bool(this_instr, ctx, value, &res)) {
res = sym_new_type(ctx, &PyBool_Type);
@@ -538,6 +545,13 @@ dummy_func(void) {
self = owner;
}
+ op(_LOAD_ATTR_PROPERTY_FRAME, (fget/4, owner -- new_frame:
_Py_UOpsAbstractFrame *)) {
+ (void)fget;
+ (void)owner;
+ new_frame = NULL;
+ ctx->done = true;
+ }
+
op(_INIT_CALL_BOUND_METHOD_EXACT_ARGS, (callable, unused, unused[oparg] --
func, self, unused[oparg])) {
(void)callable;
func = sym_new_not_null(ctx);
diff --git a/Python/optimizer_cases.c.h b/Python/optimizer_cases.c.h
index 50aa9728cf2939..3f4080d164506e 100644
--- a/Python/optimizer_cases.c.h
+++ b/Python/optimizer_cases.c.h
@@ -544,8 +544,15 @@
}
case _BINARY_SUBSCR_INIT_CALL: {
- _PyInterpreterFrame *new_frame;
- new_frame = sym_new_not_null(ctx);
+ _Py_UopsSymbol *sub;
+ _Py_UopsSymbol *container;
+ _Py_UOpsAbstractFrame *new_frame;
+ sub = stack_pointer[-1];
+ container = stack_pointer[-2];
+ (void)container;
+ (void)sub;
+ new_frame = NULL;
+ ctx->done = true;
stack_pointer[-2] = (_Py_UopsSymbol *)new_frame;
stack_pointer += -1;
assert(WITHIN_STACK_BOUNDS());
@@ -1172,8 +1179,14 @@
}
case _LOAD_ATTR_PROPERTY_FRAME: {
- _PyInterpreterFrame *new_frame;
- new_frame = sym_new_not_null(ctx);
+ _Py_UopsSymbol *owner;
+ _Py_UOpsAbstractFrame *new_frame;
+ owner = stack_pointer[-1];
+ PyObject *fget = (PyObject *)this_instr->operand;
+ (void)fget;
+ (void)owner;
+ new_frame = NULL;
+ ctx->done = true;
stack_pointer[-1] = (_Py_UopsSymbol *)new_frame;
break;
}
_______________________________________________
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]