add a SETUP_WITH opcode

It speeds up the with statement and correctly looks up the special
methods involved.
This commit is contained in:
Benjamin Peterson 2009-05-25 13:13:44 +00:00
parent 179bf213ea
commit 1880d8b823
9 changed files with 86 additions and 66 deletions

View file

@ -74,9 +74,10 @@ typedef unsigned short mode_t;
Python 2.7a0: 62171 (optimize list comprehensions/change LIST_APPEND)
Python 2.7a0: 62181 (optimize conditional branches:
introduce POP_JUMP_IF_FALSE and POP_JUMP_IF_TRUE)
Python 2.7a0 62191 (introduce SETUP_WITH)
.
*/
#define MAGIC (62181 | ((long)'\r'<<16) | ((long)'\n'<<24))
#define MAGIC (62191 | ((long)'\r'<<16) | ((long)'\n'<<24))
/* Magic word as global; note that _PyImport_Init() can change the
value of this global to accommodate for alterations of how the