mirror of
https://github.com/python/cpython.git
synced 2026-04-14 15:50:50 +00:00
gh-131798: JIT: optimize _LOAD_COMMON_CONSTANT (GH-146104)
This commit is contained in:
parent
db11623694
commit
98977ca433
3 changed files with 23 additions and 1 deletions
|
|
@ -631,6 +631,13 @@ dummy_func(void) {
|
|||
value = PyJitRef_Borrow(sym_new_const(ctx, val));
|
||||
}
|
||||
|
||||
op(_LOAD_COMMON_CONSTANT, (-- value)) {
|
||||
assert(oparg < NUM_COMMON_CONSTANTS);
|
||||
PyObject *val = _PyInterpreterState_GET()->common_consts[oparg];
|
||||
ADD_OP(_LOAD_CONST_INLINE_BORROW, 0, (uintptr_t)val);
|
||||
value = PyJitRef_Borrow(sym_new_const(ctx, val));
|
||||
}
|
||||
|
||||
op(_LOAD_SMALL_INT, (-- value)) {
|
||||
PyObject *val = PyLong_FromLong(oparg);
|
||||
assert(val);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue