Commit d8dbf847 authored by Guido van Rossum's avatar Guido van Rossum

Add a warning comment to the LOAD_GLOBAL inline code.

parent 3a4dfc87
......@@ -1710,9 +1710,11 @@ eval_frame(PyFrameObject *f)
case LOAD_GLOBAL:
w = GETITEM(names, oparg);
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;
if (hash != -1) {
/* Inline the PyDict_GetItem() calls */
PyDictObject *d;
d = (PyDictObject *)(f->f_globals);
x = d->ma_lookup(d, w, hash)->me_value;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment