mirror of
https://github.com/python/cpython.git
synced 2025-09-03 15:31:08 +00:00
LOAD_FAST: rearrange branches to favor the expected case, and get
rid of a redundant NULL-pointer check in the expected case.
This commit is contained in:
parent
7ba5e810fd
commit
373f8d81ff
1 changed files with 7 additions and 10 deletions
|
@ -1666,17 +1666,14 @@ eval_frame(PyFrameObject *f)
|
||||||
|
|
||||||
case LOAD_FAST:
|
case LOAD_FAST:
|
||||||
x = GETLOCAL(oparg);
|
x = GETLOCAL(oparg);
|
||||||
if (x == NULL) {
|
if (x != NULL) {
|
||||||
format_exc_check_arg(
|
Py_INCREF(x);
|
||||||
PyExc_UnboundLocalError,
|
PUSH(x);
|
||||||
UNBOUNDLOCAL_ERROR_MSG,
|
continue;
|
||||||
PyTuple_GetItem(co->co_varnames, oparg)
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
Py_INCREF(x);
|
format_exc_check_arg(PyExc_UnboundLocalError,
|
||||||
PUSH(x);
|
UNBOUNDLOCAL_ERROR_MSG,
|
||||||
if (x != NULL) continue;
|
PyTuple_GetItem(co->co_varnames, oparg));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case STORE_FAST:
|
case STORE_FAST:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue