gh-87729: specialize LOAD_SUPER_ATTR_METHOD (#103809)

This commit is contained in:
Carl Meyer 2023-04-25 11:45:51 -06:00 committed by GitHub
parent cef542ca57
commit ef25febcf2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 539 additions and 357 deletions

View file

@ -207,6 +207,8 @@ _PyOpcode_num_popped(int opcode, int oparg, bool jump) {
return 2;
case LOAD_SUPER_ATTR:
return 3;
case LOAD_SUPER_ATTR_METHOD:
return 3;
case LOAD_ATTR:
return 1;
case LOAD_ATTR_INSTANCE_VALUE:
@ -593,6 +595,8 @@ _PyOpcode_num_pushed(int opcode, int oparg, bool jump) {
return 0;
case LOAD_SUPER_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_ATTR_INSTANCE_VALUE:
@ -775,7 +779,7 @@ _PyOpcode_num_pushed(int opcode, int oparg, bool jump) {
}
#endif
enum InstructionFormat { INSTR_FMT_IB, INSTR_FMT_IBC, INSTR_FMT_IBC00, INSTR_FMT_IBC000, INSTR_FMT_IBC00000000, INSTR_FMT_IBIB, INSTR_FMT_IX, INSTR_FMT_IXC, INSTR_FMT_IXC000 };
enum InstructionFormat { INSTR_FMT_IB, INSTR_FMT_IBC, INSTR_FMT_IBC00, INSTR_FMT_IBC000, INSTR_FMT_IBC00000000, INSTR_FMT_IBIB, INSTR_FMT_IX, INSTR_FMT_IXC, INSTR_FMT_IXC000, INSTR_FMT_IXC00000000 };
struct opcode_metadata {
bool valid_entry;
enum InstructionFormat instr_format;
@ -883,7 +887,8 @@ const struct opcode_metadata _PyOpcode_opcode_metadata[256] = {
[DICT_UPDATE] = { true, INSTR_FMT_IB },
[DICT_MERGE] = { true, INSTR_FMT_IB },
[MAP_ADD] = { true, INSTR_FMT_IB },
[LOAD_SUPER_ATTR] = { true, INSTR_FMT_IB },
[LOAD_SUPER_ATTR] = { true, INSTR_FMT_IBC00000000 },
[LOAD_SUPER_ATTR_METHOD] = { true, INSTR_FMT_IXC00000000 },
[LOAD_ATTR] = { true, INSTR_FMT_IBC00000000 },
[LOAD_ATTR_INSTANCE_VALUE] = { true, INSTR_FMT_IBC00000000 },
[LOAD_ATTR_MODULE] = { true, INSTR_FMT_IBC00000000 },