GH-116468: Use constants instead of oparg in stack effects when oparg is known to be a constant. (GH-116469)

This commit is contained in:
Mark Shannon 2024-03-11 09:30:15 +00:00 committed by GitHub
parent 8d7fde655f
commit 4e5df2013f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 98 additions and 108 deletions

View file

@ -116,7 +116,7 @@ int _PyOpcode_num_popped(int opcode, int oparg) {
case CALL_LEN:
return 2 + oparg;
case CALL_LIST_APPEND:
return 2 + oparg;
return 3;
case CALL_METHOD_DESCRIPTOR_FAST:
return 2 + oparg;
case CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS:
@ -130,11 +130,11 @@ int _PyOpcode_num_popped(int opcode, int oparg) {
case CALL_PY_WITH_DEFAULTS:
return 2 + oparg;
case CALL_STR_1:
return 2 + oparg;
return 3;
case CALL_TUPLE_1:
return 2 + oparg;
return 3;
case CALL_TYPE_1:
return 2 + oparg;
return 3;
case CHECK_EG_MATCH:
return 2;
case CHECK_EXC_MATCH:
@ -879,7 +879,7 @@ int _PyOpcode_num_pushed(int opcode, int oparg) {
case UNPACK_SEQUENCE_TUPLE:
return oparg;
case UNPACK_SEQUENCE_TWO_TUPLE:
return oparg;
return 2;
case WITH_EXCEPT_START:
return 5;
case YIELD_VALUE: