mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
gh-134584: JIT: Borrow references for immortal promoted globals (GH-142921)
JIT: Borrow references for immortal promoted globals
This commit is contained in:
parent
6a4f10325d
commit
6b4bc6e6a2
3 changed files with 62 additions and 4 deletions
|
|
@ -1376,7 +1376,12 @@ dummy_func(void) {
|
|||
res = sym_new_not_null(ctx);
|
||||
}
|
||||
else {
|
||||
res = sym_new_const(ctx, cnst);
|
||||
if (_Py_IsImmortal(cnst)) {
|
||||
res = PyJitRef_Borrow(sym_new_const(ctx, cnst));
|
||||
}
|
||||
else {
|
||||
res = sym_new_const(ctx, cnst);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1411,7 +1416,12 @@ dummy_func(void) {
|
|||
res = sym_new_not_null(ctx);
|
||||
}
|
||||
else {
|
||||
res = sym_new_const(ctx, cnst);
|
||||
if (_Py_IsImmortal(cnst)) {
|
||||
res = PyJitRef_Borrow(sym_new_const(ctx, cnst));
|
||||
}
|
||||
else {
|
||||
res = sym_new_const(ctx, cnst);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
14
Python/optimizer_cases.c.h
generated
14
Python/optimizer_cases.c.h
generated
|
|
@ -1330,7 +1330,12 @@
|
|||
res = sym_new_not_null(ctx);
|
||||
}
|
||||
else {
|
||||
res = sym_new_const(ctx, cnst);
|
||||
if (_Py_IsImmortal(cnst)) {
|
||||
res = PyJitRef_Borrow(sym_new_const(ctx, cnst));
|
||||
}
|
||||
else {
|
||||
res = sym_new_const(ctx, cnst);
|
||||
}
|
||||
}
|
||||
CHECK_STACK_BOUNDS(1);
|
||||
stack_pointer[0] = res;
|
||||
|
|
@ -1367,7 +1372,12 @@
|
|||
res = sym_new_not_null(ctx);
|
||||
}
|
||||
else {
|
||||
res = sym_new_const(ctx, cnst);
|
||||
if (_Py_IsImmortal(cnst)) {
|
||||
res = PyJitRef_Borrow(sym_new_const(ctx, cnst));
|
||||
}
|
||||
else {
|
||||
res = sym_new_const(ctx, cnst);
|
||||
}
|
||||
}
|
||||
CHECK_STACK_BOUNDS(1);
|
||||
stack_pointer[0] = res;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue