summaryrefslogtreecommitdiffstats
path: root/Python/optimizer_cases.c.h
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2024-08-20 15:52:58 (GMT)
committerGitHub <noreply@github.com>2024-08-20 15:52:58 (GMT)
commitbb1d30336e83837d4191a016107fd501cd230328 (patch)
treebe948ce7bf459bbd95195bd57262d775dc7efa76 /Python/optimizer_cases.c.h
parentbffed80230f2617de2ee02bd4bdded1024234dab (diff)
downloadcpython-bb1d30336e83837d4191a016107fd501cd230328.zip
cpython-bb1d30336e83837d4191a016107fd501cd230328.tar.gz
cpython-bb1d30336e83837d4191a016107fd501cd230328.tar.bz2
GH-118093: Make `CALL_ALLOC_AND_ENTER_INIT` suitable for tier 2. (GH-123140)
* Convert CALL_ALLOC_AND_ENTER_INIT to micro-ops such that tier 2 supports it * Allow inexact arguments for CALL_ALLOC_AND_ENTER_INIT.
Diffstat (limited to 'Python/optimizer_cases.c.h')
-rw-r--r--Python/optimizer_cases.c.h41
1 files changed, 40 insertions, 1 deletions
diff --git a/Python/optimizer_cases.c.h b/Python/optimizer_cases.c.h
index 3ec2e69..e5be9d0 100644
--- a/Python/optimizer_cases.c.h
+++ b/Python/optimizer_cases.c.h
@@ -1866,7 +1866,46 @@
break;
}
- /* _CALL_ALLOC_AND_ENTER_INIT is not a viable micro-op for tier 2 */
+ case _CHECK_AND_ALLOCATE_OBJECT: {
+ _Py_UopsSymbol **args;
+ _Py_UopsSymbol *null;
+ _Py_UopsSymbol *callable;
+ _Py_UopsSymbol *self;
+ _Py_UopsSymbol *init;
+ args = &stack_pointer[-oparg];
+ null = stack_pointer[-1 - oparg];
+ callable = stack_pointer[-2 - oparg];
+ args = &stack_pointer[-oparg];
+ uint32_t type_version = (uint32_t)this_instr->operand;
+ (void)type_version;
+ (void)callable;
+ (void)null;
+ (void)args;
+ self = sym_new_not_null(ctx);
+ init = sym_new_not_null(ctx);
+ stack_pointer[-2 - oparg] = self;
+ stack_pointer[-1 - oparg] = init;
+ break;
+ }
+
+ case _CREATE_INIT_FRAME: {
+ _Py_UopsSymbol **args;
+ _Py_UopsSymbol *init;
+ _Py_UopsSymbol *self;
+ _Py_UOpsAbstractFrame *init_frame;
+ args = &stack_pointer[-oparg];
+ init = stack_pointer[-1 - oparg];
+ self = stack_pointer[-2 - oparg];
+ (void)self;
+ (void)init;
+ (void)args;
+ init_frame = NULL;
+ ctx->done = true;
+ stack_pointer[-2 - oparg] = (_Py_UopsSymbol *)init_frame;
+ stack_pointer += -1 - oparg;
+ assert(WITHIN_STACK_BOUNDS());
+ break;
+ }
case _EXIT_INIT_CHECK: {
stack_pointer += -1;