mirror of
https://github.com/python/cpython.git
synced 2025-08-30 05:35:08 +00:00
gh-93143: Avoid NULL check in LOAD_FAST based on analysis in the compiler (GH-93144)
This commit is contained in:
parent
8a5e3c2ec6
commit
f425f3bb27
11 changed files with 371 additions and 52 deletions
|
@ -1813,7 +1813,7 @@ handle_eval_breaker:
|
|||
DISPATCH();
|
||||
}
|
||||
|
||||
TARGET(LOAD_FAST) {
|
||||
TARGET(LOAD_FAST_CHECK) {
|
||||
PyObject *value = GETLOCAL(oparg);
|
||||
if (value == NULL) {
|
||||
goto unbound_local_error;
|
||||
|
@ -1823,6 +1823,14 @@ handle_eval_breaker:
|
|||
DISPATCH();
|
||||
}
|
||||
|
||||
TARGET(LOAD_FAST) {
|
||||
PyObject *value = GETLOCAL(oparg);
|
||||
assert(value != NULL);
|
||||
Py_INCREF(value);
|
||||
PUSH(value);
|
||||
DISPATCH();
|
||||
}
|
||||
|
||||
TARGET(LOAD_CONST) {
|
||||
PREDICTED(LOAD_CONST);
|
||||
PyObject *value = GETITEM(consts, oparg);
|
||||
|
@ -1840,17 +1848,13 @@ handle_eval_breaker:
|
|||
|
||||
TARGET(LOAD_FAST__LOAD_FAST) {
|
||||
PyObject *value = GETLOCAL(oparg);
|
||||
if (value == NULL) {
|
||||
goto unbound_local_error;
|
||||
}
|
||||
assert(value != NULL);
|
||||
NEXTOPARG();
|
||||
next_instr++;
|
||||
Py_INCREF(value);
|
||||
PUSH(value);
|
||||
value = GETLOCAL(oparg);
|
||||
if (value == NULL) {
|
||||
goto unbound_local_error;
|
||||
}
|
||||
assert(value != NULL);
|
||||
Py_INCREF(value);
|
||||
PUSH(value);
|
||||
NOTRACE_DISPATCH();
|
||||
|
@ -1858,9 +1862,7 @@ handle_eval_breaker:
|
|||
|
||||
TARGET(LOAD_FAST__LOAD_CONST) {
|
||||
PyObject *value = GETLOCAL(oparg);
|
||||
if (value == NULL) {
|
||||
goto unbound_local_error;
|
||||
}
|
||||
assert(value != NULL);
|
||||
NEXTOPARG();
|
||||
next_instr++;
|
||||
Py_INCREF(value);
|
||||
|
@ -1877,9 +1879,7 @@ handle_eval_breaker:
|
|||
NEXTOPARG();
|
||||
next_instr++;
|
||||
value = GETLOCAL(oparg);
|
||||
if (value == NULL) {
|
||||
goto unbound_local_error;
|
||||
}
|
||||
assert(value != NULL);
|
||||
Py_INCREF(value);
|
||||
PUSH(value);
|
||||
NOTRACE_DISPATCH();
|
||||
|
@ -1902,9 +1902,7 @@ handle_eval_breaker:
|
|||
Py_INCREF(value);
|
||||
PUSH(value);
|
||||
value = GETLOCAL(oparg);
|
||||
if (value == NULL) {
|
||||
goto unbound_local_error;
|
||||
}
|
||||
assert(value != NULL);
|
||||
Py_INCREF(value);
|
||||
PUSH(value);
|
||||
NOTRACE_DISPATCH();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue