]> granicus.if.org Git - python/commitdiff
Check in my ultra-shortlived patch #597220.
authorMichael W. Hudson <mwh@python.net>
Mon, 19 Aug 2002 16:54:08 +0000 (16:54 +0000)
committerMichael W. Hudson <mwh@python.net>
Mon, 19 Aug 2002 16:54:08 +0000 (16:54 +0000)
Move some debugging checks inside Py_DEBUG.

They were causing cache misses according to cachegrind.

Objects/frameobject.c

index 7b6ea26488c8b4016d6318eea3a8e4f3f15a2ff6..90cd9524a84c549729bf3f865d3b1ca05fedbecb 100644 (file)
@@ -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;