projects
/
python
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3a4dfc8
)
Add a warning comment to the LOAD_GLOBAL inline code.
author
Guido van Rossum
<guido@python.org>
Mon, 19 Aug 2002 21:17:53 +0000
(21:17 +0000)
committer
Guido van Rossum
<guido@python.org>
Mon, 19 Aug 2002 21:17:53 +0000
(21:17 +0000)
Python/ceval.c
patch
|
blob
|
history
diff --git
a/Python/ceval.c
b/Python/ceval.c
index af9c072c1ee1a9ef88d621e8660aec16f45bf8d2..00237c04d81b3662fcc378f11b029a35190d107a 100644
(file)
--- a/
Python/ceval.c
+++ b/
Python/ceval.c
@@
-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;