mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
GH-125837: Split LOAD_CONST
into three. (GH-125972)
* Add LOAD_CONST_IMMORTAL opcode * Add LOAD_SMALL_INT opcode * Remove RETURN_CONST opcode
This commit is contained in:
parent
67f5c5bd6f
commit
faa3272fb8
33 changed files with 706 additions and 538 deletions
21
Python/optimizer_cases.c.h
generated
21
Python/optimizer_cases.c.h
generated
|
@ -68,6 +68,27 @@
|
|||
break;
|
||||
}
|
||||
|
||||
case _LOAD_CONST_IMMORTAL: {
|
||||
_Py_UopsSymbol *value;
|
||||
PyObject *val = PyTuple_GET_ITEM(co->co_consts, this_instr->oparg);
|
||||
REPLACE_OP(this_instr, _LOAD_CONST_INLINE_BORROW, 0, (uintptr_t)val);
|
||||
value = sym_new_const(ctx, val);
|
||||
stack_pointer[0] = value;
|
||||
stack_pointer += 1;
|
||||
assert(WITHIN_STACK_BOUNDS());
|
||||
break;
|
||||
}
|
||||
|
||||
case _LOAD_SMALL_INT: {
|
||||
_Py_UopsSymbol *value;
|
||||
PyObject *val = PyLong_FromLong(this_instr->oparg);
|
||||
value = sym_new_const(ctx, val);
|
||||
stack_pointer[0] = value;
|
||||
stack_pointer += 1;
|
||||
assert(WITHIN_STACK_BOUNDS());
|
||||
break;
|
||||
}
|
||||
|
||||
case _STORE_FAST: {
|
||||
_Py_UopsSymbol *value;
|
||||
value = stack_pointer[-1];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue