mirror of
https://github.com/python/cpython.git
synced 2025-11-01 22:21:35 +00:00
gh-115778: Add tierN annotation for instruction definitions (#115815)
This replaces the old `TIER_{ONE,TWO}_ONLY` macros. Note that `specialized` implies `tier1`.
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
parent
59057ce55a
commit
e4561e0501
13 changed files with 56 additions and 147 deletions
13
Python/executor_cases.c.h
generated
13
Python/executor_cases.c.h
generated
|
|
@ -3716,7 +3716,6 @@
|
|||
|
||||
case _SET_IP: {
|
||||
PyObject *instr_ptr = (PyObject *)CURRENT_OPERAND();
|
||||
TIER_TWO_ONLY
|
||||
frame->instr_ptr = (_Py_CODEUNIT *)instr_ptr;
|
||||
break;
|
||||
}
|
||||
|
|
@ -3733,13 +3732,11 @@
|
|||
}
|
||||
|
||||
case _EXIT_TRACE: {
|
||||
TIER_TWO_ONLY
|
||||
if (1) goto side_exit;
|
||||
break;
|
||||
}
|
||||
|
||||
case _CHECK_VALIDITY: {
|
||||
TIER_TWO_ONLY
|
||||
if (!current_executor->vm_data.valid) goto deoptimize;
|
||||
break;
|
||||
}
|
||||
|
|
@ -3747,7 +3744,6 @@
|
|||
case _LOAD_CONST_INLINE: {
|
||||
PyObject *value;
|
||||
PyObject *ptr = (PyObject *)CURRENT_OPERAND();
|
||||
TIER_TWO_ONLY
|
||||
value = Py_NewRef(ptr);
|
||||
stack_pointer[0] = value;
|
||||
stack_pointer += 1;
|
||||
|
|
@ -3757,7 +3753,6 @@
|
|||
case _LOAD_CONST_INLINE_BORROW: {
|
||||
PyObject *value;
|
||||
PyObject *ptr = (PyObject *)CURRENT_OPERAND();
|
||||
TIER_TWO_ONLY
|
||||
value = ptr;
|
||||
stack_pointer[0] = value;
|
||||
stack_pointer += 1;
|
||||
|
|
@ -3768,7 +3763,6 @@
|
|||
PyObject *value;
|
||||
PyObject *null;
|
||||
PyObject *ptr = (PyObject *)CURRENT_OPERAND();
|
||||
TIER_TWO_ONLY
|
||||
value = Py_NewRef(ptr);
|
||||
null = NULL;
|
||||
stack_pointer[0] = value;
|
||||
|
|
@ -3781,7 +3775,6 @@
|
|||
PyObject *value;
|
||||
PyObject *null;
|
||||
PyObject *ptr = (PyObject *)CURRENT_OPERAND();
|
||||
TIER_TWO_ONLY
|
||||
value = ptr;
|
||||
null = NULL;
|
||||
stack_pointer[0] = value;
|
||||
|
|
@ -3792,14 +3785,12 @@
|
|||
|
||||
case _CHECK_GLOBALS: {
|
||||
PyObject *dict = (PyObject *)CURRENT_OPERAND();
|
||||
TIER_TWO_ONLY
|
||||
if (GLOBALS() != dict) goto deoptimize;
|
||||
break;
|
||||
}
|
||||
|
||||
case _CHECK_BUILTINS: {
|
||||
PyObject *dict = (PyObject *)CURRENT_OPERAND();
|
||||
TIER_TWO_ONLY
|
||||
if (BUILTINS() != dict) goto deoptimize;
|
||||
break;
|
||||
}
|
||||
|
|
@ -3815,7 +3806,6 @@
|
|||
|
||||
case _COLD_EXIT: {
|
||||
oparg = CURRENT_OPARG();
|
||||
TIER_TWO_ONLY
|
||||
_PyExecutorObject *previous = (_PyExecutorObject *)tstate->previous_executor;
|
||||
_PyExitData *exit = &previous->exits[oparg];
|
||||
exit->temperature++;
|
||||
|
|
@ -3851,7 +3841,6 @@
|
|||
|
||||
case _START_EXECUTOR: {
|
||||
PyObject *executor = (PyObject *)CURRENT_OPERAND();
|
||||
TIER_TWO_ONLY
|
||||
Py_DECREF(tstate->previous_executor);
|
||||
tstate->previous_executor = NULL;
|
||||
#ifndef _Py_JIT
|
||||
|
|
@ -3861,7 +3850,6 @@
|
|||
}
|
||||
|
||||
case _FATAL_ERROR: {
|
||||
TIER_TWO_ONLY
|
||||
assert(0);
|
||||
Py_FatalError("Fatal error uop executed.");
|
||||
break;
|
||||
|
|
@ -3869,7 +3857,6 @@
|
|||
|
||||
case _CHECK_VALIDITY_AND_SET_IP: {
|
||||
PyObject *instr_ptr = (PyObject *)CURRENT_OPERAND();
|
||||
TIER_TWO_ONLY
|
||||
if (!current_executor->vm_data.valid) goto deoptimize;
|
||||
frame->instr_ptr = (_Py_CODEUNIT *)instr_ptr;
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue