summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael W. Hudson <mwh@python.net>2002-08-19 16:54:08 (GMT)
committerMichael W. Hudson <mwh@python.net>2002-08-19 16:54:08 (GMT)
commit69734a52725f1ebd3b508098a61c820784471d66 (patch)
treef4ee090f6c5d54ec09110d864edc1236a2d0c4ad
parentc66ff4441e7c4806ff9a73a42ab9229a1988b8df (diff)
downloadcpython-69734a52725f1ebd3b508098a61c820784471d66.zip
cpython-69734a52725f1ebd3b508098a61c820784471d66.tar.gz
cpython-69734a52725f1ebd3b508098a61c820784471d66.tar.bz2
Check in my ultra-shortlived patch #597220.
Move some debugging checks inside Py_DEBUG. They were causing cache misses according to cachegrind.
-rw-r--r--Objects/frameobject.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Objects/frameobject.c b/Objects/frameobject.c
index 7b6ea26..90cd952 100644
--- a/Objects/frameobject.c
+++ b/Objects/frameobject.c
@@ -238,13 +238,13 @@ PyFrame_New(PyThreadState *tstate, PyCodeObject *code, PyObject *globals,
if (builtin_object == NULL)
return NULL;
}
- if ((back != NULL && !PyFrame_Check(back)) ||
- code == NULL || !PyCode_Check(code) ||
- globals == NULL || !PyDict_Check(globals) ||
+#ifdef Py_DEBUG
+ if (code == NULL || globals == NULL || !PyDict_Check(globals) ||
(locals != NULL && !PyDict_Check(locals))) {
PyErr_BadInternalCall();
return NULL;
}
+#endif
ncells = PyTuple_GET_SIZE(code->co_cellvars);
nfrees = PyTuple_GET_SIZE(code->co_freevars);
extras = code->co_stacksize + code->co_nlocals + ncells + nfrees;