GH-135379: Remove types from stack items in code generator. (GH-135384)

* Make casts explicit in the instruction definitions
This commit is contained in:
Mark Shannon 2025-06-11 15:52:25 +01:00 committed by GitHub
parent 49d72365cd
commit c87b5b2cb6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 257 additions and 255 deletions

View file

@ -715,10 +715,10 @@
}
case _BINARY_OP_SUBSCR_INIT_CALL: {
_Py_UOpsAbstractFrame *new_frame;
JitOptSymbol *new_frame;
new_frame = NULL;
ctx->done = true;
stack_pointer[-3] = (JitOptSymbol *)new_frame;
stack_pointer[-3] = new_frame;
stack_pointer += -2;
assert(WITHIN_STACK_BOUNDS());
break;
@ -829,10 +829,10 @@
/* _SEND is not a viable micro-op for tier 2 */
case _SEND_GEN_FRAME: {
_Py_UOpsAbstractFrame *gen_frame;
JitOptSymbol *gen_frame;
gen_frame = NULL;
ctx->done = true;
stack_pointer[-1] = (JitOptSymbol *)gen_frame;
stack_pointer[-1] = gen_frame;
break;
}
@ -1323,12 +1323,12 @@
}
case _LOAD_ATTR_PROPERTY_FRAME: {
_Py_UOpsAbstractFrame *new_frame;
JitOptSymbol *new_frame;
PyObject *fget = (PyObject *)this_instr->operand0;
(void)fget;
new_frame = NULL;
ctx->done = true;
stack_pointer[-1] = (JitOptSymbol *)new_frame;
stack_pointer[-1] = new_frame;
break;
}
@ -1685,10 +1685,10 @@
}
case _FOR_ITER_GEN_FRAME: {
_Py_UOpsAbstractFrame *gen_frame;
JitOptSymbol *gen_frame;
gen_frame = NULL;
ctx->done = true;
stack_pointer[0] = (JitOptSymbol *)gen_frame;
stack_pointer[0] = gen_frame;
stack_pointer += 1;
assert(WITHIN_STACK_BOUNDS());
break;
@ -1857,7 +1857,7 @@
/* _MONITOR_CALL is not a viable micro-op for tier 2 */
case _PY_FRAME_GENERAL: {
_Py_UOpsAbstractFrame *new_frame;
JitOptSymbol *new_frame;
PyCodeObject *co = NULL;
assert((this_instr + 2)->opcode == _PUSH_FRAME);
co = get_code_with_logging((this_instr + 2));
@ -1865,8 +1865,8 @@
ctx->done = true;
break;
}
new_frame = frame_new(ctx, co, 0, NULL, 0);
stack_pointer[-2 - oparg] = (JitOptSymbol *)new_frame;
new_frame = (JitOptSymbol *)frame_new(ctx, co, 0, NULL, 0);
stack_pointer[-2 - oparg] = new_frame;
stack_pointer += -1 - oparg;
assert(WITHIN_STACK_BOUNDS());
break;
@ -1970,7 +1970,7 @@
case _INIT_CALL_PY_EXACT_ARGS: {
JitOptSymbol **args;
JitOptSymbol *self_or_null;
_Py_UOpsAbstractFrame *new_frame;
JitOptSymbol *new_frame;
args = &stack_pointer[-oparg];
self_or_null = stack_pointer[-1 - oparg];
int argcount = oparg;
@ -1988,25 +1988,25 @@
argcount++;
}
if (sym_is_null(self_or_null) || sym_is_not_null(self_or_null)) {
new_frame = frame_new(ctx, co, 0, args, argcount);
new_frame = (JitOptSymbol *)frame_new(ctx, co, 0, args, argcount);
} else {
new_frame = frame_new(ctx, co, 0, NULL, 0);
new_frame = (JitOptSymbol *)frame_new(ctx, co, 0, NULL, 0);
}
stack_pointer[-2 - oparg] = (JitOptSymbol *)new_frame;
stack_pointer[-2 - oparg] = new_frame;
stack_pointer += -1 - oparg;
assert(WITHIN_STACK_BOUNDS());
break;
}
case _PUSH_FRAME: {
_Py_UOpsAbstractFrame *new_frame;
new_frame = (_Py_UOpsAbstractFrame *)stack_pointer[-1];
JitOptSymbol *new_frame;
new_frame = stack_pointer[-1];
stack_pointer += -1;
assert(WITHIN_STACK_BOUNDS());
ctx->frame->stack_pointer = stack_pointer;
ctx->frame = new_frame;
ctx->frame = (_Py_UOpsAbstractFrame *)new_frame;
ctx->curr_frame_depth++;
stack_pointer = new_frame->stack_pointer;
stack_pointer = ctx->frame->stack_pointer;
co = get_code(this_instr);
if (co == NULL) {
ctx->done = true;
@ -2159,10 +2159,10 @@
}
case _CREATE_INIT_FRAME: {
_Py_UOpsAbstractFrame *init_frame;
JitOptSymbol *init_frame;
init_frame = NULL;
ctx->done = true;
stack_pointer[-2 - oparg] = (JitOptSymbol *)init_frame;
stack_pointer[-2 - oparg] = init_frame;
stack_pointer += -1 - oparg;
assert(WITHIN_STACK_BOUNDS());
break;
@ -2326,10 +2326,10 @@
/* _DO_CALL_KW is not a viable micro-op for tier 2 */
case _PY_FRAME_KW: {
_Py_UOpsAbstractFrame *new_frame;
JitOptSymbol *new_frame;
new_frame = NULL;
ctx->done = true;
stack_pointer[-3 - oparg] = (JitOptSymbol *)new_frame;
stack_pointer[-3 - oparg] = new_frame;
stack_pointer += -2 - oparg;
assert(WITHIN_STACK_BOUNDS());
break;