mirror of
https://github.com/python/cpython.git
synced 2025-07-28 13:44:43 +00:00
add a SETUP_WITH opcode
It speeds up the with statement and correctly looks up the special methods involved.
This commit is contained in:
parent
179bf213ea
commit
1880d8b823
9 changed files with 86 additions and 66 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue