mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +00:00
Add a warning comment to the LOAD_GLOBAL inline code.
This commit is contained in:
parent
3a4dfc87e6
commit
d8dbf847b6
1 changed files with 3 additions and 1 deletions
|
@ -1710,9 +1710,11 @@ eval_frame(PyFrameObject *f)
|
||||||
case LOAD_GLOBAL:
|
case LOAD_GLOBAL:
|
||||||
w = GETITEM(names, oparg);
|
w = GETITEM(names, oparg);
|
||||||
if (PyString_CheckExact(w)) {
|
if (PyString_CheckExact(w)) {
|
||||||
|
/* Inline the PyDict_GetItem() calls.
|
||||||
|
WARNING: this is an extreme speed hack.
|
||||||
|
Do not try this at home. */
|
||||||
long hash = ((PyStringObject *)w)->ob_shash;
|
long hash = ((PyStringObject *)w)->ob_shash;
|
||||||
if (hash != -1) {
|
if (hash != -1) {
|
||||||
/* Inline the PyDict_GetItem() calls */
|
|
||||||
PyDictObject *d;
|
PyDictObject *d;
|
||||||
d = (PyDictObject *)(f->f_globals);
|
d = (PyDictObject *)(f->f_globals);
|
||||||
x = d->ma_lookup(d, w, hash)->me_value;
|
x = d->ma_lookup(d, w, hash)->me_value;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue