gh-142961: Fix constant folding len(tuple) in JIT (GH-142963)

This commit is contained in:
Ken Jin 2025-12-20 01:43:36 +08:00 committed by GitHub
parent 049c2526bf
commit 786f464c74
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 931 additions and 777 deletions

View file

@ -529,10 +529,6 @@ dummy_func(void) {
value = PyJitRef_Borrow(sym_new_const(ctx, ptr));
}
op(_POP_CALL_ONE_LOAD_CONST_INLINE_BORROW, (ptr/4, unused, unused, unused -- value)) {
value = PyJitRef_Borrow(sym_new_const(ctx, ptr));
}
op(_POP_CALL_TWO_LOAD_CONST_INLINE_BORROW, (ptr/4, unused, unused, unused, unused -- value)) {
value = PyJitRef_Borrow(sym_new_const(ctx, ptr));
}
@ -1263,7 +1259,7 @@ dummy_func(void) {
goto error;
}
if (_Py_IsImmortal(temp)) {
REPLACE_OP(this_instr, _POP_CALL_ONE_LOAD_CONST_INLINE_BORROW,
REPLACE_OP(this_instr, _SHUFFLE_3_LOAD_CONST_INLINE_BORROW,
0, (uintptr_t)temp);
}
res = sym_new_const(ctx, temp);