mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
Backport r69961 to trunk, replacing JUMP_IF_{TRUE,FALSE} with
POP_JUMP_IF_{TRUE,FALSE} and JUMP_IF_{TRUE,FALSE}_OR_POP. This avoids executing a POP_TOP on each conditional and sometimes allows the peephole optimizer to skip a JUMP_ABSOLUTE entirely. It speeds up list comprehensions significantly.
This commit is contained in:
parent
de28d6841e
commit
68d6852006
11 changed files with 228 additions and 178 deletions
|
@ -106,9 +106,12 @@ extern "C" {
|
|||
#define IMPORT_FROM 108 /* Index in name list */
|
||||
|
||||
#define JUMP_FORWARD 110 /* Number of bytes to skip */
|
||||
#define JUMP_IF_FALSE 111 /* "" */
|
||||
#define JUMP_IF_TRUE 112 /* "" */
|
||||
#define JUMP_ABSOLUTE 113 /* Target byte offset from beginning of code */
|
||||
#define JUMP_IF_FALSE_OR_POP 111 /* Target byte offset from beginning
|
||||
of code */
|
||||
#define JUMP_IF_TRUE_OR_POP 112 /* "" */
|
||||
#define JUMP_ABSOLUTE 113 /* "" */
|
||||
#define POP_JUMP_IF_FALSE 114 /* "" */
|
||||
#define POP_JUMP_IF_TRUE 115 /* "" */
|
||||
|
||||
#define LOAD_GLOBAL 116 /* Index in name list */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue