summaryrefslogtreecommitdiffstats
path: root/Python/opcode_metadata.h
diff options
context:
space:
mode:
Diffstat (limited to 'Python/opcode_metadata.h')
-rw-r--r--Python/opcode_metadata.h78
1 files changed, 76 insertions, 2 deletions
diff --git a/Python/opcode_metadata.h b/Python/opcode_metadata.h
index 2c4d1aa..cbe3861 100644
--- a/Python/opcode_metadata.h
+++ b/Python/opcode_metadata.h
@@ -3,6 +3,21 @@
// Python/bytecodes.c
// Do not edit!
+
+#define IS_PSEUDO_INSTR(OP) \
+ ((OP) == STORE_FAST_MAYBE_NULL) || \
+ ((OP) == LOAD_SUPER_METHOD) || \
+ ((OP) == LOAD_ZERO_SUPER_METHOD) || \
+ ((OP) == LOAD_ZERO_SUPER_ATTR) || \
+ ((OP) == LOAD_METHOD) || \
+ ((OP) == JUMP) || \
+ ((OP) == JUMP_NO_INTERRUPT) || \
+ ((OP) == SETUP_FINALLY) || \
+ ((OP) == SETUP_CLEANUP) || \
+ ((OP) == SETUP_WITH) || \
+ ((OP) == POP_BLOCK) || \
+ 0
+
#ifndef NEED_OPCODE_METADATA
extern int _PyOpcode_num_popped(int opcode, int oparg, bool jump);
#else
@@ -29,6 +44,8 @@ _PyOpcode_num_popped(int opcode, int oparg, bool jump) {
return 0;
case STORE_FAST:
return 1;
+ case STORE_FAST_MAYBE_NULL:
+ return 1;
case STORE_FAST_LOAD_FAST:
return 1;
case STORE_FAST_STORE_FAST:
@@ -211,12 +228,20 @@ _PyOpcode_num_popped(int opcode, int oparg, bool jump) {
return 3;
case LOAD_SUPER_ATTR:
return 3;
+ case LOAD_SUPER_METHOD:
+ return 3;
+ case LOAD_ZERO_SUPER_METHOD:
+ return 3;
+ case LOAD_ZERO_SUPER_ATTR:
+ return 3;
case LOAD_SUPER_ATTR_ATTR:
return 3;
case LOAD_SUPER_ATTR_METHOD:
return 3;
case LOAD_ATTR:
return 1;
+ case LOAD_METHOD:
+ return 1;
case LOAD_ATTR_INSTANCE_VALUE:
return 1;
case LOAD_ATTR_MODULE:
@@ -261,6 +286,10 @@ _PyOpcode_num_popped(int opcode, int oparg, bool jump) {
return 0;
case JUMP_BACKWARD:
return 0;
+ case JUMP:
+ return 0;
+ case JUMP_NO_INTERRUPT:
+ return 0;
case ENTER_EXECUTOR:
return 0;
case POP_JUMP_IF_FALSE:
@@ -305,6 +334,14 @@ _PyOpcode_num_popped(int opcode, int oparg, bool jump) {
return 1;
case WITH_EXCEPT_START:
return 4;
+ case SETUP_FINALLY:
+ return 0;
+ case SETUP_CLEANUP:
+ return 0;
+ case SETUP_WITH:
+ return 0;
+ case POP_BLOCK:
+ return 0;
case PUSH_EXC_INFO:
return 1;
case LOAD_ATTR_METHOD_WITH_VALUES:
@@ -423,6 +460,8 @@ _PyOpcode_num_pushed(int opcode, int oparg, bool jump) {
return 1;
case STORE_FAST:
return 0;
+ case STORE_FAST_MAYBE_NULL:
+ return 0;
case STORE_FAST_LOAD_FAST:
return 1;
case STORE_FAST_STORE_FAST:
@@ -605,12 +644,20 @@ _PyOpcode_num_pushed(int opcode, int oparg, bool jump) {
return ((oparg & 1) ? 1 : 0) + 1;
case LOAD_SUPER_ATTR:
return ((oparg & 1) ? 1 : 0) + 1;
+ case LOAD_SUPER_METHOD:
+ return ((oparg & 1) ? 1 : 0) + 1;
+ case LOAD_ZERO_SUPER_METHOD:
+ return ((oparg & 1) ? 1 : 0) + 1;
+ case LOAD_ZERO_SUPER_ATTR:
+ return ((oparg & 1) ? 1 : 0) + 1;
case LOAD_SUPER_ATTR_ATTR:
return ((oparg & 1) ? 1 : 0) + 1;
case LOAD_SUPER_ATTR_METHOD:
return 2;
case LOAD_ATTR:
return ((oparg & 1) ? 1 : 0) + 1;
+ case LOAD_METHOD:
+ return ((oparg & 1) ? 1 : 0) + 1;
case LOAD_ATTR_INSTANCE_VALUE:
return ((oparg & 1) ? 1 : 0) + 1;
case LOAD_ATTR_MODULE:
@@ -655,6 +702,10 @@ _PyOpcode_num_pushed(int opcode, int oparg, bool jump) {
return 0;
case JUMP_BACKWARD:
return 0;
+ case JUMP:
+ return 0;
+ case JUMP_NO_INTERRUPT:
+ return 0;
case ENTER_EXECUTOR:
return 0;
case POP_JUMP_IF_FALSE:
@@ -699,6 +750,14 @@ _PyOpcode_num_pushed(int opcode, int oparg, bool jump) {
return 2;
case WITH_EXCEPT_START:
return 5;
+ case SETUP_FINALLY:
+ return 0;
+ case SETUP_CLEANUP:
+ return 0;
+ case SETUP_WITH:
+ return 0;
+ case POP_BLOCK:
+ return 0;
case PUSH_EXC_INFO:
return 2;
case LOAD_ATTR_METHOD_WITH_VALUES:
@@ -797,10 +856,14 @@ struct opcode_metadata {
enum InstructionFormat instr_format;
};
+#define OPCODE_METADATA_FMT(OP) (_PyOpcode_opcode_metadata[(OP)].instr_format)
+#define SAME_OPCODE_METADATA(OP1, OP2) \
+ (OPCODE_METADATA_FMT(OP1) == OPCODE_METADATA_FMT(OP2))
+
#ifndef NEED_OPCODE_METADATA
-extern const struct opcode_metadata _PyOpcode_opcode_metadata[256];
+extern const struct opcode_metadata _PyOpcode_opcode_metadata[512];
#else
-const struct opcode_metadata _PyOpcode_opcode_metadata[256] = {
+const struct opcode_metadata _PyOpcode_opcode_metadata[512] = {
[NOP] = { true, INSTR_FMT_IX },
[RESUME] = { true, INSTR_FMT_IB },
[INSTRUMENTED_RESUME] = { true, INSTR_FMT_IB },
@@ -811,6 +874,7 @@ const struct opcode_metadata _PyOpcode_opcode_metadata[256] = {
[LOAD_FAST_LOAD_FAST] = { true, INSTR_FMT_IB },
[LOAD_CONST] = { true, INSTR_FMT_IB },
[STORE_FAST] = { true, INSTR_FMT_IB },
+ [STORE_FAST_MAYBE_NULL] = { true, INSTR_FMT_IB },
[STORE_FAST_LOAD_FAST] = { true, INSTR_FMT_IB },
[STORE_FAST_STORE_FAST] = { true, INSTR_FMT_IB },
[POP_TOP] = { true, INSTR_FMT_IX },
@@ -902,9 +966,13 @@ const struct opcode_metadata _PyOpcode_opcode_metadata[256] = {
[MAP_ADD] = { true, INSTR_FMT_IB },
[INSTRUMENTED_LOAD_SUPER_ATTR] = { true, INSTR_FMT_IBC00000000 },
[LOAD_SUPER_ATTR] = { true, INSTR_FMT_IBC },
+ [LOAD_SUPER_METHOD] = { true, INSTR_FMT_IBC },
+ [LOAD_ZERO_SUPER_METHOD] = { true, INSTR_FMT_IBC },
+ [LOAD_ZERO_SUPER_ATTR] = { true, INSTR_FMT_IBC },
[LOAD_SUPER_ATTR_ATTR] = { true, INSTR_FMT_IBC },
[LOAD_SUPER_ATTR_METHOD] = { true, INSTR_FMT_IBC },
[LOAD_ATTR] = { true, INSTR_FMT_IBC00000000 },
+ [LOAD_METHOD] = { true, INSTR_FMT_IBC00000000 },
[LOAD_ATTR_INSTANCE_VALUE] = { true, INSTR_FMT_IBC00000000 },
[LOAD_ATTR_MODULE] = { true, INSTR_FMT_IBC00000000 },
[LOAD_ATTR_WITH_HINT] = { true, INSTR_FMT_IBC00000000 },
@@ -927,6 +995,8 @@ const struct opcode_metadata _PyOpcode_opcode_metadata[256] = {
[IMPORT_FROM] = { true, INSTR_FMT_IB },
[JUMP_FORWARD] = { true, INSTR_FMT_IB },
[JUMP_BACKWARD] = { true, INSTR_FMT_IB },
+ [JUMP] = { true, INSTR_FMT_IB },
+ [JUMP_NO_INTERRUPT] = { true, INSTR_FMT_IB },
[ENTER_EXECUTOR] = { true, INSTR_FMT_IB },
[POP_JUMP_IF_FALSE] = { true, INSTR_FMT_IB },
[POP_JUMP_IF_TRUE] = { true, INSTR_FMT_IB },
@@ -949,6 +1019,10 @@ const struct opcode_metadata _PyOpcode_opcode_metadata[256] = {
[BEFORE_ASYNC_WITH] = { true, INSTR_FMT_IX },
[BEFORE_WITH] = { true, INSTR_FMT_IX },
[WITH_EXCEPT_START] = { true, INSTR_FMT_IX },
+ [SETUP_FINALLY] = { true, INSTR_FMT_IX },
+ [SETUP_CLEANUP] = { true, INSTR_FMT_IX },
+ [SETUP_WITH] = { true, INSTR_FMT_IX },
+ [POP_BLOCK] = { true, INSTR_FMT_IX },
[PUSH_EXC_INFO] = { true, INSTR_FMT_IX },
[LOAD_ATTR_METHOD_WITH_VALUES] = { true, INSTR_FMT_IBC00000000 },
[LOAD_ATTR_METHOD_NO_DICT] = { true, INSTR_FMT_IBC00000000 },