Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Move unused/5 from op _LOAD_ATTR_INSTANCE_VALUE to macro
  • Loading branch information
gvanrossum committed Jul 29, 2023
commit 757a46c6fef35cfaa217476f7efccfd91a895c94
2 changes: 1 addition & 1 deletion Include/internal/pycore_opcode_metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,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_IBC00000, INSTR_FMT_IBC00000000, INSTR_FMT_IX, INSTR_FMT_IXC, INSTR_FMT_IXC0, INSTR_FMT_IXC00, INSTR_FMT_IXC000 };
enum InstructionFormat { INSTR_FMT_IB, INSTR_FMT_IBC, INSTR_FMT_IBC00, INSTR_FMT_IBC000, INSTR_FMT_IBC00000000, INSTR_FMT_IX, INSTR_FMT_IXC, INSTR_FMT_IXC0, INSTR_FMT_IXC00, INSTR_FMT_IXC000 };

#define IS_VALID_OPCODE(OP) \
(((OP) >= 0) && ((OP) < OPCODE_METADATA_SIZE) && \
Expand Down
5 changes: 3 additions & 2 deletions Python/bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1821,7 +1821,7 @@ dummy_func(
DEOPT_IF(!_PyDictOrValues_IsValues(dorv), LOAD_ATTR);
}

op(_LOAD_ATTR_INSTANCE_VALUE, (index/1, unused/5, owner -- res2 if (oparg & 1), res)) {
op(_LOAD_ATTR_INSTANCE_VALUE, (index/1, owner -- res2 if (oparg & 1), res)) {
PyDictOrValues dorv = *_PyObject_DictOrValuesPointer(owner);
res = _PyDictOrValues_GetValues(dorv)->values[index];
DEOPT_IF(res == NULL, LOAD_ATTR);
Expand All @@ -1835,7 +1835,8 @@ dummy_func(
unused/1 + // Skip over the counter
_GUARD_TYPE_VERSION +
_CHECK_MANAGED_OBJECT_HAS_VALUES +
_LOAD_ATTR_INSTANCE_VALUE;
_LOAD_ATTR_INSTANCE_VALUE +
unused/5; // Skip over rest of cache

inst(LOAD_ATTR_MODULE, (unused/1, type_version/2, index/1, unused/5, owner -- res2 if (oparg & 1), res)) {
DEOPT_IF(!PyModule_CheckExact(owner), LOAD_ATTR);
Expand Down