diff options
author | Alexandre Vassalotti <alexandre@peadrop.com> | 2009-07-21 05:23:51 (GMT) |
---|---|---|
committer | Alexandre Vassalotti <alexandre@peadrop.com> | 2009-07-21 05:23:51 (GMT) |
commit | bfc3099f388a7783ca16de44630558a9e6de66e4 (patch) | |
tree | ea4546ae87116e3e950b99c0df361b5373bc4655 | |
parent | 7b82b40a47498bea476746d6e69f2de4434810d9 (diff) | |
download | cpython-bfc3099f388a7783ca16de44630558a9e6de66e4.zip cpython-bfc3099f388a7783ca16de44630558a9e6de66e4.tar.gz cpython-bfc3099f388a7783ca16de44630558a9e6de66e4.tar.bz2 |
Merged revisions 73750 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r73750 | benjamin.peterson | 2009-07-01 19:45:19 -0400 (Wed, 01 Jul 2009) | 1 line
small optimization: avoid popping the current block until we have to
........
-rw-r--r-- | Python/ceval.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index 403acd2..003d4df 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -2839,19 +2839,18 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag) fast_block_end: while (why != WHY_NOT && f->f_iblock > 0) { - PyTryBlock *b = PyFrame_BlockPop(f); + /* Peek at the current block. */ + PyTryBlock *b = &f->f_blockstack[f->f_iblock - 1]; assert(why != WHY_YIELD); if (b->b_type == SETUP_LOOP && why == WHY_CONTINUE) { - /* For a continue inside a try block, - don't pop the block for the loop. */ - PyFrame_BlockSetup(f, b->b_type, b->b_handler, - b->b_level); why = WHY_NOT; JUMPTO(PyLong_AS_LONG(retval)); Py_DECREF(retval); break; } + /* Now we have to pop the block. */ + f->f_iblock--; if (b->b_type == EXCEPT_HANDLER) { UNWIND_EXCEPT_HANDLER(b); |