gh-94216: add pseudo instructions to the dis/opcodes modules (GH-94241)

This commit is contained in:
Irit Katriel 2022-07-01 15:33:35 +01:00 committed by GitHub
parent be80db14c4
commit c57aad777a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 245 additions and 83 deletions

32
Include/opcode.h generated
View file

@ -120,6 +120,19 @@ extern "C" {
#define POP_JUMP_BACKWARD_IF_NONE 174
#define POP_JUMP_BACKWARD_IF_FALSE 175
#define POP_JUMP_BACKWARD_IF_TRUE 176
#define MIN_PSEUDO_OPCODE 256
#define SETUP_FINALLY 256
#define SETUP_CLEANUP 257
#define SETUP_WITH 258
#define POP_BLOCK 259
#define JUMP 260
#define JUMP_NO_INTERRUPT 261
#define POP_JUMP_IF_FALSE 262
#define POP_JUMP_IF_TRUE 263
#define POP_JUMP_IF_NONE 264
#define POP_JUMP_IF_NOT_NONE 265
#define LOAD_METHOD 266
#define MAX_PSEUDO_OPCODE 266
#define BINARY_OP_ADAPTIVE 3
#define BINARY_OP_ADD_FLOAT 4
#define BINARY_OP_ADD_INT 5
@ -194,9 +207,19 @@ extern "C" {
#define UNPACK_SEQUENCE_TWO_TUPLE 182
#define DO_TRACING 255
#define HAS_ARG(op) ((((op) >= HAVE_ARGUMENT) && (!IS_PSEUDO_OPCODE(op)))\
|| ((op) == JUMP) \
|| ((op) == JUMP_NO_INTERRUPT) \
|| ((op) == POP_JUMP_IF_FALSE) \
|| ((op) == POP_JUMP_IF_TRUE) \
|| ((op) == POP_JUMP_IF_NONE) \
|| ((op) == POP_JUMP_IF_NOT_NONE) \
|| ((op) == LOAD_METHOD) \
)
#define HAS_CONST(op) (false\
|| ((op) == 100) \
|| ((op) == 172) \
|| ((op) == LOAD_CONST) \
|| ((op) == KW_NAMES) \
)
#define NB_ADD 0
@ -226,11 +249,8 @@ extern "C" {
#define NB_INPLACE_TRUE_DIVIDE 24
#define NB_INPLACE_XOR 25
#define HAS_ARG(op) ((op) >= HAVE_ARGUMENT)
/* Reserve some bytecodes for internal use in the compiler.
* The value of 240 is arbitrary. */
#define IS_ARTIFICIAL(op) ((op) > 240)
#define IS_PSEUDO_OPCODE(op) (((op) >= MIN_PSEUDO_OPCODE) && ((op) <= MAX_PSEUDO_OPCODE))
#ifdef __cplusplus
}