summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2016-11-11 12:31:18 (GMT)
committerRaymond Hettinger <python@rcn.com>2016-11-11 12:31:18 (GMT)
commit13527123a100f4cd8620473ae8da4cb727279866 (patch)
tree25c4dcc5d4021a43ac4b257b1e7ff8059f2f1137 /Python
parenta27c064428c9e3b601be69876ef7e7299a3e0b7f (diff)
downloadcpython-13527123a100f4cd8620473ae8da4cb727279866.zip
cpython-13527123a100f4cd8620473ae8da4cb727279866.tar.gz
cpython-13527123a100f4cd8620473ae8da4cb727279866.tar.bz2
Issue #28665: Harmonize STORE_DEREF with STORE_FAST and LOAD_DEREF giving a 40% speedup.
Diffstat (limited to 'Python')
-rw-r--r--Python/ceval.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index b2c90cc..6bdc998 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -2462,8 +2462,9 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
TARGET(STORE_DEREF) {
PyObject *v = POP();
PyObject *cell = freevars[oparg];
- PyCell_Set(cell, v);
- Py_DECREF(v);
+ PyObject *oldobj = PyCell_GET(cell);
+ PyCell_SET(cell, v);
+ Py_XDECREF(oldobj);
DISPATCH();
}